
<?php
require('../head2Alts.php');
 if (isset($_POST['dealid']) && isset($_POST['owniD'])) {
 $post=$_POST['post'];	 
 $dealid=$_POST['dealid'];  
 $ownID=$_POST['owniD'];


 ////////////////// UPDATE PRICE///////////// 
 
 ///////////UPDATE STATUS ENDS////////////
?>
<center>
 <label id="main_lab" >
         HEXA<font size="6">N</font>DEAL </label><br/>
 

<!------CODE FOR EDITING PRICE
	///////////////////////////--->
<?php
 
 $getS=$xcon->getOtherThisDealDetail($dealid,$ownID);
 if ($getS->rowCount()>0) {
  $DD=$getS->fetch();
  $dealid =$DD['dealid'];
?>
<!------CODE FOR EDITING PRICE
	///////////////////////////--->
<table border="0" width="100%" >
 <tr>
    <td align="left" >
      <ul style="padding-left:0%;">
      <li>
          <form action="hexaNdeal.php" method="post">
          <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

               <input  class="pos" type="submit" value="Deal" name="post"  >
            </form>
 
      </li>
      <li>
        <form action="hexaNdeal.php" method="post">

               <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                    <input  class="pos" type="submit" value="Need" name="post"  >
                 </form>
      </li>
    </ul>
    
    </td>
   
    <td align="right" width="50%">
    <ul>
      <li>
        <form action="dealPostForm.php" method="post">

               <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                    <input  class="pos" type="submit" value="Have what?" name="post"  >
                 </form>
      </li>
      <li>
        <form action="needPostForm.php" method="post">

               <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                    <input  class="pos" type="submit" value="Need what?" name="post"  >
                 </form>
      </li>
    </ul>
    
    </td>
  </tr>
 
<tr>
	<td colspan="2" height="40px" >
		

	  <label id="main_lab"><?php echo $DD['title'];?></label>
    <ul> 
         <b>Contact Owner(<?php echo $DD['cperson'];?>): 
                      <?php echo $DD['cphone'];?> 
    </ul>

	</td>
 </tr>
 <tr>

	  

     <td width="40%"   align="justify" height="auto" >
		     <b>DEAL:  <?php echo $DD['title'];?> summmary</b>
     </td>


	<td   height="40px" width="60%">


		<b> <?php echo $DD['title'];?> images<br/>
	</td>
   </tr>
   <tr>
      
		 
	
	 <td align="justify" width="40%" >

					 <img src="<?php echo $DD['profileimage'];?>" id="picd" >
		<p/> 
             

  	 
			<ul id="lipad">

				<li id="pad"> 
                     <b>Deal id</b><hr><?php echo $DD['dealid'];?></hr> 
				</li>
			    <li id="pad"> 
                     <b>Category</b><hr>

                     <?php echo $DD['category'];?></hr>

                </li>
				<li id="pad">
                     <b> value</b><hr>

                      <?php echo $DD['currency'].":". $DD['cvalue'];?></hr> 
				</li>
				<li id="pad"> 
                      <b>Owner name</b><hr> <?php echo $DD['cperson'];?></hr> 
				</li>
				<li id="pad"> 
                      <b>Contact person:</b><hr> <?php echo $DD['cphone'];?></hr> 
				</li>



				<li id="pad"> 
                      <b>Date posted</b><hr><?php echo $DD['posteddate'];?></hr>
				</li>

				<li id="pad"> 
                      <b>Expire on</b><hr> <?php echo $DD['addeadline'];?> </hr>
				</li>
				<li id="pad"> 
                      <b>Status</b><hr> <?php
                     
                      
                       if ($DD['status']=="Expired")
                        {
                          /////////////////UPGRADE STATUS//////////////
                          /////////////////////////////////////////////
                        ?>
                    <form id="order" action="myDealPostDetail.php" method="post">

                      <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">


                     <?php echo $DD['status'];?>:<input class="hi" type="hidden" name="dealid"  value="<?php echo $dealid;?>">

   


                      <input class="pos" type="submit" value="Upgrade" name="post">  

                 </form>
                 <?php
                        }
                        else
                        {
                          echo $DD['status'];

                        }

                     /////////////////UPGRADE END/////////////
                        /////////////////////////////////
                      ?> </hr>
				</li>



				 
			</ul>
			<p><ul>
				<li id="pad">
					 <b>Deal description</b><hr>

                       <?php echo $DD['description'];?> </hr>
     
				</li>
				<li>
					<b> Deal location address</b><hr>

                        <?php echo $DD['locationaddress'];?></hr> 
     
				</li>
			   </ul>
			
		</td>

		<td valign="top" width="50%" align="justify">
		<?php 
	    $itD=$xcon->getMyDealImage($dealid);
        if ($itD->rowCount()>0)
         {
   	        $itmD=$itD->fetchAll();
			?>
			<ul style="padding-top:0%">
			<?php
        foreach ($itmD as $key =>$D)
         {
	  

	     ?>
				<li style="padding-top:0%; text-align:top; padding-left:0%;">
				<b><?php echo $D['title']; ?><br/>
				<img src="<?php echo $D['directory'];?>" id="itemimage"><p/>
                <i><small>Posted:<?php echo $D['posteddate']; ?></small></i>

                
				</li>
		<?php
		 }
   	    
          }
        else
          {
             ?>
				<li> 
				No more images!..
				</li>
		<?php
		 
          } 
		?>
		</ul>
		</td>

	</tr>
 
</table>
</center>
<?php
}
else{
	echo "NETWORK ERROR!..";
    }
}
 else
{
 	 echo "Some thing went wrong while processi the page!..";
}

 
        require_once('../footerIns.php');
        ?>
