 
<?php 
require('../headers.php');
?>
<center> 
<table border="0" class="shop_default">
 <tr>
	<td colspan="2"> 

	  <label id="main_lab">AVAILABLE SHOPS</label>

    </td>
 </tr>
 <tr>
  <td colspan="2">
<ul>
  <li style="padding-right:3%;">
  <label id="lab"><a style="color:blue;"  href="defaultShopingCenter.php">Shop view</a></label> 
  </li>
<li style="padding-right:70%;">
  <label id="lab"><a style="color:blue;"  href="buda_shoping_centerout.php">Shop detail view</a></label> 
</li>
 
  <li>

  <label id="lab"><a style="color:blue;"  href="itemViewOut.php">Item view</a></label> 
 </li>
</ul>
</td>
</tr>
 <tr>
  <td colspan="2" align="center">
    
      <form action="itemViewOut.php" method="post">

            <label id="search_lab">
                       <i>
                          Search shop item here:-
                      </i> 
             </label>
                      <input type="text" class="hotel_info" height="25px" name="searchValue" id="searchValue" onkeyup ="submision()">

                      <input class="subs" type="submit" value="Search" name="search" id="search" ><br>
                      <i>You can search by name or category..</i>
            
      </form>
     
      <div  id="result" >
       <?php
      if(isset($_POST['search']))
        {

        $searchValue=$_POST['searchValue'];
       if ($searchValue!="") {
         require_once('searchItemOut.php');
        } 
      }
        ?>
      </div>
  </td>

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

<table border="1" style="border-color:white" id="output">
    
    <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><label id="inner_top">SELLER/SHOP</label></td>

                <td><label id="inner_top">SHOP CATEGORY</label></td>
 
                <td id="td_height" ><label id="inner_top">PRICE</label></td><td  ><label id="inner_top">SELLER CONTACT</label></td> 
 
                   <td  ><label id="inner_top">PLACE ORDER</label></td>
                </tr>    
      

<?php 
// 
 $myS=$gcon->getShop();
     
if($myS->rowCount()>0){
 $sho=$myS->fetchAll();
 foreach ($sho as $key => $nsroN) {
  $shopid=$nsroN['shopid'];
  $ownerD=$nsroN['ownerid']; 
  $pD=$gcon->getShopItemPricesOtherView($shopid,$ownerD);

  if($pD->rowCount()>0){
        //echo $pD->rowCount(). " results found!..";
  $proN=$pD->fetchAll();
  foreach ($proN as $key => $prowN){ 
  $itemid=$prowN['itemID'];
  $dD=$gcon->getThisItem($itemid);
  
  
  if($dD->rowCount()>0){
  $rowN=$dD->fetch();
      ?>
          
     
 <tr><td id="td_height" >

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

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

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

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

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

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


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

  
     <td id="td_height" ><label id="inner_lab"><?php echo $nsroN["phoneno"];?> </label>
     </td>
    <td>
     <form id="order" action="../home.php" method="post">
       <input  id="item" type="submit" value="Order Now" name="post">  
     </form>
    </td>
     
   </tr> 
        
          <?php
          }
        }
     }
      else
{
  ?> 
    Item not yet uploaded!..
      
   
  <?php
}
    }
 
}  

else{ 
  ?>
  <tr>
    <td colspan="2">
      
      <?php

      //////////// 
   if(isset($_POST['search']))
       {

        $searchValue=$_POST['searchValue'];
        if ($searchValue=="") {
            
          ?>
          <p><label id="min_lab">
           Searching empty results!.. 
           </label>
           <?php

         }
       }
       else{
        // ?>
          <p><label id="min_lab">
           No shop available!.. 
           </label>
           <?php
       } 
       ////////////
      ?>
    
       
   </table> 

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

  function submision(){
    
    var searchValue=$('#searchValue').val();
    $('#result').empty();
    $.post('searchItemOut.php',{searchValue:searchValue},function(data){
      $('#result').html(data);

    });
  }
 
</script>

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