
<?php
require('../headers.php');

  if(isset($_POST['shopid']))
     {
    
 $shopid=$_POST['shopid'];
 
 $getS=$myAgrocon->getSelectedShopOther($shopid);
 if ($getS->rowCount()>0) {
  $shop=$getS->fetch();
  $ownID=$shop['ownerid'];
?>

<center>
<table border="0" width="90%">
<tr>
	<td colspan="2" height="150px" align="center" valign="bottom">
		

	  <label style="font-size:35px;"><b> <?php echo $shop['shopname'];?></b></label>.<p>
	  	<br><i>(Contact:<?php echo $shop['phoneno'];?>)</i></p>

	</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="selectedShopItemDetailout.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 type="hidden"   name="shopid" id="shopid" value="<?php echo $shop['shopid'];?>">
                       <input type="hidden"   name="owniD" id="owniD" value="<?php echo $shop['ownerid'];?>" >


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

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

</tr>

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

<table border="1" style="border-color:white" id="output" width="100%">

<tr>
    <td colspan="6" >
      <table   width="100%" >
        <tr>
           <td>
    
      
             <form action="selectedShopItemDetailout.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="A" name="post">

                 </form>
    
           </td>
    
    
           <td>
    
      
             <form action="selectedShopItemDetailout.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="B" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
    
      
             <form action="selectedShopItemDetailout.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="C" name="post">

                 </form>
           </td>
           
           
           
           <td>
    
      
             <form action="selectedShopItemDetailout.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="D" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
      
             <form action="selectedShopItemDetailout.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="E" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
      
             <form action="selectedShopItemDetailout.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="F" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
    
      
             <form action="selectedShopItemDetailout.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="G" name="post">

                 </form>
           </td>
           
           <td>
    
    
      
             <form action="selectedShopItemDetailout.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="H" name="post">

                 </form>
           </td>
           
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="I" name="post">

                 </form>
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailout.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="J" name="post">

                 </form>
    
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="K" name="post">

                 </form>
           </td>
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="L" name="post">

                 </form>
           </td>
           
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="M" name="post">

                 </form>
           </td>
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="N" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="O" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="P" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="Q" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="R" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="S" name="post">

                 </form>
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailout.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="T" name="post">

                 </form>
           
    
           </td>
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="U" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailout.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="V" name="post">

                 </form>
           </td>
            <td>
    
      
             <form action="selectedShopItemDetailout.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="W" name="post">

                 </form>
    
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailout.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="X" name="post">

                 </form>
    
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailout.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="Y" name="post">

                 </form>
    
           </td>
            <td>
    
      
             <form action="selectedShopItemDetailout.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="Z" name="post">

                 </form>
    
           </td>
           
       </tr>
    
    </table>
    
    
    </td>
    
 </tr>
    <tr>
        
             <td id="td_height" ><label id="inner_top">S/N</label>
       
       
       
      
             <form action="selectedShopItemDetailout.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="selectedShopItemDetailout.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>
        
        
        
         <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>  
 
               <td id="td_height" ><label id="inner_top">PLACE ORDER</label></td>  
 
                </tr>    
      

 <?php
    
    $shopid=$_POST['shopid'];
    $ownID=$_POST['owniD'];
    
  
  
  
    $post=$_POST['post'];
    if($post=="Order by sn"){
      $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();//getShopItemPrices($shopid,$ownID);
       
        }
      if ( $chkp->rowCount()>0) {
       $chp=$chkp->fetchAll();
    
    foreach ($chp as $key => $p) {

    $itemid=$p['itemid'];
    $item=$myAgrocon->getCheckedShopItemPrices($itemid,$shopid,$ownID);//getThisItem($itemid);
    if ($item->rowCount()>0) {
    $c=$item->fetch();
      
      $cc++;
     
        ?>
   <tr>
      
     <td colspan="10" align="right">
       <sup id="rdn<?php echo $cc;?>"></sup>
     </td>
   </tr>
  <tr>
 <td >
 
     <?php
          echo $p['s_no'];
       ?>
  </td> 
  <td >
 
     <?php
          echo $p['itemname'];
       ?>
  </td> 
  <td >
 
     <?php
          echo $p['itemtype'];
       ?>
  </td> 

  <td >
 
        <?php
            echo $p['itemcategory'];
         ?>
    </td> 
  
 
  <?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 $c["price"];?> </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 
}
 
//}
}
?>

 

          




  <!--
   </table>

   </center>
  
  <tr>
		<td width="20%" height="auto" valign="top" align="center">
		<b><?php //echo  $it['itemname'];?> profile image</b><p/>
		 
	       
					<img src="<?php // $it['profileimages']; ?>" width="100%" id="pic">
		 
     
		</td>


		<td width="80%" valign="top">
			
            <b><?php //echo  $it['itemname'];?></b>
                <p/>  

             <form id="order" action="loginOrRegisterToOrder.php" method="post">

                      <!--<input class="hi" type="text" name="owniD"  value="<?php// echo $ownID;?>">- 


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


                      <input class="hi" type="text" name="itemid"  value="<?php// echo $it['itemid'];?>">

 
                    
                      <input  id="item" type="submit" value="Order Now" name="post"><b>Price: <?php //echo $pi['currency']. $pi['price'];?></b>

                 </form>
 

                       <b>Other images</b><p/>
		            <?php
	  // $profile=$it['profileimages'];
	  // $itD=$myAgrocon->getThisItemImage($shopid,$itemid,$profile);
     //  if ($itD->rowCount()>0)
         {
   	        //$itmD=$itD->fetchAll();
			?>
			<ul style="padding-top:0%">
			<?php
       // foreach ($itmD as $key => $D)
         {
	 

	     ?>
				<li style="padding-top:0%; text-align:top; padding-left:0%;">
				<b><?php //echo $D['imagename'] ?><br/>
				<img src="<?php //echo $D['directory'] ?>" id="itemimage"><p/>
                <i><small>Posted:<?php// echo $D['posteddate'] ?></small></i></b>
				</li>
		<?php
		 }
   	    
          }
   //else
          {
             ?>
				<li> 
				No more images for the items!..<p/>
				</li>
		<?php
		 
          } 
		?>
		</ul>

                         <b>Description</b><p/>

                         <?php //echo  $it['description'];?>

                 </form>
				 
		</td>
	</tr>-->
<?php
 
}
else
{
	?>
	<tr>
		<td colspan="5">
		Item not yet uploaded!..
			
		</td>
	</tr>
	<?php
}
//
?>
</td></tr>
</table> 
</center>
 </table>

   </center>
<?php
}
else{
	echo "Request timeout!..";
    }
}
 else
{
 	 echo "Some thing went wrong while processi the page!..";
}

?>
<script>

  function submision(){
    
    var searchValue=$('#searchValue').val();

    var shopid=$('#shopid').val();
    var ownID=$('#owniD').val();
    $('#result').empty();
    $.post('searchThisShopItem.php',{searchValue:searchValue,shopid:shopid,owniD:ownID},function(data){
      $('#result').html(data);

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