<?php 
 if (isset($_POST['shopid']) && isset($_POST['owniD']) && isset($_POST['itemid'])) {
 	 
 $shopid=$_POST['shopid'];
 $itemid=$_POST['itemid']; 
 $owniD=$_POST['owniD'];
 $getS=$econ->getMyShopItem($shopid);
 if ($getS->rowCount()>0) {
  $shop=$getS->fetch();

?>

<table border="0" width="100%">

<tr>
	<td colspan="3" height="40px">
		

	  <label id="main_title"><?php echo $shop['shopname'];?> shoping centre!..</label>
<center>
	
	<?php
 $getS=$econ->getSelectedShopOther($shopid);
 if ($getS->rowCount()>0) {
       $shop=$getS->fetch();
        require_once('shopNavLink.php');
           ?>
<!--HEADING-- 
 <ul id="lipad">
       <li >
                 <form action="selectedShopItemDetail.php" method="post">

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


                     <input class="hi" type="hidden" name="shopid"  value="<?php //echo $shop['shopid'];?>">
                      <input class="hi" type="hidden" name="ownerD"  value="<?php echo $shop['ownerid'];?>">

                    <input  class="pos" type="submit" value="<?ph//p echo //$shop['shopname'];?>" name="post"  >

                 </form>

                </li>
       
 
   
       <li >
        
                <form action="newshopitempost.php" method="post">

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


                      <input class="hi" type="text" name="shopid"  value="<?php //echo $shop['shopid'];?>">

 

                      <input  class="spos" type="submit" value="New product" name="post"  >

                 </form>

       </li>

       <li >
        
                <form action="OrderToMyShop.php" method="post">

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


                      <input class="hi" type="text" name="shopid"  value="<?php //echo $shop['shopid'];?>">

 

                      <input  class="spos" type="submit" value="Product order" name="post"  >

                 </form>

       </li>
  </ul>-->

<?php
}
?>

<!--TAIL-->
</center>
	</td>
 </tr>
  
<?php
$item=$econ->getThisItem($shopid,$itemid);
if($item->rowCount()>0){
   $itm=$item->fetch(); 
	  
   ?>

   <tr>

	<td   rowspan="3" width="20%" valign="top">
	<ol style="padding-top:0%">
				<li>
					 
                  <form action="addMoreItemImages.php" method="post">

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


                      <input class="hi" type="text" name="shopid"  value="<?php echo $shopid;?>">


                      <input class="hi" type="text" name="itemid"  value="<?php echo $itm['itemid'];?>">

                      <input  id="item" type="submit" value="Upload more images" name="post"  >

                 </form>
				</li>

				<li>
					 
                  <form action="editItemprofile.php" method="post">

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


                      <input class="hi" type="text" name="shopid"  value="<?php echo $shopid;?>">


                      <input class="hi" type="text" name="itemid"  value="<?php echo $itm['itemid'];?>">

                      <input  id="item" type="submit" value="Edit profile" name="post"  >

                 </form>
				</li>

 
			</ol>
	</td>

     <td width="20%"   align="justify" height="auto" >
		     <b><?php echo  $itm['itemname'];?> profile  summmary</b>
		     		 <img src="<?php echo $itm['profileimages'] ?>" id="pic" >
 
     </td>


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


		<b> <?php echo $itm['itemname'] ?> images<br/>

		<?php
		$profile=$itm['profileimages'];
	    $itD=$econ->getThisItemImage($shopid,$itemid,$profile);
        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['imagename']; ?><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 for the products!..
				</li>
		<?php
		 
          } 
		?>
		</ul>
		 
	</td>
</tr>
  <tr>
      
		 
	
	 <td align="justify" colspan="2" >

			
 
  	 
			<ul id="lipad">

				<li id="pad"> 
                     <i>Product id:</i> <?php echo $itm['itemid'];?> 
				</li>
			<li id="pad"> 
                     <i>Saling price:</i> <?php echo $itm['currency']. $itm['itemcost'];?> 
				</li>
				<li id="pad"> 
                     <i>Product type:</i> <?php echo $itm['itemtype'];?> 
				</li>

				<li id="pad"> 
                     <i>Category:</i> <?php echo $itm['itemcategory'];?> 
				</li>


				<li id="pad"> 
                     <i>Date posted:</i> <?php echo $itm['dateposted'];?> 
				</li>


				<li id="pad"> 
                     <i>Expire date:</i> <?php echo $itm['expiredate'];?> 
				</li>
			</ul>
			<b>Description</b><P/>

           <?php echo  $itm['description'];?>
     
		</td>

		

	</tr>
<?php
 
}
else
{
	?>
	<tr>
		<td colspan="2">
		Item not yet uploaded!..
			
		</td>
	</tr>
	<?php
}
?>
</table>
<?php
}
else{
	echo "NETWORK ERROR!..";
    }
}
 else
{
 	 echo "Some thing went wrong while processi the page!..";
}

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