 
<?php 
require('../headers.php');
?>
<center>
<table border="0" class="shop_default">
<tr>
  <td  width="65%" align="right" valign="center">
    Staff login:
  </td>
  <td align="right">
    <?php
     if (isset($_GET['id'])){
           echo "<font color='red'>". $_GET['id']."</font>";
            
             }
    require_once("shopStaffLoginForm.php");
    ?>
  </td>
</tr>
<tr><td colspan="2" align="center" height="100px" valign="center"><b>YOU ARE WELCOME TO ONLINE PHARMACY </b></td></tr>




<tr><td colspan="2" height="80px" align="justify" valign="center" >

We are happy that you are here. Get aware of the best price for pharmaceutical items in your region. You can order through our website and pay on delivery.<p>Select one pharmacy from the list to proceed.
</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="buda_shoping_centerout.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>
<?php 
//////////// 
   if(isset($_POST['search']))
       {

        $searchValue=$_POST['searchValue'];

        if ($searchValue!="") {
           
          $myS=$myAgrocon->getShopBySearch($searchValue);
         
         }
         else{

        $myS=$myAgrocon->getShop();

         }
        }
        else
        {
         
        $myS=$myAgrocon->getShop();
       } 
       ////////////
if($myS->rowCount()>0){
 $sho=$myS->fetchAll();
 foreach ($sho as $key => $shop) {
  $shopid=$shop['shopid'];
  $ownID=$shop['ownerid']; 

?>
<tr>
	<td valign="bottom"  height="40px" >
  <table border="0">
    <tr>
      <td colspan="10">
         
                 <form action="selectedShopItemDetailout.php" method="post">
 
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shop['shopid'];?>">

                <input class="hi" type="hidden" name="owniD"  value="<?php echo $shop["ownerid"];?>">
                    <input  class="pos" type="submit" value="<?php echo $shop['shopname'];?>" name="post"  >

                 </form>

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

      </td>
    </tr>

     <tr>
        <td>
          <label id="min_lab">NAME</label> 
        </td>
         <!--<td>
          <label id="min_lab">STREET</label>
 
        </td>
        <td>
          <label id="min_lab">WARD</label>
 

        </td>

        <td>
          <label id="min_lab">DISTRICT</label>
 
        </td>
        <td>
          <label id="min_lab">REGION</label> 
        </td>
        <td>
          <label id="min_lab">COUNTRY</label>
 
        </td>
-->
        <td>
          <label id="min_lab">PHONE NUMBER</label> 
        </td>

        <td>
          <label id="min_lab">EMAIL ADDRESS</label>
 
        </td>

       <!-- <td>
          <label id="min_lab">POSTAL ADDRESS</label> 
        </td>
        <td>
          <label id="min_lab">POPULAR MARK</label>
 
        </td> -->
     </tr> 

     <tr>
        <td> 
           <i><?php echo $shop['shopname'];?></i>
        </td>
         <!--<td> 

           <i><?php //echo $shop['street'];?></i>
        </td>
        <td> 

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

        </td>

        <td> 

           <i><?php// echo $shop['district'];?></i>
        </td>
        <td> 

          <i><?php// echo $shop['region'];?></i>
        </td>
        <td> 

           <i><?php// echo $shop['country'];?></i>
        </td>
-->
        <td> 

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

        <td> 

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

        <!--<td> 

           <i><?php // echo $shop['postAddress'];?></i>
        </td>
        <td> 

           <i><?php //echo $shop['popularmark'];?></i>
        </td>--> 
     </tr> 


  </table> 

 
 
    <!--SHOP LOCATION ENDS-->
 
<tr><td colspan="2">
 <label id="main_lab">PRODUCTS</label> 
<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 id="td_height" ><label id="inner_top">PRICE</label></td>  
 
 
                </tr>    
<?php    
  
 $dD=$myAgrocon->getShopItemPrices($shopid,$ownID);

if($dD->rowCount()>0){
$roN=$dD->fetchAll();
foreach ($roN as $key => $rowN){ 
 
$itemid=$rowN['itemID']; 
$nsD=$myAgrocon->getShopName($shopid);

$nsroN=$nsD->fetch();

$item=$myAgrocon->getThisItem($itemid);
if($item->rowCount()>0){
   $it=$item->fetch(); 
  
    
   ?>    
     
 <tr><td id="td_height" >

<!--<form action="itemMoreDetailOtherInout.php" method="post">
<input class="hi" type="hidden" name="shopid"  value="<?php //echo $rowN["shopid"];?>">

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

<input class="hi" type="hidden" name="owniD"  value="<?php// echo $nsroN["ownerid"];?>">

<input class="hdf" type="submit" value="<?php //echo $it["itemname"];?>" name="post"  >

 </form>--><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 align="right"><label id="inner_lab"><?php echo $rowN["price"];?> </label></td>

      
   </tr> 
<?php 
}
}
 
}
 
?>
</table>
</center></td></tr></table> </center>
  
<?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
       }  
      ?>
		</td>

	</tr>
  </table> </td></tr></table></center>
<?php
}
  
?>
<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');
?> 