<?php
 
 
require_once("../head2Alts.php");
?>
<center><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 colspan="2"> 

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

    </td>
 </tr>
<?php    
$myS=$gcon->getMyShop($ownID);
if($myS->rowCount()>0){
 $sho=$myS->fetchAll();
 foreach ($sho as $key => $shop) {
  $shopid=$shop['shopid'];
 //$ownID=$_POST['owniD'];
    
?> 

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

		   
<?php
require('shopNavLink.php');
?>
	</td>

</tr>
 
  
<tr>
  <td colspan="2">
             
  
<label id="main_lab">PRODUCTS</label><p/>

 
<center>

<table border="1" style="border-color:white" id="output">
    <tr><td colspan="5">
        
        <?php
        require_once('alphabetsort.php');
        ?>
        
    </td></tr>
    <!----////////////////////////--->
    
     <tr>
        
             <td id="td_height" ><label id="inner_top">S/N</label>
       
       
       
      
             <form action="buda_shoping_center.php" method="post">

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


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

                    <input  class="spos" type="submit" value="Order by sn" name="post">

                 </form>
       </td>
      <td id="td_height" ><label id="inner_top">NAME</label>
      
        <form action="buda_shoping_center.php" method="post">

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


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

                    <input  class="spos" type="submit" value="Order by name" name="post">

                 </form>
      
      
      </td>
      
      <!---///////////////////////---
    
    
    
    
    
    
    
    
    <tr><td id="td_height" ><label id="inner_top">NAME</label></td> -->
    
    
    <td><label id="inner_top">WEIGHT / VOLUME</label></td>
              <td><label id="inner_top">CATEGORY</label></td>

                <!--<td id="td_height" ><label id="inner_top">MANUFACTURE/VENDOR</label></td>


                <td id="td_height" ><label id="inner_top">DESCRIPTION</label></td>-->
 
                <td id="td_height" ><label id="inner_top">PRICE</label></td>  
 
 
                </tr> 
                
                
                
                
                
                
                
      

 <?php
    

    $post=$_POST['post'];
    if($post=="Order by sn"){
      $chkp= $gcon->getAllItemCheck();
      }
      
      
      
      
      else if($post=="Order by name"){
        $chkp= $gcon->getOrderNameAllItemCheck();
      }
      
      
      else if($post=="A" ||  $post=="B"  ||   $post=="C"  ||  $post=="D"  ||   $post=="E"  ||    $post=="F"  || $post=="G"  ||  $post=="H"  || $post=="I"  || $post=="J"  || $post=="K"  || $post=="L"  ||  $post=="M"  ||  $post=="N"  ||   $post=="P"  || $post=="O"   || $post=="Q"  || $post=="R"  ||$post=="S"  || $post=="T"  || $post=="U"  || $post=="V"  ||  $post=="W"  || $post=="X"  || $post=="Y"  ||  $post=="Z" ){
        $chkp= $gcon->getNameByFLetterItemCheck($post);
        
        }
    else{
       $chkp= $gcon->getAllItemCheck();//getShopItemPrices($shopid,$ownID);
       
        }
      if ( $chkp->rowCount()>0) {
       $chp=$chkp->fetchAll();
    
    foreach ($chp as $key => $it) {

    $itemid=$it['itemid'];
    $item=$gcon->getCheckedShopItemPrices($itemid,$shopid,$ownID);//getThisItem($itemid);
    if ($item->rowCount()>0) {
    $c=$item->fetch();
      
     
        
 
   ?>    
     
 <tr><td >
 
     <?php
          echo $it['s_no'];
       ?>
  </td>
  <td id="td_height" >

 <label id="inner_lab"> <?php echo $it["itemname"];?> </label></td>

     <td><label id="inner_lab"><?php echo $it["itemtype"];?> </label></td>

     <td id="td_height" ><label id="inner_lab"><?php echo $it["itemcategory"];?> </label></td>

    <!-- <td><label id="inner_lab"><?php //echo $it["vendor"];?> </label></td>

     <td><label id="inner_lab"><?php //echo $it["description"];?> </label></td>
 -->


     <td ><label id="inner_lab"><?php echo $c["price"];?> </label></td>

      
   </tr> 
            
       
 
   
<?php 
}
 
 
}
?>

 
 </table>

   </center>
          

  <?php  
  
}
  ?>

  <p/><label id="main_lab"> 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');
?>
</center>
 <?php
 require_once('../footerIns.php');
?>