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

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

   $ownID=$_POST['owniD'];   
   $shopid=$_POST['shopid']; 
   //$ownerD=$_POST['ownerD'];
 $getS=$econ->getSelectedShopOther($shopid);
 if ($getS->rowCount()>0) {
  $shop=$getS->fetch();

?>

<center><table border="0" width="80%">

	<tr><td colspan="2" align="center"><b>ENTERPRENEURS' GOODS</b></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="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="selectedShopItemDetail.php" method="post">
     <!-- <form action="defaultEnterpreneursEntryIn.php" method="post">-->

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

                      <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 business  name and category.</i>
                      
                      <!--<input  type="hidden" name="ownerDs" id="ownerDs" value="<?php  //echo $ownerD;?>">-->


                      <input   type="hidden" name="shopids" id="shopids" value="<?php  echo $shopid;?>">
      </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>
 
 
<tr>
	<td colspan="2" height="40px">
		

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

   <?php
    require_once('shopNavLink.php');
    ?>
<!--HEADING-- 
 <ul id="lipad">
       <li >
                 <form action="selectedShopItemDetail.php" method="post">

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


                     <input class="hi" type="hidden" name="shopid"  value="<?php //echo $shop['shopid'];?>">
                      <input class="hi" type="hidden" name="ownerD"  value="<?php// echo $shop['ownerid'];?>">

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

                 </form>

                </li>
       
 
   
       <li >
        
                <form action="newshopitempost.php" method="post">

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


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

 

                      <input  class="spos" type="submit" value="New product" name="post"  >

                 </form>

       </li>

       <li >
        
                <form action="OrderToMyShop.php" method="post">

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


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

 

                      <input  class="spos" type="submit" value="Product order" name="post"  >

                 </form>

       </li>
  </ul>



 -TAIL-->



	</td>
 </tr>
 </tr>
<?php
$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="itemMoreDetailOwner.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="hi" type="hidden" name="ownerD"  value="<?php// echo $ownerD;?>">-->

                      <input class="hi" 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=$econ->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 product!..<p/>
				</li>
		<?php
		 
          } 
		?>
		</ul>

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

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

                 </form>
				 
		</td>
	</tr>
<?php
}
}
else
{
	?>
	<tr>
		<td colspan="2">
		Product 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=$('#owniD').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');
?>