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

  {

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

        $hnm=$_POST['hiD'];
        $ownID=$_POST['owniD'];  
      
         
    }

         $imgH=$con->getHotelAdvImages($hnm);
 
     }
     ?>
     
      <ul><li> <label id="main_lab">  IMAGES</label></li></ul>
     
     
           <ul >
        
              <li id="liL">
                          
                           <form action="addAdvertisementFormStaff.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 advertisement" name="post"  >

                              </form>
                </li>

                
              


       </ul> 

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

     </table>-->
    

   <center> <div id="new_hotel_img_reg_form">
    <table width="90%" >
    <?php
    if($imgH->rowCount()>0)
    {
       $mg=$imgH->fetchAll();
       foreach ($mg as $key => $gm) 
       {
          
      
       ?>
        <tr class="tr">
           <td valign="bottom" height="45px" align="left">

           <label id="main_lab"><?php echo $gm["title"];?>   </label>

              <small><i>Posted on:<?php echo $gm["timePosted"];?></i></small><br/>

              <?php echo $gm["content"];?>   

           </td>

        </tr>
        <?php
       if($gm["directory"]!="")
       {
        ?>
       <tr>
         <td align="center">

               <img id="ng" src="<?php echo $gm["directory"];?>" alt="Advertisement image was here ">
               
               
 
           </td>

           </tr>
     <?php
      }
      }
    }
    else{
      ?>
      <tr class="tr2"><td>No image uploaded!..</td></tr>
   <?php
    }
    ?>
    </table>
     </div> 
 
     </center>