<?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="Order records" name="post"  >

                 </form>
 

   </td>
 </tr>

 <tr>
  <td colspan="2">
<ul>
  <li style="padding-right:3%;">
    <form id="order" action="buda_shoping_center.php" method="post">

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

                       
                      <input  class="spos" type="submit" value="My shop" name="post"> 

                 </form>  
     
  </li>
<li style="padding-right:70%;">
   <form id="order" action="defaultShopingCenterInOther.php" method="post">

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

                       
                      <input  class="spos" type="submit" value="Other shop" name="post"> 

                 </form> 
</li>
 
  <li>
 <form id="order" action="itemViewInOther.php" method="post">

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

                       
                      <input  class="spos" type="submit" value="Item view" name="post"> 

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

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

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

<tr>
	 

	<td valign="top" width="85%">
	 <?php
         require('shopNavLink.php');
         ?>
  

	</td>

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

if($pm->rowCount()>0){
  $pim=$pm->fetchAll();
  $count=$pm->rowCount();
  $div=floor($count/10);
  $mod=$count % 10;
  $chec=0;
  $draw=10 - $mod;
 ?>
 
 
 <table  style="border: 4px solid white;margin-top:12px;"> 
 <?php
 foreach ($pim as $key => $pi) {
 $itemid=$pi['itemID'];
 $item=$scon->getThisItem($itemid);
 if($item->rowCount()>0){
   $it=$item->fetch(); 
  if($div>0)
		    {
		     $chec++;
		     if($chec==1)
    		     {
    		         echo "<tr>";
    		     }
		 
			  ?>


               <td style="width:10%;border: 4px solid white;" valign="top"> 
                              
                <img src="<?php echo $it['profileimages'];?> " style="width:100%; height:80px; border-radius: 12px;"/>
                       
                <center><i><b><?php echo  $pi['currency'].$pi['price'];?></b></i><br/> 

                <small><?php echo $it['itemname'];?></small><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 $pi['shopid'];?>">


                      <input class="hi" type="hidden" name="itemid"  value="<?php echo $pi['itemID'];?>">

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

                 </form></center>



            

                   </td>

			
		    	<?php
		     	if($chec==10)
        			{
        			    echo "</tr>";
        			    $chec=0;
        			    $div--;
        			}
        			
        	 	
        			
	        }
	        
	   else if($div<=0){
	            
	       //////////////
	        
	        $chec++;
	        if($mod > 0)
		    {
		     if($chec==1)
    		     {
    		         echo "<tr>";
    		     }
		 
			  ?>


                 <td style="width:10%;border: 4px solid white;" valign="top"> 
                              
                   <img src="<?php echo $it['profileimages'];?> " style="width:100%; height:80px; border-radius: 12px;"/>
                 
                  <center><i><b><?php echo  $pi['currency'].$pi['price'];?></b></i><br/> 

                  <small><?php echo $it['itemname'];?></small><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 $pi['shopid'];?>">


                      <input class="hi" type="hidden" name="itemid"  value="<?php echo $pi['itemID'];?>">

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

                 </form></center>
                 
		         </td>

			
		    	<?php
		     	if($chec==$count%10)
        		    {
        			     
        		    ?> 
        		   <td colspan="<?php echo $draw;?>">  </td>;
        		   </tr>
        		   <?php
        		   $chec=0;
        		   $mod--;
        		 }
	            }
	       ////////////////
	       
	         }
	        
		   }
		   }
		   ?>
		   </table>
		   <?php
      
      
  }
 ?>
  

  <p/><label id="main_lab"> CONTACT INFORMATION:+<?php echo $shop['phoneno'];?></label><p/>
<?php
/*
     <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');
?>