<?php

    require_once("head2Alt.php"); 
	 
?> 
 <center>
  <label id="succ">
    <?php  
    
    echo $con->editRoom($rname,$rtype,$rcost, $roomid, $hnm);

    //HOTEL NAVIGATION LINKS-->
     require_once("my_hotel_main_nav_link.php");
    //-MAIN NAVIGATION LINK END-->
     ?>
 </label>
</center> 
 <center><table   id="table_border" class ="roomtab" ><tr><td colspan="6" align="left" ><label id="main_lab">   <?php echo $ro["hname"];?> 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>

<tr class="tr2">

               <td colspan="6"> 
<!--THERE GOES NAVIGATION LINK-->

                  <center> <ul>
                        <li id="liL">
                          <form action="hotelImageUloadForm.php" method="post">

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


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

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

                        </form>

                        </li>

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

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


                              <input class="hi" type="text" name="hiD"  value="<?php echo $ro["hotel_id"];?>">

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

                        </form>
                        </li>

                         
                  </ul>
                 </center>

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

						<?php
							}

							else{
 
				?>

<tr class="tr2">

               <td colspan="6"> 

<!--THERE GOES NAVIGATION LINK-->
<center> <ul>
                        <li id="liL">
                          <form action="roomImageUploadForm.php" method="post">

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


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

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

                        </form>

                        </li>

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

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


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

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

                        </form>
                        </li>

                         
                  </ul>
                 </center>

<!--HERE NAVIGATIO LINK ENDS-->
</td></tr>
                      
<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%" ><label id="min_lab">BEST SERVICES</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>
                   <form action="editRoom.php" method="POST">
                   <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

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

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

                       

                       <input type="submit" id="edit" name="post" value="Edit">

                   </form>

                 </td>

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

                       <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 class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">


                       <input type="submit" id="edit" name="post" value="Delete">

                   </form>

                 </td>

        </tr>
                 <?php
 				} 
 			}
 			?>
 		 

<tr class="tr2">

             <!--  <td colspan="6"> 
        
               </td>-->
</tr>

</table></center>
<?php
//}
//else{
	 
//else
//{
//echo "Oops!.. you session has expired login again..";
//}
 
require_once('footerIn.php');
?>
