<?php
 require_once("headUserAcc.php");
?>

<table width="100%">
<tr><td colspan="2"><b>RESTING HOUSES</b></td></tr>
<!--<tr>
  <td> 


                            <form action="hotel_default_entry.php" method="post">
 

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

 

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

                           </form> 
 </td>
 <td align="right">


                            <form action="afterLoginHotel.php" method="post">
 

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

 

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

                           </form> 
  
 </td>
</tr>
<tr>
  <td colspan="2" align="center">
    
      <form action="hotel_default_entry.php" method="post">

            <label id="search_lab">
                       <i>
                          Search hotel here:-
                      </i> 
             </label>
                      <input type="text" class="hotel_info" height="25px" name="searchValue">

                       <input class="hi" type="text" name="owniD"  value="<?php //.echo $ownID;?>">
                      <input class="subs" type="submit" value="Search" name="search"><br>
                      <i>You can search by name,location(eg: country, region/city,district/town,ward and street) and polular mark.</i>
            
      </form>
  </td>
</tr>-->
</table>
<?php
  /*
     if(isset($_POST['search']))
       {

        $searchValue=$_POST['searchValue'];
        if ($searchValue!="") {
           
        require("hotel_summary_seach.php");
         }////////////////////EMPTY POST 
         else{
          ?>
          <p><label id="min_lab">
           Searching empty results!.. 
           </label>
           <?php

         }
       }
       else{
        /////////////NONE POST

           require("my_Only_Hotel_in_detail.php");
            require("hotel_summary_NO_seach.php");
       }
 
*/


?>

<?php
if(isset($_POST['post'])){
  //if(isset($_POST['owniD'])){

        //$ownID=$_POST['owniD'];
      //  $con = new connect_class();
        $HD=$con->getHotel();
    
        if($HD->rowCount()>0){
          $ro=$HD->fetchAll();
         
?>
<center>

<table   class ="roomtab">
    
       <!--<tr class="tr1">
     <td valign="top" colspan="2"><label id="main_lab">MY HOTEL</label>

     </td>
     </tr>-->

   
      
     <tr>
      
    <td>
    <center>

    <table border="0" class ="roomtab">

               <tr><td colspan="9" ><!--<label id="main_lab">SUMMARY OF HOTEL LOCATION</label>--></td>

               <td align="right" colspan="3">
       
                            <form action="restingHouseRegFormPro.php" method="post">
 

                               <!--<input class="hi" type="hidden" name="owniD"  value="<?php //echo   $row["owner_id"]; ?>">-->


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

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

                           </form>
                        
               </td>

               </tr>             

                <tr class="tr1">
                <td id="td_height" ><label id="inner_top">NAME</label></td> <td id="td_height" ><label id="inner_top">OWNER</label></td>

                  <td id="td_height" ><label id="inner_top">COUNTRY</label></td><td><label id="inner_top">CITY/REGION</label></td>

                <td id="td_height" ><label id="inner_top">TOWN/DISTRICT</label></td><td><label id="inner_top">STREET</label></td>
 
                <td id="td_height" ><label id="inner_top">PHONE NUMBER</label></td><td><label id="inner_top">EMAIL ADDRESS</label></td><td><label id="inner_top">REGISTERED ON</label></td><td><label id="inner_top">POSTAL ADDRESS</label></td><td><label id="inner_top">POPULAR MARK</label></td>

                </tr>

        <?php foreach ($ro as $key => $row) {
          $current="current";
          $hnm=$row['hotel_id'];
          $ownID=$row['owner_id'];
          $WN=$con->getMyProfile($ownID)->fetch();
          /*$HP=$con->getHotelProfileImages($hnm);
          if($HP->rowCount()>0)
            {
            $hmgp=$HP->fetch();
            $hProfile=$hmgp['directory'];
            }
          else
            {
            $hProfile='hotel_images/defaultHotelimg.png';
            }
*/


        ?>


       <tr class="tr2">
          <td   align="left" valign="top">  

              
                 <form action="../hotelServiceInfoIn.php" method="post">

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


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

                    <input  class="pos" type="submit" value="<?php echo $row["hname"];?>" name="post"  >

                 </form>

                 
              </td>
              <td id="td_height" ><label id="inner_lab"> <?php echo $WN["fname"]." ".$WN["mname"]." ".$WN["lname"];?> </label></td>

                <td id="td_height" ><label id="inner_lab"> <?php echo $row["country"];?> </label></td><td><label id="inner_lab"><?php echo $row["city"];?> </label></td>

               <td id="td_height" ><label id="inner_lab"><?php echo $row["ltown_city"];?> </label></td><td><label id="inner_lab"><?php echo $row["lstreet_vil"];?> </label></td>

               <td id="td_height" ><label id="inner_lab"><?php echo $row["phoneno"];?> </label></td><td><label id="inner_lab"><?php echo $row["email"];?> </label></td><td><label id="inner_lab"><?php echo $row["reg_date"];?> </label></td><td><label id="inner_lab"><?php echo $row["paddress"];?> </label></td><td><label id="inner_lab"><?php echo $row["popularDistination"];?> </label></td>




               </tr>    
      

    

  </tr>

  <tr>
    
    <td align="justify" colspan="12">
    <label id="main_lab">SHORT DESCRIPTION ABOUT <?php echo $row["hname"];?> </label><p/>
     <label id="inner_lab"><?php
     if ($row["description"]!="") {
       echo $row["description"];
      }
      else{
        echo "No description post!.";
      }
       ?>
       </label>
   </td>

</tr>
<!--  <tr>

   <td >

     <table width="100%">

        <tr>
             <td valign="top" >
             <!--CODE FOR RETRIEVING HOTEL ASSOCIATES SERVICES GOES HERE-- 
              <?php
               //$hnm=$row["hotel_id"];

                //require("hotelAssServices.php");

              ?> 

             </td>
               
             <td valign="top">

   
             <?php
              
             // $hD['hname']=$row["hname"];                                               // <!--CODE FOR RETRIEVING ROUTE TO HOTEL GOES HERE-->
 
             //require("routeTohotel.php");

              ?> 
             </td>
        </tr>


     </table>                                            

  </td>

    
</tr>


 <tr class="tr1">

           <td>

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

                               <input class="hi" type="text" name="ownID"  value="<?php// echo $row["owner_id"];?>">


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

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

                        </form>

                        </li>

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

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

                               <input class="hi" type="text" name="ownID"  value="<?php// echo $row["owner_id"];?>">


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

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

                        </form>
                        </li>

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


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

                               <input class="hi" type="text" name="ownID"  value="<?php //echo $row["owner_id"];?>">


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

                              <input class="pot" type="submit" value="Services" name="post"  >

                        </form>
                        </li>


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

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

                               <input class="hi" type="text" name="ownID"  value="<?php// echo $row["owner_id"];?>">


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

                              <input class="pot" type="submit" value="Routes" name="post"  >

                        </form>

                        </li>


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


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

                               <input class="hi" type="text" name="ownID"  value="<?php// echo $row["owner_id"];?>">


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

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

                        </form>

                        </li>


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

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

                               <input class="hi" type="text" name="ownID"  value="<?php// echo $row["owner_id"];?>">


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

                              <input class="pot" type="submit" value="Workers" name="post"  >

                        </form>
                        </li>

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

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

                               <input class="hi" type="text" name="ownID"  value="<?php //echo $row["owner_id"];?>">


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

                              <input class="pot" type="submit" value="Visitors" name="post">

                        </form>
                        </li>


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

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

                               <input class="hi" type="text" name="ownID"  value="<?php //echo $row["owner_id"];?>">


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

                              <input class="pot" type="submit" value="Income Report" name="post"  >

                        </form>
                        </li>



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


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

                               <input class="hi" type="text" name="ownID"  value="<?php //echo $row["owner_id"];?>">


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

                              <input class="pot" type="submit" value="Expense Report" name="post"  >

                        </form>
                        </li>
                  </ul>
           </td>

        </tr>-->
<?php
}
?>
</table></center>
 <?php   

}else{
  ?>
  <center>
     <table class ="roomtab">
    
           <!---- <tr class="tr1">
                 <td colspan="2"><label id="main_lab">MY HOTEL</label></td>
          </tr>-->


          <tr class="tr2">
            <td colspan="2"><label id="min_lab">Currently you don't have registered hotel. Register here:-
                            <form action="restingHouseRegFormPro.php" method="post">
 

                               <!--<input class="hi" type="hidden" name="owniD"  value="<?php //echo   $row["owner_id"]; ?>">-->


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

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

                           </form></label></td>
          </tr>

     </table>
  </center>

     <?php

 }
}
 
