
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>Housekeeping  <small>Schedule</small></h3>
              </div>

              <div class="title_right">
                <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                  <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search for...">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button">Go!</button>
                    </span>
                  </div>
                </div>
              </div>
            </div>

            <div class="clearfix"></div>

            <div class="row">

              <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>SOLSTICE SERVICE APARTMENT <small>Try hovering over the rows</small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                        <ul class="dropdown-menu" role="menu">
                          <li><a href="#">Settings 1</a>
                          </li>
                          <li><a href="#">Settings 2</a>
                          </li>
                        </ul>
                      </li>
                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
					  <a href="?pagecontent=housekeep_cleaning_update"><button class="btn btn-default">PROCESS CHECK</button></a>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <table class="table table-hover">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>Room No</th>
                          <th>Action</th>
                        </tr>
                      </thead>
                      <tbody>
						  <?php
						  	$currentDate = date('Y-m-d');
						  	$getDate = $_GET['get_date'] ? $_GET['get_date'] : $currentDate;
						  
						  	$result = mysqli_query($conn, "SELECT
							r.r_no AS room_no
							FROM housekeep AS hk 
							LEFT JOIN room AS r
							ON hk.r_id=r.r_id
							WHERE hk.hk_date='$date'");
						  
						  	while($row = mysqli_fetch_assoc($result)){ ?>
                        <tr>
                          <th scope="row"><?php echo ++$no; ?></th>
                          <td><?php echo $room_no = $row['room_no']; ?></td>
                          <td>
							  <?php
								
								$room_id = $row['r_id'];
											
								$admin_id = $_SESSION['admin'][0];
																	  	
								$resultIsRequested = mysqli_query($conn, "SELECT * FROM housekeep_admin WHERE a_id='$admin_id' AND ha_date='$getDate'");
								$rowNumIsRequested = mysqli_num_rows($resultIsRequested);
																	  
								if($rowNumIsRequested >= 1){
																	  ?>
							  <a href="?pagecontent=housekeep_room_list&housekeep_unrequest=<?php echo $row['r_id']; ?>&get_date=<?php echo $getDate; ?>"><button class="btn btn-danger btn-xs">WITHDRAW</button></a>
							  <?php }else{ ?>
							  
							  <a href="?pagecontent=housekeep_room_list&housekeep_request=<?php echo $row['r_id']; ?>&get_date=<?php echo $getDate; ?>"><button class="btn btn-primary btn-xs">HANDLE</button></a></td>
							<?php } ?>
                        </tr>
						  <?php } 
						  
						  if(isset($_REQUEST['housekeep_request'])){
							  $room_id = $_REQUEST['housekeep_request'];
							  
							  $admin_id = $_SESSION['admin'][0];
							  
							  mysqli_query($conn, "INSERT INTO housekeep (r_id, hk_date, a_id) VALUES ($room_id, '$getDate', $admin_id)");
							  
							  header("Location: ?pagecontent=housekeep_room_list&get_date=".$getDate);
						  } 
						  
						  if(isset($_REQUEST['housekeep_unrequest'])){
							  $room_id = $_REQUEST['housekeep_unrequest'];
							  
							  mysqli_query($conn, "DELETE FROM housekeep WHERE r_id=$room_id AND hk_date='$getDate'");
							  
							  header("Location: ?pagecontent=housekeep_room_list&get_date=".$getDate);
						  }
						  
						  ?>
                      </tbody>
                    </table>

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
