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

  {

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

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

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

         $imgR=$con->getRoomImages($hnm);
     }

     //HOTEL NAVIGATION LINKS-->
         require_once("my_hotel_main_nav_link.php");
      //-MAIN NAVIGATION LINK END-->
     ?>


     
      <ul><li> <label id="main_lab"> IMAGES</label></li></ul>
     
    <!-- <table>
       <tr>
         <td>-->
           <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 $hnm;?>">

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

                              </form>
                </li>

                
                <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 $hnm;?>">

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

                          </form>
                </li>

                <li id="liL">
                            <form action="hotelProfilePictureSet.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="Set hotel profile picture" name="post"  >

                          </form>
                </li>

       </ul> 

        <!-- </td>
       </tr>

     </table>-->
    
 <center>
    <div id="new_hotel_img_reg_form">
    <table width="100%" >
    <?php
    if($imgH->rowCount()>0)
    {
       $mg=$imgH->fetchAll();
       foreach ($mg as $key => $gm) 
       {
          
      
       ?>
        <tr class="tr"><td valign="bottom" height="45px" align="center"><label id="main_lab"><?php echo $gm["imgname"];?>   </label> </td></tr>
        <tr><td align="center"><img id="ng" src="<?php echo $gm["directory"];?>" alt="<?php echo $gm["imgname"]." was here";?>"></td></tr>
    <?php
       }
    }
    else{
      ?>
      <tr class="tr2"><td>No image uploaded!..</td></tr>
   <?php
    }
    ?>
    </table>
     </div> 




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


    <div id="new_hotel_img_reg_form">


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

    <table width="100%" >
    <?php
    if($imgR->rowCount()>0)
    {
       $mgR=$imgR->fetchAll();
       foreach ($mgR as $key => $gmR) 
       {
          
      
       ?>
        <tr class="tr"><td valign="bottom" height="45px" align="center"><label id="main_lab"><?php echo $gmR["imgname"];?>   </label> </td></tr>
        <tr><td align="center"><img id="ng" src="<?php echo $gmR["directory"];?>" alt="<?php echo $gmR["imgname"]." was here";?>"></td></tr>
    <?php
       }
    }
    else{
      ?>
      <tr class="tr2"><td>No image uploaded!..</td></tr>
   <?php
    }
    ?>
    </table>
     </div>


     </center>
     <?php
require_once('footerIn.php');
?>
