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

  if(  isset($_POST['shopid']) && isset($_POST['owniD']))
     {

 $ownID=$_POST['owniD'];   
 $shopid=$_POST['shopid'];
 $getS=$econ->getSelectedShopOther($shopid);

 if ($getS->rowCount()>0) {
  $shop=$getS->fetch();

  $ownerD=$_POST['ownerD'];
 

?>

<center><table border="0" width="80%">
<tr>
	<td colspan="2" height="50px" valign="top">
		

	  <label id="main_title"><?php echo $shop['shopname'];?> shoping centre..</label>

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

<ul>
  <li style="padding-right:3%;">
    <form id="order" action="buda_enterprenuers_center.php" method="post">

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

                       
                      <input  class="spos" type="submit" value="My business" name="post"> 

                 </form>  
     
  </li>
<li style="padding-right:70%;">
   
</li>
 
<li>
 <!--<form id="order" action="itemViewInOther.php" method="post">

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

                       
                      <input  id="spos" type="submit" value="Item view" name="post"> 

                 </form> -->
 <form id="order" action="OtherShopIn.php" method="post">

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

                       
                      <input  class="spos" type="submit" value="Detail view" name="post"> 

                 </form>

 </li>


</ul>
</td>
</tr>   
 <tr>
  <td colspan="2" align="center">
    
      <form action="selectedShopItemDetailInOther.php" method="post">

            <label id="search_lab">
                       <i>
                          Search business here:-
                      </i> 
             </label>
                      <input   type="hidden" name="owniDs" id="owniDs" value="<?php  echo $ownID;?>">

                      <input  type="hidden" name="ownerDs" id="ownerDs" value="<?php  echo $ownerD;?>">


                      <input   type="hidden" name="shopids" id="shopids" value="<?php  echo $shopid;?>">

                      <input type="text" class="hotel_info" height="25px" name="searchValue" id="searchValue"  onkeyup ="submision()">
                     <!-- <input class="subs" type="submit" value="Search" name="post">--><br>
                      <i>You can search by name and category.</i>
            
      </form>
        <div  id="result" >
             <?php
        $post=$_POST['post'];
     if($post=="Search")
       {

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

         }
       }
       
 ?>
      </div>
  </td>
</tr>
 
<?php  
  ///////
//$pm=$scon->getShopItemPricesOtherView($shopid,$ownerD);

//if($pm->rowCount()>0){
  // $pim=$pm->fetchAll();
   ?>
    <ul>
    <?php
  
  // $itemid=$pi['itemID'];
/// 
  
  $item=$econ->getShopItem($shopid);
  if($item->rowCount()>0){
   $itm=$item->fetchAll(); 
	  foreach ($itm as $key => $it) {
   $itemid=$it['itemid'];
   
   
   ?>
  <tr>
		<td width="20%" height="auto" valign="top" align="center">
		<b><?php echo  $it['itemname'];?> profile image</b><p/>
		 
	       
					<img src="<?php echo $it['profileimages']; ?>" width="100%" id="pic">
		 
     
		</td>


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

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

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

                      <input  type="hidden" name="ownerD"  value="<?php  echo $ownerD;?>">


                      <input   type="hidden" name="shopid"  value="<?php  echo $it['shopid'];?>">


                      <input   type="hidden" name="itemid"  value="<?php  echo $it['itemid'];?>">

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

                 </form>
 

                       <b>Other images</b><p/>
		            <?php
	   $profile=$it['profileimages'];
	   $itD=$scon->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'] ?></b><br/>
                    				<img src="<?php echo $D['directory'] ?>" id="itemimage"><p/>
                                    <i><small>Posted:<?php echo $D['posteddate'] ?></small></i>
                    				</li>
                        		<?php
              		 }
             	    
          }
   else
          {
             ?>
        				<li> 
        				No more images for the items!..<p/>
        				</li>

	      	   <?php
		 
          } 
		?>
		
        </ul> <br><b>Description</b><p/>

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

                  
				  
		</td>
	</tr>
<?php
}
}
else
{
  ?>
  <tr>
    <td colspan="2">
    Item not yet uploaded!..
      
    </td>
  </tr>
  <?php
}
?>
 
</table> </center>
<?php
}
else{
	echo "NETWORK ERROR!..";
    }
}
 else
{
 	 echo "Some thing went wrong while processi the page!..";
}

?>
<script>

  function submision(){
    
    var searchValue=$('#searchValue').val();
    var ownID=$('#owniDs').val();
    var ownerD=$('#ownerDs').val(); 
    var shopid=$('#shopids').val();
    $('#result').empty();
    $.post('keypressThisShopItemSearchIn.php',{shopids:shopid,ownerDs:ownerD,owniDs:ownID,searchValue:searchValue},function(data){
      $('#result').html(data);

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