<?php
/*
require('../head2Alts.php');
 if (isset($_POST['owniD'])) {
 $post=$_POST['post'];	   
 $owniD=$_POST['owniD'];
 if ($post=="Set as profile image") {
 	$profile=$_POST['profile'];
 	$scon->updateProfileImage($itemid,$shopid,$profile);
 }*/
 ?>
<table border="0" width="100%">
	<tr><td colspan="2"><b><small>OTHER HOUSES WITH FREE ROOM AVAILABLE</small><p/><p/></td></tr>
<?php
 $hs=$hcon->getOtherHouses($ownID);
 if ($hs->rowCount()>0) {
  
   $hH=$hs->fetchAll();
?>

<tr>

 <td   valign="top">
		<ul>
<?php
foreach ($hH as $key => $hD) {


$house_no=$hD['house_no'];

$rD=$hcon->getHousesFreeRoom($house_no);

        if ($rD->rowCount()>0)
         {
   	        $rRD=$rD->fetchAll();
			 

$hMG=$hcon->getHousesPImg($house_no);
if($hMG->rowCount()>0)
             {
               $img=$hMG->fetch();
               $pMG= $img['directory'];
              }
              else
              {
$pMG='../houseimages/defaultP.jpg';
              }


   ?>
  
 <li id="dh"> 
		<b> <?php echo $hD['house_title'] ?> </b><br/>
          <img id="emg" src="<?php echo $pMG?>">
	  
             
					 
                  <form action="getThisHouseDetailIn.php" method="post">

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


                      <input class="hi" type="text" name="house_no"  value="<?php echo $hD['house_no'];?>">

 

                      Free rooms<input  id="item" type="submit" value="(<?php echo $rD->rowCount();?>) " name="post"  >

                 </form>
				 
		  
		 
		  
<?php
        
		?>
		 </li>
		
<?php
 }
 
}

?>
</ul>
		</td>

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