<?php

require_once("../head2Alts.php");

  if(isset($_POST['post']))
    {
   $post=$_POST['post'];
   $expireD="";
   
  
 


    //////////////////////////////
    //////////////////////////////////////////T


if(isset($_POST['expireD'])   && isset($_POST['roomid'])   && $_POST['house_no'])   && isset($_POST['owniD']))
  {
 $roomid=$_POST['expireD'];
 $roomid=$_POST['roomid'];
 $house_no=$_POST['house_no']; 
 $owniD=$_POST['owniD'];
 $post=$_POST['post'];
 //$result=0; 
 $rQ="";     //require_once("buda_connect.php");

       //$con=new connect_class();

$item=$hcon->getThisHouse($house_no);
if($item->rowCount()<=0){ 
          

          echo "Page time out";
          }
       else
          {

    ///////////////////////////////
    ///////////////////////////
   
    if($post=="Book")
    { 
   $expireD$_POST['expireD']; 

   if($hcon->vLDate($expireD))
      {
      	$CD=$hcon->getThisHouseRoom($house_no,$roomid);
      	if ($CD->rowCount()>0)
      	{addHouseRentContract($ownID,$roomid, $hnumber, $expireD);
      	}
      	else
      	{
      ?>
   <center>
     <div>
       <sup>
          <?php
       echo "Invalid room id!";
           ?>   
       </sup>
      </div>
   </center> 
         <?php
      	}

      }
   else
      {
      ?>
   <center>
     <div>
       <sup>
          <?php    
            echo $con->eLDate($expireD)."<p/>";       

     ?>
  </sup>
</div>
</center> 
<?php
            require("bookNowForm.php");
   
}
 }	
 
     
}
}
else{
  echo "Page loading error!..";
}
}
else{
  echo "Error occured!..";
}
 
 require_once('../footerIns.php');
?>
