<?php
require_once("head2AltStaff.php");
?>

<?php 

if(isset($ownID)){
?>
<table border="0" class="shop_default">

<?php    
$myS=$myAgrocon-> getThisMyShop($ownID,$shopid);
if($myS->rowCount()>0){
 $sho=$myS->fetchAll();
 foreach ($sho as $key => $shop) {
  $shopid=$shop['shopid'];
    
?> 

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

  </td>

</tr>
 
  
<tr>
  <td colspan="2">
             
  

 
<center>

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

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

                     <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_centerStaff.php" method="post">

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

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

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

                 </form>
      
      
      </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">PRICE</label></td>  
 
 
       </tr> 
      
 <?php
if (isset($_GET['id2']))
 {
  $post="";
 }
  else{
    $post=$_POST['post'];
    } 

   
    if($post=="Order by sn"|| $post=="login"){
      $chkp= $myAgrocon->getAllItemCheck();
      }
      
      
      
      
      else if($post=="Order by name"){
        $chkp= $myAgrocon->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= $myAgrocon->getNameByFLetterItemCheck($post);
        
        }
    else{
       $chkp= $myAgrocon->getAllItemCheck();
       
        }
      if ( $chkp->rowCount()>0) {
       $chp=$chkp->fetchAll();
    
    foreach ($chp as $key => $it) {

    $itemid=$it['itemid'];
    $item=$myAgrocon->getCheckedShopItemPrices($itemid,$shopid,$ownID);
    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 $c["price"];?> </label></td>

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

  <?php  
  
}
  ?>

       </td>

  </tr>


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

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

}
?>
</center>
