 <?php 
   require_once("head2Alt.php");
   if(isset($_POST['post']))

  {

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

        $hnm=$_POST['hiD'];
        $ownID=$_POST['owniD'];
        $roomid=$_POST['roomNo'];
         //require_once("buda_connect.php");
         //$con = new connect_class();
         $HD=$con->getThisHotel($hnm);
    
        if($HD->rowCount()>0)
        {
          $ro=$HD->fetch();
        }
      
    }

         //$imgH=$con->getHotelImages($hnm);

         $imgR=$con->getGivenRoomImagesView($hnm,$roomid);
     }
     ?>
 
      <section id="bookedroomviaimg">
       <!-- <form action="hotelPaymentPage.php" method="POST">-->
      <form action="roomImageView.php" method="POST">

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

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

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

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

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

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

 
                  
        </li></ul>
        <ul>

                     <li id="liL">
                            <form action="otherHotelAdertisement.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="otherHotelImages.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="otherHotelRoomView.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>
       

                   <!--/////////////////////////ROOMIMAGES///////////
                      ////////////////////
                   ///////-->


        
     

      <ul><li> <label id="main_lab"><?php echo $ro["hname"];?> ROOM NO <?php echo $roomid;?> IMAGES</label></li></ul>
    <table id="h_adv" border="0">
      <?php
      $post=$_POST['post'];
      if ($post=="Book Now") {
?>
<tr>
  <td >
    <section style="background-color:blue; height:60px; border-radius:12px;  padding-top:45px;">
       <label style="font-size:20px; font-weight:bold; color:white;margin-left:30px;">Please contact customer care desk through telephone number: <?php echo $ro['phoneno'];?> for booking instruction!..</label>

    </section>
   
  </td>
</tr>

<?php
         }
        ?>
       <tr><td><ul>
                
    <?php
    if($imgR->rowCount()>0)
    {
       $mgR=$imgR->fetchAll();
       foreach ($mgR as $key => $gmR) 
       {
          
      
       ?>
        <li id="liMg"> <label id="main_lab"><?php echo $gmR["imgname"];?>   </label><p/>  
        <img style="height:200px;" id="ng" src="<?php echo $gmR["directory"];?>" alt="<?php echo $gmR["imgname"]." was here";?>"> </li>
    <?php
       }
    }
    else{
      ?>
      <li>No image room no <?php echo $roomid;?> uploaded!..</li>
   <?php
    }
    ?>
  </td></tr>
  </table>
      <?php
require_once('footerIn.php');
?>



      