<?php
 
 
require_once("../head2Alts.php");
?>
<table border="0" class="shop_default">
<tr>
	<td> 

	  <label id="main_title">WELCOME TO BUDA SHOPING CENTRE</label>

     
  </td>
  <td align="right">
  
        
                <form action="myOrder.php" method="post">

                      <input class="hi" type="text" name="owniD"  value="<?php echo $ownID;?>">
 
                      <input  class="spos" type="submit" value="My Order" name="post"  >

                 </form>
 

   </td>
 </tr>
</table>
<?php 
$ownID="";
if(isset($_POST['owniD'])){
$ownID=$_POST['owniD'];
?>
<table border="0" class="shop_default">
 <tr>
	<td colspan="2"> 

	  <label id="main_lab">MY SHOP</label>

    </td>
 </tr>
<?php    
$myS=$mcon->getMyShop($ownID);
if($myS->rowCount()>0){
 $sho=$myS->fetchAll();
 foreach ($sho as $key => $shop) {
  
?> 

<tr>
	<td valign="top" width="15%" rowspan="2">

		   <ol class="homeD">

                <li>
                 <form action="selectedShopItemDetail.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="<?php echo $shop['shopname'];?>" name="post"  >

                 </form>

                </li>
              </ol> 
	</td>

	<td valign="top" width="85%">
	
  <ul >
      <li>
                 <form action="myShopIemListView.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="spos" type="submit" value="My stock" 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 item" 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="New order" name="post"  >

                 </form>

       </li>
  </ul>

	</td>

</tr>
 
  <tr>
       <td>
             
  <label id="main_lab">PRODUCTS</label><p/>
  <?php
 $shopid=$shop['shopid']; 
  ///////
$pm=$mcon->getShopItemPrices($shopid,$ownID);

if($pm->rowCount()>0){
   $pim=$pm->fetchAll();
   ?>
    <ul>
    <?php
   foreach ($pim as $key => $pi) {
$itemid=$pi['itemID'];
$item=$mcon->getThisItem($itemid);
if($item->rowCount()>0){
   $it=$item->fetch(); 
  /////
   
      ?>

            <li style="padding-right:2%"> 
            <img src="<?php echo $it['profileimages'];?> " id="icon"/>
                <center><i>Sales at:<b><?php echo  $pi['currency'].$pi['price'];?></b></i><br/> 

                <b><?php echo $it['itemname'];?></b><p/>

                 



                  <form action="itemMoreDetailOwner.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="itemid"  value="<?php echo $it['itemid'];?>">

                      <input  id="item" type="submit" value="More detail" name="post"  >

                 </form></center>



            </li>

      
      <?php
       }
      
  }
 ?>
  </ul>
<?php
 // else
   //  {
    //  echo "Products for sale not yet uploaded!..";
     //}
}
  ?>

  <p/><label id="main_lab">LOCATION AND CONTACT INFORMATION</label><p/>

     <ul>
        <li id="padli">
          <label id="min_lab">NAME</label>
          <p/><i><?php echo $shop['shopname'];?></i>
        </li>
         <li id="padli">
          <label id="min_lab">STREET</label>

          <p/><i><?php echo $shop['street'];?></i>
        </li>
        <li>
          <label id="min_lab">WARD</label>

          <p/><i><?php echo $shop['ward'];?></i>

        </li>

        <li id="padli">
          <label id="min_lab">DISTRICT</label>

          <p/><i><?php echo $shop['district'];?></i>
        </li>
        <li id="padli">
          <label id="min_lab">REGION</label>

          <p/><i><?php echo $shop['region'];?></i>
        </li>
        <li id="padli">
          <label id="min_lab">COUNTRY</label>

          <p/><i><?php echo $shop['country'];?></i>
        </li>

        <li id="padli">
          <label id="min_lab">PHONE NUMBER</label>

          <p/><i><?php echo $shop['phoneno'];?></i>
        </li>

        <li id="padli">
          <label id="min_lab">EMAIL ADDRESS</label>

          <p/><i><?php echo $shop['email'];?></i>
        </li>

        <li id="padli">
          <label id="min_lab">POSTAL ADDRESS</label>

          <p/><i><?php echo $shop['postAddress'];?></i>
        </li>
        <li id="padli">
          <label id="min_lab">POPULAR MARK</label>

          <p/><i><?php echo $shop['popularmark'];?></i>
        </li> 
     </ul><p/>



       </td>

  </tr>


<?php
  	 
 }	
}
else{ 
	?>
	<tr>
		<td colspan="2">
			Not yet register a shop!..
		</td>

	</tr>
  </table>
<?php
}

}
else{
	echo "Connect Error Reload again";
}
require('OtherShopIn.php');
 
 require_once('../footerIns.php');
?>