<?php
require('../head2Alts.php');
?>
<label id="main_title">WELCOME TO BUDA RENTING HOUSES CENTER</label><p/>
<?php

 if (isset($_POST['owniD'])) {
 $post=$_POST['post'];	   
 $ownID=$_POST['owniD'];
//echo md5("01804120522");
 ?>
 <b>My House</b></p>
<?php
   $receiverid=$ownID;
  $uQ=$hcon->getMyAllInquiry($receiverid);
  if ($uQ->rowCount()>0) 
         {
  	 ?>

  	   <form action="getMyNotificationPreview.php" method="post">

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


                      <!--<input class="hi" type="hidden" name="roomid"  value="<?php //echo $Dr['roomid'];?>">


                      <input class="hi" type="hidden" name="house_no"  value="<?php //echo $Dr['house_no'];?>">-->

 

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

                 </form>
  	 <?php
         }
  /*

                	$QR=$hcon->getThisMyHouseRoomResideInquiry($house_no ,$roomid,$receiverid);
                	if ($QR->rowCount()>0)
                	{
                      $QU= $QR->fetchAll();
                      foreach ($QU as $key => $Qi) {
                       
                     
                         
                		$ownIDS=$Qi['senderid'];
	                    $oD=$con->getMyProfileForContract($ownIDS);
                        $oN=$oD->fetch();
                        echo "<small>".$oN['lname']."<i>:Posted:".$Qi['dateposted']."</i></small><br>".$Qi['inquiry']."<br>"; 
                	    }
                }
                	else
                	{
                		echo "No previous descusion!..";
                	}*/
  
 if ($post=="Set as profile image") {
 	$profile=$_POST['profile'];
 	$scon->updateProfileImage($itemid,$shopid,$profile);
 }
 $hs=$hcon->getMyHouses($ownID);
 if ($hs->rowCount()>0){

  
   $hhD=$hs->fetchAll();
   foreach ($hhD as $key => $hD) {
   

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


   ?>
 

<table border="0" width="100%">
 
<tr>

 <td  height="40px" width="5%" valign="top">
		

	 <b> <?php echo $hD['house_title'] ?> images</b><br/>
          <img id="pic" src="<?php echo $pMG?>">
	  
 <br/>Register on:
		         <small><i> 
                       <?php echo $hD['regdate'];?> 
				</i> </small>
		    
     
	  
	  	

	</td>
  

	 

     <td width="20%"   align="justify" height="auto" >
	
	 <b><?php echo  $hD['house_title'];?> profile  summmary</b>
      

		<ul style="padding-top:0%">
     	<?php
     	if($hMG->rowCount()<=0)
              {
              ?>
				<li>
					 
                  <form action="uploadHouseImageForm.php" method="post">

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


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

 

                      <input  id="item" type="submit" value="Post profile image" name="post"  >

                 </form>
				</li>
              <?php
                }
               ?>
				<li>
					 
                  <form action="addHouseRoomForm.php" method="post">

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


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

 

                      <input  id="item" type="submit" value="Add room" name="post"  >

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

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


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

 

                      <input  id="item" type="submit" value="Preview rooms" name="post">

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

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


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

 

                      <input  id="item" type="submit" value="Preview contract" name="post"  >

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

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


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

 

                      <input  id="item" type="submit" value="Edit house profile" name="post"  >

                 </form>
				</li>
			</ul>

      
		 <ul id="lipad">
	         
 
  	 
			
               <li id="pad"> 
                     <i>Number of room for rent:</i><hr><?php echo $hD['rooms_no'];?></hr> 
				</li>
				<li id="pad"> 
                     <i>House no:</i>  <hr> <?php echo $hD['house_no'];?></hr> 
				</li>
			    <li id="pad"> 
                     <i>Rent cost:</i>  <hr><?php echo $hD['currency']. $hD['cost_ifany'];?> </hr> 
				</li>
				<li id="pad"> 
                     <i>Category:</i> <hr><?php echo $hD['category'];?></hr> 
				</li>
				<li id="pad"> 
                     <i>Contract:</i> <hr><?php echo $hD['cduration'];?></hr> 
				</li>

				<li id="pad"> 
                     <i>Country:</i><hr> <?php echo $hD['country'];?></hr>
				</li>


				<li id="pad"> 
                     <i>Region:</i><hr> <?php echo $hD['region'];?> </hr>
				</li>


				<li id="pad"> 
                     <i>District:</i> <hr><?php echo $hD['district'];?> </hr>
				</li>
                <li id="pad"> 
                     <i>Ward:</i><hr> <?php echo $hD['ward'];?></hr> 
				</li>
				<li id="pad"> 
                     <i>Street:</i> <hr><?php echo $hD['street'];?></hr> 
				</li>
				<li id="pad"> 
                     <i>Distance from main road:</i> <hr><?php echo $hD['distance_m_r'];?></hr> 
				</li>
				<li id="pad"> 
                     <i>Popular nearest mark:</i> <hr><?php echo $hD['popularmark'];?> </hr>
				</li>
			</ul>
			<b>Finishing description</b><P/>

           <?php echo  $hD['finishdisc'];?>
         <b><p/>Contract term and Condition</b><P/>

           <?php echo  $hD['term_condition'];?><p/>
       
         <b>Contact</b><P/>
          <ul>
         	    <li id="pad"> 
                     <i>Phone no:</i> <hr><?php echo $hD['phone_no'];?> </hr>
				</li>
				 <li id="pad"> 
                     <i>Email:</i> <hr><?php echo $hD['email'];?> </hr>
				</li>
             </ul>
     
		 
	     <p/><b>ROOM AVAILABLE</b><p/>
		<?php
		//$profile=$itm['profileimages'];
	    $rD=$hcon->getHousesRoom($house_no);
        if ($rD->rowCount()>0)
         {
   	        $rRD=$rD->fetchAll();
			?>
			
			<?php
        foreach ($rRD as $key =>$Dr)
         {
	 

	     ?>
	     <ul style="padding-top:0% padding-left:0%;">
				<li style="padding-top:2%; text-align:top; padding-left:2%;">
				 <?php echo "Room id:<hr>".$Dr['roomid']."</hr>"; ?></li>
				 <li style="padding-top:2%; text-align:top; padding-left:2%;">
				 <?php echo "Category:<hr>". $Dr['category']."</hr>"; ?></li>

				 <li style="padding-top:2%; text-align:top; padding-left:2%;">
				 <?php echo "Monthly Cost<hr>:". $Dr['cost']."</hr>"; ?></li>
                <li style="padding-top:2%; text-align:top; padding-left:2%;">
				 <?php echo "Contract duration:<hr>". $Dr['contract_duration']."</hr>"; ?></li>
                <li style="padding-top:2%; text-align:top; padding-left:2%;">
				 <?php echo "Status:<hr>". $Dr['status']."</hr>"; ?></li>
                 
			</ul>
<p/><i>Finishing description</i><p/>
			 <?php echo $Dr['finishingdisc']; ?> 
 
 

             <!--   <form action="itemMoreDetailOwner.php" method="post">

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


                      <input class="hi" type="hidden" name="roomid"  value="<?php// echo $Dr['roomid'];?>">


                      <input class="hi" type="hidden" name="house_no"  value="<?php// echo $Dr['house_no'];?>">

 

                      <input  id="item" type="submit" value="View detail" name="post"  >

                 </form>-->
		<?php
		 }
   	    
          }
        else
          {
             ?>
             <ul>
				<li> 
				No room available!..
				</li>
			</ul>
		<?php
		 
          } 
		?>
		 
		</td>

	</tr>
<?php
 }
}
else
{
	?>
	<tr>
		<td colspan="2">
		

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

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

    
                     Not yet uploaded!.. <!-- <input  id="item" type="submit" value="Click to register" name="post">--> 

                 </form>
  	 
		 <p/>  
			
		</td>
	</tr>
	<?php
 
?>
</table>
<?php
}

require_once("getOtherHousePreviewIn.php");
 }
 else
{
 	 echo "Some thing went wrong while processi the page!..";
}

 
 require_once('../footerIns.php');
?>