<?php

require_once("header.php");
if(isset($_POST['post'])){

  $hnm=$_POST['hiD'];
    $ownID=$_POST['owniD'];
    $post=$_POST['post'];
    require_once("buda_connect.php");
    $con = new connect_class();
 

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

	
		$HD=$con->getMyOperationHotel($ownID,$hnm);
		
        if($HD->rowCount()>0)
        {
          $ro=$HD->fetch();

         }
 
?> 


      <center>

        

                   <center>
        <label id="main_lab">   <?php echo $ro["hname"];?> ROOM SERVICES</label> 

              <ul>

                     <li id="liL">
                            <form action="otherHotelAdertisementOut.php" method="post">


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

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

                              <input class="pos" type="submit" value="Advertersement" name="post"  >

                        </form>

                        </li>


                        <li id="liL">
                          <form action="otherHotelImagesOut.php" method="post">


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

                                

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

                              <input class="pos"  type="submit" value="Images" name="post"  >

                        </form>

                        </li>

                        <li id="liL">
                          
                            <form action="otherHotelRoomViewOut.php" method="post">


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

                                

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

                              <input class="pos" type="submit" value="Rooms" name="post"  >

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


 <table width="80%" id="table_border" class="rtab" ><tr><td colspan="6" align="center" ><label id="main_lab"> ROOM SERVICES</label> </td></tr>
 

 <?php
   $rM=$con->getHotelRoom($hnm);
 		if($rM->rowCount()<=0){
 			


 
								?>
<tr class="tr2">
              
               <td colspan="6"> 
								 No room detail uploaded
               </td>
</tr>

 
     

						<?php
							}

							else{
 
				?>

<tr class="tr1"><td width="10%"><label id="min_lab">ROOM NUMBER</label></td><td width="20%" ><label id="min_lab">ROOM NAME</label></td>
	 
<td   width="16%" ><label id="min_lab">COST/NIGHT</label></td>

 <td  width="20%" ><label id="min_lab">ROOM TYPE</label></td><td width="14%"><label id="min_lab">ROOM/STATUS</label></td>
<td width="20%" colspan="2" align="right" ><label id="min_lab"> </label></td>
 </tr>


				<?php			   
 		 
 		 

 		$val=$rM->fetchAll();
    
    foreach ($val as $key => $room) {
 				?>

 				<tr class="tr2" height="40px">
               <td>
                    <?php echo $room["room_no"];?>
                      

                </td>

                <td>

                     <?php echo $room["rname"];?>
                       
                </td>

                <td>

                      <?php echo $room["rcost"];?>
                      
                </td>

                <td >

                <?php echo $room["rtype"];?>
                  
                </td>

                <td>

                <?php echo $room["rstatus"];?>
                
                </td>

                <td align="right">
                   <form action="roomImageViewOut.php" method="POST">

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

                       <input type="hidden" value="<?php echo $room["room_no"];?>" name="roomNo" class="hi">

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

                       <input type="submit" class="pos" name="post" value="View images">

                   </form>

                 </td>

                 <td align="right">
                   <form action="home.php" method="POST">


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

                       <input type="hidden" value="<?php echo $room["room_no"];?>" name="roomNo" class="hi">

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

                       <input type="hidden"  value="<?php echo $ro["owner_id"];?>" name="ownID" class="hi">

                       <input type="submit" id="book" name="post" value="Book Now">

                   </form>

                 </td>

        </tr>
                 <?php
 				} 
 			}
 			?>
 		 

<tr class="tr2">

               <td colspan="6">  


<!--HERE NAVIGATIO LINK ENDS-->
                              
               </td>
</tr>

</table>  </center>
<?php
}
else{
	echo "Oops!.. you internet connect is very slow to respond!..";
}
}
else
{
echo "Oops!.. you session has expired login again..";
}
 
require_once('footer.php');
?>