

				   	 <script type="text/javascript">
        
        
            $(document).ready(function() { 

                
                $("#plotno").change(function(){
                 	var plotnoid = $("#plotno").val();
                     /*dropdown post *///
                      $.ajax({
			 		url:"<?php echo base_url();?>admin/populatehouseid",
			 		
					 data: {plotno: $(this).val()},

                    type: "POST",
                    success:function(data){
                        
                        $("#houseid").html(data);
                    }
                
                    });

               
                });

            });
               $(function () {
        $("#plotno").change(function () {
            if ($(this).val() == "") {
                $("#house").hide();
            } 
            else {
                $("#house").show();
            }
        });
    });
          
        </script>
	
        <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
        </script>
                  

	 <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 auto auto auto auto;
  background-color:gray;
  padding: 2px;
     margin:1px;

}
.grid-item {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.8);
  padding:1px;
    margin:1px;

  font-size: 20px;
  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>     

      	<?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'];	
	 
	 
	  $data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];	
	 				   $checkoutroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','checkoutroom',$userid);
	 				   $bulkreservation=$this->usermodel->populatuserpermissionsdataarray('accomodation','bulkreservation',$userid);
	 				   $bulkcheckin =$this->usermodel->populatuserpermissionsdataarray('accomodation','bulkcheckin ',$userid);

	 ?>




<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/viewpallmyplots">	Go back</a>
                    	</a></li>
			
							<li>
							
								<?php
					if( $checkoutroom==true){
						?>
        <a data-toggle='modal' data-target='#Checkout' class="btn btn-warning">Bulk Check Out</a>


						
					<?php	
					}
					
					?>


                    	</li>
									<?php
					if( $bulkcheckin ==true){
						?>
						<li>
            				 <a class="btn btn-info"href="<?php echo base_url(); ?>admin/bukallocate">	Bulk Check-In</a>
            				</li>
							<?php	
					}
					
					?>
										<?php
					if( $bulkreservation==true){
						?>
							
							<li>
							<a class="btn btn-primary"href="<?php echo base_url(); ?>admin/bukreservation">	 Reservations</a>
</li>
<?php	
					}
					
					?>
					
					
					
					
					
											<?php
					//if( $checkoutroom==true){
						?>
        <a data-toggle='modal' data-target='#ServiceSales' class="btn btn-warning">Post Services ONLY</a>


						
					<?php	
				//	}
					
					?>
						            				 <a class="btn btn-success"href="<?php echo base_url(); ?>user/allquatation">	Create Quotation</a>
<!--
            				 <a class="btn btn-success"href="<?php echo base_url(); ?>admin/viewprndingmoneyreceived">	Create Quotation</a>
-->
                    	
		</ul>
    	<!------CONTROL TABS END------>
        
		
		<?php
				
	      $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);


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

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


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

				
     	<div class="col-md-2">
	<?php
				$this->load->view('template/accommodationmenu');
			
			?>
	</div>		
			<div class="col-md-10">
	





				<?PHP

 $transactionid = 'rand' .rand(100, 9900) . 'trc' . time();
				$date= Date('Y-m-d');
		echo $this->session->flashdata('msg'); 

                 echo form_open('admin/searmychallhouse' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
							<input type="hidden" name="page" value="pmsdata/searchallhousebutton" id="page" class="form-control" required placeholder="Enter End  Date">
		

   <div class="form-group" style="margin:0px; padding:0px">
 	
   </div>
						<label for="field-2" class="col-md-1 control-label"> Name</label>
		                    <div class="col-md-2">
		                        <select name="plotno" class="chzn-select" id="plotno"  required style="margin:0px; padding:0px; width:200px">
		                            <option selected value="">--Select --</option>
									   <?php
									   
									   
									   //
		  	$plot =$this->usermodel->populateall('plot','branchid',$branchid);


if(is_array($plot)) {

   foreach($plot as $plotrow){

    ?>
	    <option  value="<?php echo set_value('plotno',$plotrow->id); ?> "><?=$plotrow->name;?></option>

   
    <?php

}} else {
    echo 'There is no plot in the system.... Please add plot first.';
}

?>
			                        
			                    </select>
			                </div>

	
		
	   <div style="margin:0px; padding:0px">
						<label for="field-2" class="col-md-2 control-label"> No</label>
		                    <div class="col-md-2" id="house" style="display: none" >
		                        <select name="houseno" class="form-control"  id="houseid"   >
		                            <option selected value="none" >--All --</option>
									  
			                        
			                    </select>
								
								     <span class="text-danger"><?php echo form_error('houseno'); ?></span>
			                </div>
	</div>
	

	
   <div>
						<label for="status" class="col-md-1 control-label">Status</label>
		                    <div class="col-md-2" id="status">
		                        <select name="status" class="form-control"   >
		                            <option selected value="none" >-None-</option>
									   <option  value="all" >-All-</option>
														   <option  value="vacant" >-Vacant -</option>
									   <option  value="occupied" >-Allocated-</option>

									   	<option  value="MangePlot" >-Manage/View -</option>
										<option  value="bulkInvoice" >-Bulk Invoice-</option>
			                        	<option  value="bulkPenalty" >-Bulk Penalty-</option>
										<option  value="bulkCopaRent" >-Bulk CopaRent-</option>
										<option  value="ActivateCharges" >- Activate Charges-</option>
										<option  value="ManageRooms" >-Manage Meters-</option>
										<option  value="UpdateRoom" >-Update Meters-</option>





			                    </select>
								
								     <span class="text-danger"><?php echo form_error('houseno'); ?></span>
			                </div>
							
							
	       <button type="submit" name="btn_tenant"value="tenant" class="btn btn-primary">Search Meters</button>
		              <a id="non-printable"  class="btn btn-default"  href="<?php echo base_url(); ?>admin/searmychallhouse">Refresh</a>

	</div>
	

    
  
  


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

   

<?php
 $grandtotal=0;
 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
				   $checkoutroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','checkoutroom',$userid);
	       $checkinroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','checkinroom',$userid);
	       $cleanrooms=$this->usermodel->populatuserpermissionsdataarray('accomodation','cleanrooms',$userid);

		$category=$c->category ;
			
			$mystatus=$c->status ;
			if($category=="rental"){
				if($mystatus=="vacant"){
			
			?>	<div class="btn-group">
			                <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;}  ?>">         <?php  echo$c->houseno ; ?> Vac </a>

                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" style="padding:7px;">
                                        More <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-info pull-right" role="menu"  >
                                        
                                        <!-- teacher EDITING LINK -->
                                      
									
										
									
                                    
                                        
										
				
		   
			    <li>
		                      <a class="btn btn-info"   id="more" href="<?php echo base_url();?>admin/rentinvoice?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>">Invoice  </a>
   </li>
		    <li class="divider"></li>
			   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/receivepayment?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&category=<?php echo $category; ?>">Pay  </a>
   </li>
		      <li class="divider"></li>
           
						   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/allocate?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $c->id;}  ?>&category=<?php echo $category; ?>">Allocations  </a>
								</li>					
										
										
							     <li class="divider"></li>			
									   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/receivepayment?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $c->id;}  ?>&category=<?php echo $category; ?>">Payment History  </a>
								</li>	
										
											
							     <li class="divider"></li>					
										
										
					
							
	   <li>

                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/editroom?randomitemidentifier=<?php   {echo  $houseid;}  ?>">Update/Charges  </a>
         </li>

							   
                                    </ul>
										
										
										    
										
                                </div>
			<?php
			}else if($mystatus=="occupied"){
				if($checkoutroom==true){
					
						?>
						
						
						<div class="btn-group">
 <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='#myCheckout<?php  $c->id; ?>'>            <?php  echo$c->houseno ; ?> Ocp
						</a>
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" style="padding:7px;">
                                        More <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-info pull-right" role="menu" >
                                        
                                        <!-- teacher EDITING LINK -->
                                      
									
										
									
                                    
                                        
										
				
		   
			    <li>
		                      <a class="btn btn-info"   id="more" href="<?php echo base_url();?>admin/rentinvoice?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>">Invoice  </a>
   </li>
		    <li class="divider"></li>
			   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/receivepayment?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&category=<?php echo $category; ?>">Pay  </a>
   </li>
		      <li class="divider"></li>
           
						   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/allocate?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $c->id;}  ?>&category=<?php echo $category; ?>">Allocations  </a>
								</li>					
										
										
							     <li class="divider"></li>			
									   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/receivepayment?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $c->id;}  ?>&category=<?php echo $category; ?>">Payment History  </a>
								</li>	
										
											
							     <li class="divider"></li>					
										
										
					
							
	   <li>

                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/editroom?randomitemidentifier=<?php   {echo  $houseid;}  ?>">Update/Charges  </a>
         </li>

							   
                                    </ul>
										
										
										    
										
                                </div>
						<?php

				}else{
					
						?>
						 <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; ?>'>             <?php  echo$c->houseno ; ?> Ocp
						</a>
						<?php
				}
				?>
		
	 
			
			<?php
			
			}else {
		
			
						
						
						if($checkoutroom==true){
					
						?>
						
						
						
						
						<div class="btn-group">
	 <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='#myCheckout<?php  $c->id; ?>'>        <?php  echo$c->houseno ; ?> Ocp
						</a>
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" style="padding:7px;">
                                        More <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-info pull-right" role="menu" >
                                        
                                        <!-- teacher EDITING LINK -->
                                      
									
										
									
                                    
                                        
										
				
		   
			    <li>
		                      <a class="btn btn-info"   id="more" href="<?php echo base_url();?>admin/rentinvoice?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>">Invoice  </a>
   </li>
		    <li class="divider"></li>
			   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/receivepayment?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&category=<?php echo $category; ?>">Pay  </a>
   </li>
		      <li class="divider"></li>
           
						   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/allocate?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $c->id;}  ?>&category=<?php echo $category; ?>">Allocations  </a>
								</li>					
										
										
							     <li class="divider"></li>			
									   <li>
			                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/receivepayment?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $c->id;}  ?>&category=<?php echo $category; ?>">Payment History  </a>
								</li>	
										
											
							     <li class="divider"></li>					
										
										
					
							
	   <li>

                     <a class="btn btn-info"  id="more" href="<?php echo base_url();?>admin/editroom?randomitemidentifier=<?php   {echo  $houseid;}  ?>">Update/Charges  </a>
         </li>

							   
                                    </ul>
										
										
										    
										
                                </div>
						
						
						
						
						
						
						
						<?php

				}else{
					
						?>
							 <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; ?>'><?php  echo$c->houseno ; ?> Ocp
						</a>
						<?php
				}
				?>
			
			
			<?php
			}	
				
				
			}else{
				$finalvacant="";
				
				if(($c->beds > 1 )&& ($c->beds !="")){
					
					$confirmvacantrooms = $this->usermodel->GettatalbedsVacant($c->id);

					
					$finalvacant="(".$confirmvacantrooms."/".$c->beds.")";
				}else{
				$finalvacant="";	
				}
				
				
			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:1%; font-size:12px;">    <?php  echo$c->houseno.$finalvacant; ?> </div>Vacant Ready</a>

			<?php
			} 
			
			if($mystatus=="occupied"){
				if($checkoutroom==true){
					
						?>
						 <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='#myCheckout<?php  $c->id; ?>'> <div style=" padding:1%; font-size:12px;"> <?php  echo$c->houseno.$finalvacant ; ?> </div>Occup Ready</a> 
						
			
						
						<?php

				}else{
					
						?>
						 <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:1%; font-size:12px;">       <?php  echo$c->houseno.$finalvacant ; ?> </div>Ocp
						</a>
						<?php
				}
			}
				?>
		
	 
			
			<?php
			if($mystatus=="Vacant Dirty"){
				if($updateroom==true){
					
						?>
						 <a class="btn btn-warning 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='#myCheckout<?php  $c->id; ?>'>             <div style="padding:1%; font-size:12px;">        <?php  echo$c->houseno.$finalvacant ; ?>  </div>Vacant   &nbsp;  Dirty<?php  $c->status ; ?> 
						</a>
							<?php
							}else{ 
							?>
							
						<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:1%; font-size:12px;">       <?php  echo$c->houseno.$finalvacant ; ?> </div>Ocp
						</a>
							
							<?php
							}
							?>
			
			
			<?php
			}
			?>
			
  	<?php
			if($mystatus=="Occupied Dirty"){
				if($updateroom==true){
					
						?>
						 <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='#myCheckout<?php  $c->id; ?>'>             <div style="padding:1%; font-size:12px;">        <?php  echo$c->houseno.$finalvacant ; ?>  </div><?php echo  $c->status ; ?> 
						</a>
							<?php
							}else{ 
							?>
							
						<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:1%; font-size:12px;">       <?php  echo$c->houseno.$finalvacant ; ?> </div>Ocp
						</a>
			<?php
			}
			}
			?>
			<?php
			if($mystatus=="Blocked"){
				if($updateroom==true){
					
						?>

						 <a class="btn btn-default 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='#myCheckout<?php  $c->id; ?>'>             <div style="padding:1%; font-size:12px;">        <?php  echo$c->houseno.$finalvacant ; ?>  </div><?php  echo$c->status ; ?> 
						</a>
							<?php
							}else{ 
							?>
						<a class="btn btn-default 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:1%; font-size:12px;">       <?php  echo$c->houseno.$finalvacant ; ?> </div>Ocp
						</a>
			<?php
			}
			}
			?>
			
			<?php
			if($mystatus=="Reserved"){
				if($updateroom==true){
					
						?>
						 <a class="btn btn-primary 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='#myCheckout<?php  $c->id; ?>'>             <div style="padding:1%; font-size:12px;">        <?php  echo$c->houseno.$finalvacant ; ?>  </div><?php  echo$c->status ; ?> 
						</a>
							<?php
							}else{ 
							?>
							
						<a class="btn btn-primary 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:1%; font-size:12px;">       <?php  echo$c->houseno.$finalvacant ; ?> </div>Ocp
						</a>
			<?php
			}
			}
			?>
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			<?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">Customer 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" selected  >Vacant Ready</option>

				   <option  value="Vacant Dirty" >Vacant Dirty</option>
				<?php
					if( $usertype=="admin"){
						?>
   <option value="vacant"   >Vacant Ready</option>
  
<option value="Occupied Dirty" >Occupied Dirty </option>

   <option value="Blocked" >Blocked</option>
   <option value="Reserved" >Reserved</option>

					<?php	
					}
					
					?>
					


	
</select>
Clear Pending Balance?
 	<select class="form-control" name="balance" required>
	<option  value=""  >--Do you want to Clear any Pending tenant balance automatically?-</option>
   <option value="yes"  >Yes</option>
									  
 <option value="no"  selected="selected"  >No</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>
  
  <div class="form-group">
    <label for="inputplotno" class="col-sm-2 control-label">Building name?</label>
    <div class="col-sm-7">
	<select class="form-control" name="plotno" >
	
	<option value=""  selected="selected" >---Select Building name---</option>

	<?php 
	$session_data = $this->session->userdata('logged_in');

  
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
		 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
					 
										$plotname= $this->usermodel->populatealldatanoarray('plot','companyid',$companyid,'category',"accommodation");


	
if(is_array($plotname)) {

   foreach($plotname as $plotnamerow){

   //echo $courserow->coursename;
    ?>
			<option value="<?=  $plotnamerow->id;   ?>"><?=  $plotnamerow->name; ?></option>



	<?php

}} else {
    echo 'No bank available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('plotno'); ?>

	</div>
  </div>
  
		<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="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="ServiceSales" 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">Post Service Sales </h4>
      </div>
      <div class="modal-body">
        <h4>Are you sure you want to start posting service sales ? </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");
         $exactdate = date('Y-m-d H:i:s');

		
                 echo form_open('admin/startservicesales' , 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-3 control-label">Invoice  Date</label>
    <div class="col-sm-9">
				<input type="text" name="createdat" value="<?php echo set_value('checkoutdate',$exactdate); ?>" id="idno" class="form-control" required placeholder="Enter End  Date">
        <span class="text-danger"><?php echo form_error('checkoutdate'); ?></span>
	</div>
  </div>
  
  
   <div class="form-group">
    <label for="inputtype" class="col-md-3 control-label">Prefered Payment Mode</label>
    <div class="col-md-9">
       
<select name="type" id="type" required class="form-control">
<option value="" selected="selected">-Select Mode-</option>

<option value="Cash" >Cash</option>
<option value="Credit">Credit/Invoice</option>
<option value="Mpesa">Mpesa</option>
<option value="Card">Card</option>

<option value="Bank">Bank</option>
<option value="Voucher">Voucher/Complimentary</option>
<option value="Points">Bonga Points</option>

</select>	
	   <span class="text-danger">Prefered Payment Mode<?php echo form_error('type'); ?></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="savenewservices" value="services" 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>




			