<table width="100%"> 
<tr><td>
<ul class="homeD">
<?php

 $ownID=$_POST["owniD"];; 
 $myS=$scon->getShop();
if($myS->rowCount()>0){
 $sho=$myS->fetchAll();
 $count=$myS->rowCount();
 $div=floor($count/5);
 $mod=$count % 5;
 $chec=0;
 $draw=5 - $mod;
 ?>
	
 <table  style="border: 4px solid white;margin-top:12px;">
 <?php
 foreach ($sho as $key => $row) {
      
	
	  $shop=$row["shopid"]; 
    /*$h=$con->getHotelInfo($hnm);
    $hD=$h->fetch();*/

        $current="current";
          $pimg=$row['directory'];
        if ($pimg!="") {
                    $hProfile=$pimg;//['directory'];
                  }else{
               $hProfile='../itemimages/shoppingicon.png';
                     }
         /*  
          $HP=$con->getHotelProfileImages($shop);
          if($HP->rowCount()>0)
            {
            $hmgp=$HP->fetch();
            $hProfile=$hmgp['directory'];
            }
          else
            {
            $hProfile='../itemimages/shoppingicon.png';
            }*/
 
	 
	 
	  
	  if($div>0)
		    {
		     $chec++;
		     if($chec==1)
    		     {
    		         echo "<tr>";
    		     }
		 
			  ?>


                <td style="width:20%;border: 4px solid white;" valign="top"> 
                 <?php
                 if($hProfile!="")
                 {
                	?>
                	
                   <img src="<?php echo  $hProfile;?> " style="width:100%; height:180px; border-radius: 12px;"/>
                   <!--<img id="pic" src="<?php //echo $hProfile;?>">-->
                   <?php
                   
                 }
                
                ?>
  
    
    
<form action="selectedShopItemDetailInOther.php" method="post">
<input class="hi" type="hidden" name="shopid"  value="<?php echo $row["shopid"];?>">

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

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

<input class="hdf" type="submit" value="<?php echo $row["shopname"];?>" name="post"  >

 </form> 
<?php
/*if($hProfile!=""){
	?>
   <img id="pic" src="<?php echo $hProfile;?>">
   <?php
   
}
*/
?>
<small>Location:<br><i> <?php echo $row["region"]."->". $row["country"];/*."->".$row["region"]."->". $row["district"]."->". $row["street"];*/?> </small></i>
 </td>

            			
            <?php
             if($chec==5)
                	{
                    echo "</tr>";
                    $chec=0;
                    $div--;
                    }
                    			
                    	 	
                    			
            	   }
            	        
            	   else if($div<=0){
            	            
            	       //////////////
            	        
            	       $chec++;
            	        if($mod > 0)
            		    {
            		     if($chec==1)
                		     {
                		         echo "<tr>";
                		     }
            		 
            			  ?>
            
            
             <td style="width:20%;border: 4px solid white;" valign="top">
             <?php
            if($hProfile!=""){
            	?>
            	
             <img src="<?php echo  $hProfile;?> " style="width:100%; height:180px; border-radius: 12px;"/>
               <!--<img id="pic" src="<?php //echo $hProfile;?>">-->
               <?php
               
            }
            
            ?>
  <form action="selectedShopItemDetailInOther.php" method="post">
  <input class="hi" type="hidden" name="shopid"  value="<?php echo $row["shopid"];?>">

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

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

  <input class="hdf" type="submit" value="<?php echo $row["shopname"];?>" name="post"  >

  </form>
		    	<?php
		     	if($chec==$count%5)
        			{
        			     
        			   ?> 
        			   <td colspan="<?php echo $draw;?>">  </td>;
        			    </tr>
        			    <?php
        			    $chec=0;
        			    $mod--;
        			}
	        }
 
	   }
 
}
	 ?>
	</table>
<?php
 

}
else{
	echo "Current there is no any post!..";
}
?>
</td></tr>
  
</table>