


	 <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		   
		   		   <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>

				   <style>
.grid-container {
  display: grid;
  grid-template-columns: auto auto auto ;
  background-color:gray;
  padding: 10px;
 
}
.grid-item {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.8);
  padding:5px;
  font-size: 30px;
  text-align: center;
}
</style>
	
        <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
        </script>
           <script type="text/javascript">
  
  
		 $(document).on("click", "#managebtncheckout", function()
        {
          var roomidentifier = $(this).data('id');
		  $("#roomidentifier").val(roomidentifier); 
		  
		    var houseno2 = $(this).data('houseno');
		  $("#houseno2").val(houseno2); 
		     var plotno2 = $(this).data('plotno');
		  $("#plotno2").val(plotno2); 
		   
        });
		
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#roomid").val(itemid); 
		  
		  
		   
		   
        });
		
		
    function selectAllCheckBoxes(obj){
        $('input:checkbox:not(:disabled).checkBoxInLoop').prop('checked', jQuery(obj).prop('checked'));
    }

    function unselectCheckBoxUnik(){

        /*first you verify if the quantity of checkboxes equals number of checkboxes*/
        a = $('input:checkbox:not(:disabled).checkBoxInLoop:checked').size();
        b = $('input:checkbox:not(:disabled).checkBoxInLoop').size();

        /*if equals, mark a checkBoxUnik*/
        ((a == b)? $('#checkBoxUnik').prop("checked", true) : $('#checkBoxUnik').prop("checked", false));
    }

		
    </script>     

      




<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#add" data-toggle="tab"><i class="entypo-menu"></i> 
			View House Details
                    	</a></li>
						
							<li>
            	<a href="#list" data-toggle="tab"><i class="entypo-plus-circled"></i>
			
				 <a href="<?php echo base_url(); ?>admin/searchhouse">	Go back</a>
                    	</a></li>
			
							<li>
        <a data-toggle='modal' data-target='#Checkout' class="btn btn-warning">Bulk check out</a>

                    	</li>
						<li>
						<!--
            				 <a class="btn btn-success"href="<?php echo base_url(); ?>admin/viewprndingmoneyreceived">	Pending MPESA</a>
-->
                    	</li>
		</ul>
    	<!------CONTROL TABS END------>
        
		
		<?php
					echo $this->session->flashdata('deletemsg'); 
		   $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	      $viewhouse=$this->usermodel->populatuserpermissionsdataarray('accomodation','viewhouse',$userid);
	      $viewroomcleaned=$this->usermodel->populatuserpermissionsdataarray('accomodation','viewroomcleaned',$userid);

	      $checkin=$this->usermodel->populatuserpermissionsdataarray('accomodation','checkin',$userid);

	      $config=$this->usermodel->populatuserpermissionsdataarray('accomodation','config',$userid);

	      $postexpense=$this->usermodel->populatuserpermissionsdataarray('accomodation','postexpense',$userid);


	      $bankdeposits=$this->usermodel->populatuserpermissionsdataarray('accomodation','bankdeposits',$userid);


	      $housekeeping=$this->usermodel->populatuserpermissionsdataarray('accomodation','housekeeping',$userid);


	      $dailysales=$this->usermodel->populatuserpermissionsdataarray('accomodation','dailysales',$userid);


	      $customerregister=$this->usermodel->populatuserpermissionsdataarray('accomodation','customerregister',$userid);


	      $managehotel=$this->usermodel->populatuserpermissionsdataarray('accomodation','managehotel',$userid);


	      $assignrooms=$this->usermodel->populatuserpermissionsdataarray('accomodation','assignrooms',$userid);


	      $dailypayments=$this->usermodel->populatuserpermissionsdataarray('accomodation','dailypayments',$userid);


	      $dailycollections=$this->usermodel->populatuserpermissionsdataarray('accomodation','dailycollections',$userid);


	      $advancebooking=$this->usermodel->populatuserpermissionsdataarray('accomodation','advancebooking',$userid);


	      $managecustomer=$this->usermodel->populatuserpermissionsdataarray('accomodation','managecustomer',$userid);



	      $viewreports=$this->usermodel->populatuserpermissionsdataarray('accomodation','viewreports',$userid);


			?>
            <!----TABLE LISTING STARTS-->
          	<div class="row">

				
     	<div class="col-md-2">
				<div id="sidebar" class="hidden-print minibar ">
			
			<ul>
						
			
<?php
if( $checkin==true){
 ?>
	 <li> <a id="non-printable"  class="btn btn-default" href="<?php echo base_url(); ?>admin/viewpallmyplots">All Rooms (Buttons)</a></li>

<?php	
}
 ?>
 <?php
if( $postexpense==true){
 ?>
				<li> <a id="non-printable"   class="btn btn-default" href="<?php echo base_url(); ?>user/viewexpenses"> Post expenses</a></li>

<?php	
}
 ?>
 <?php
if( $bankdeposits==true){
 ?>
				<li>   <a id="non-printable"  class="btn btn-default" href="<?php echo base_url(); ?>user/viewbanks">Make Deposits</a> </li>

<?php	
}
 ?>
 <?php
if( $housekeeping==true){
 ?>
		 		<li> <a id="non-printable"   class="btn btn-default" href="<?php echo base_url(); ?>admin/viewpallmyroomstoclean"> House Keeping</a></li>

<?php	
}
 ?>
 	
<?php
if( $viewroomcleaned==true){
 ?>
		 		<li> <a id="non-printable"   class="btn btn-default" href="<?php echo base_url(); ?>admin/viewhousekeeping"> Cleaning History</a></li>

<?php	
}
 ?>
 
 

<?php
if( $dailysales==true){
 ?>
<li> <a id="non-printable"  class="btn btn-default"   href="<?php echo base_url(); ?>admin/salesreceipts"> Sales Receipts </a></li>

				<li> <a id="non-printable"  class="btn btn-default"   href="<?php echo base_url(); ?>admin/dailypayment"> Daily Payment </a></li>

<?php	
}
 ?>
 <?php
if( $customerregister==true){
 ?>
		<li> <a id="non-printable"  class="btn btn-default"   href="<?php echo base_url(); ?>admin/customerregister"> Customer Register</a></li>

<?php	
}
 ?>
 <?php
if( $managehotel==true){
 ?>
      		    <li> <a id="non-printable"  class="btn btn-default"   href="<?php echo base_url(); ?>admin/viewallplots"> Manage  Hotel </a></li>

<?php	
}
 ?>
 
 
 												 	<?php

	
 if( $viewhouse==true){
	 ?>



	 	<?php	

 }
  ?>
												  

		
 
 
 
 
 <?php
if( $dailypayments==true){
 ?>

<?php	
}
 ?>




 <?php
if( $dailycollections==true){
 ?>
				<li>   <a id="non-printable"  class="btn btn-default" href="<?php echo base_url(); ?>user/viewmydailycollections">Daily Collections</a> </li>

<?php	
}
 ?>
 <?php
if( $advancebooking==true){
 ?>
				<li> <a id="non-printable"  class="btn btn-default"  href="<?php echo base_url(); ?>admin/viewalladvance">Advance Bookings </a></li>  

<?php	
}
 ?>

<?php
if( $managecustomer==true){
 ?>
				 <li> <a id="non-printable"  class="btn btn-default"  href="<?php echo base_url(); ?>admin/viewalltenant">Manage Customer </a></li>  

<?php	
}
 ?>
	
<?php
if( $viewreports==true){
 ?>

     <li> <a id="non-printable"  class="btn btn-default"  href="<?php echo base_url(); ?>admin/searchbalance">Search Bookings  </a></li> 
              <li> <a id="non-printable"  class="btn btn-default"  href="<?php echo base_url(); ?>admin/searchhouse">General Search </a></li>

<?php	
}
 ?>
	
<?php
if( $config==true){
 ?>
        		    <li> <a id="non-printable"  class="btn btn-default"   href="<?php echo base_url(); ?>admin/viewallplots"> Manage  Hotel </a></li>

   				<li> <a id="non-printable"   class="btn btn-default" href="<?php echo base_url(); ?>admin/viewallpaymentcharge"> payments  Charges</a></li>
<li> <a id="non-printable"  class="btn btn-default"  href="<?php echo base_url(); ?>admin/searchhouse">General Search </a></li>

<?php	
}
 ?>
	

					
			</ul>
		</div>
	</div>		
			<div class="col-md-10">


   

<?php
 $grandtotal=0;
echo $this->session->flashdata('msg'); 
 if(is_array($house)) 

 {

?>
 <div class="grid-container">


   <?php

	  $allplotno;
  	foreach ($house as $c): 

		 

             ?>



       
               
            <?php 
		 $houseno=$c->houseno;
	 $plotno=$c->plotno;
 $houseid=$c->id;
 
 $booking  = $this->usermodel->populatealldatanorraythree('bookroom','plotno', $plotno,'houseno', $houseno,'status','active');



	  $roomidentifier=$booking[0]['id'];
						 
   
						   

						$checkstatus=$booking[0]["paymentstatus"];
								$creditpaid=$booking[0]["credit"];

?>

 
           
			

  <div class="grid-item">
  <?php
					
			$mystatus=$c->status ;
			if($mystatus=="vacant"){
			
			?>
			                <a class="btn btn-success" id="more" href="<?php echo base_url();?>admin/allocate?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $houseid;}  ?>"><div style="padding:10px;font-size: 30px;">    <?php  echo$c->houseno ; ?> </div>Check-in </a>

			<?php
			}else if($mystatus=="occupied"){
				?>
			 <a class="btn btn-danger managebtn" id="managebtncheckout"	data-plotno='<?php echo  $c->plotno;?>' data-houseno='<?php echo  $c->houseno;?>' 	 data-id='<?php echo  $c->id;?>'     data-toggle='modal' data-target='#myCheckout2<?php  $c->id; ?>'>             <div style="padding:10px;font-size: 30px;">       <?php  echo$c->houseno ; ?> </div>Check-out
						</a>
	 
			
			<?php
			
			}else if($mystatus=="freezed"){
			?>
				 <a class="btn btn-danger managebtn" id="managebtncheckout"	data-plotno='<?php echo  $c->plotno;?>' data-houseno='<?php echo  $c->houseno;?>' 	 data-id='<?php echo  $c->id;?>'     data-toggle='modal' data-target='#myCheckout2<?php  $c->id; ?>'>             <div style="padding:10px;font-size: 30px;">        <?php  echo$c->houseno ; ?>  </div>Check-out
						</a>
	 

			<?php
			}
			
		
			?>
			
  
</div>
			 
			
			  
			 
				<?php  $c->plotno ;

$allplotno=$c->plotno;				?>
				

             
			  
			  
			  
			  
			  
			  
			  
		

	

             <?php endforeach; ?>
</div>
              <?php }?>
			 
			 

</div>
</div>





 <div id="myCheckout" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Check Out</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to Check out this customer? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('admin/myupdatechekout' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>  								  		

 <input type="hidden" id="table"name="table" class="table" placeholder="bookroom" value="bookroom">
 <input type="hidden" id="view2"name="view2" class="view2" placeholder="view2" value="">
 <input type="hidden" id="roomidentifier" name="roomidentifier" class="roomidentifier" placeholder="roomidentifier" value="">

 
 	<select class="form-control" name="status" required>
	<option  value=""  >--Select status-</option>
   <option value="vacant" >Vacant</option>
									  
 <option value="freezed"  selected="selected">Freezed</option>
																 									   <option value="Pending">Pending</option>



	
</select>
 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewpallmyplots">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
           <input type="hidden" id="houseno2"name="houseno" class="form-control" placeholder="houseno"  value="">

          <input type="hidden" id="plotno2"name="plotno" class="form-control" placeholder="plotno"  value="">
 		   		  	         <button type="submit" name="updatecheckout" value="checkout" class="btn btn-success"> Yes  </button>

 <button type="button" class="btn btn-danger" data-dismiss="modal">No</button>


	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>
		
		







  <div id="Checkout" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Check Out</h4>
      </div>
      <div class="modal-body">
        <h4>Are you sure you want to Check out all customers whoes check out time is below this date and time? </h4>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('msg'); 
    $closedatedate=date("Y-m-d 10:01:01");

		
                 echo form_open('admin/updatebulkchekout' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>  								  		

 <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Check-Out  Time</label>
    <div class="col-sm-7">
				<input type="text" name="checkoutdate" value="<?php echo set_value('checkoutdate',$closedatedate); ?>" id="idno" class="form-control" required placeholder="Enter End  Date">
        <span class="text-danger"><?php echo form_error('checkoutdate'); ?></span>
	</div>
  </div>
 <input type="hidden" id="table"name="table" class="table" placeholder="bookroom" value="bookroom">

 
 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewpallmyplots">

 		   		  	         <button type="submit" name="bulkcheckout" value="checkout" class="btn btn-success"> Yes  </button>

 <button type="button" class="btn btn-danger" data-dismiss="modal">No</button>


	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>






<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="house">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewpallmyplots">
 <input type="hidden" id="roomid"name="itemid" class="itemid" placeholder="itemid" value=""><br>
          <input type="hidden" id="plotno1"name="plotno" class="form-control" placeholder="plotno"  value="">
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>

</div>
		<!----CREATION FORM STARTS---->
	
</div>




			