
<script>
	function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

    // document.body.innerHTML = printContents.fontsize(12);
     window.print();

	 if( window.print()) {
         window.location.href = "../user/searchhousebalance";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../user/searchhousebalance";

		    // document.body.innerHTML = originalContents;

	}
}


       
		 
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid").val(itemid); 
		  
		  
		   
        });
		








	</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); 
		   
		    var bedid = $(this).data('bedid');
		  $("#bedid").val(bedid); 
        });
		
	
		</script>
	
	
	
   <style type="text/css">
  
  

    #printable { display: none; }

    #myprint { display: none; }
#print{  	


    background-repeat: no-repeat;
	font-size;12px;
  
    


}


#sale{  	
background-image:url(images/add.png) ;

    background-repeat: no-repeat;
  
    width:100px; height:50px;


}
    
    @media print
    {
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:16; width:100%; }
		    	#myprint { display: block; font-size:16; width:100%; }

    }
    </style>







 <div class="row">

 

   	<div class="col-md-12">

				 
				 	<div class="print-hide" id="non-printable"  >
<form name="print" method="post" action="">
 
 <div class="row">

 

   	<div class="col-md-6">
				 <a class="btn btn-success" href="<?php echo base_url(); ?>admin/viewpallmyplots">	GO BACK</a> ||

					 <a class="btn btn-info"href="<?php echo base_url(); ?>admin/searchbalance">View More reports</a><BR>

</div>
   	<div class="col-md-6">
<input type="submit" id="print"  accesskey="p" class="btn btn-primary"  name="print"onclick="printDiv('printableArea')" value="print receipt!" />
</form></div></div>
							</div> 
     
	 
	 <?php
	 	$session_data = $this->session->userdata('logged_in');

    $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
 $data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
        
		
			 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	        		$configuration = $this->usermodel->populateallarray('smsconfig','id',$companyid);



    $updatehouse=$this->usermodel->populatuserpermissionsdataarray('accomodation','updatehouse',$userid);
		   $cancelpayment=$this->usermodel->populatuserpermissionsdataarray('accomodation','cancel',$userid);
	      				 				   $checkoutroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','checkoutroom',$userid);



	 
	 ?>
	 
	 
	 


 <div class="panel panel-primary" data-collapsed="0">
 	<div class="table-responsive">
			<div id="printableArea">
			
			<table width="100%">
           
			
			<tr>
				 	
	<td colspan="2" width="100%">
	<center>
					
										<?php $bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }?>
		</center>	
		</td>

			</tr>
			<?php if(isset($fromdate)) {
			
				
				
			
			?>
		<tr>
				<td>

				<h4><b>Bookings  between <?php echo $fromdate; ?> AND <?php echo $todate; ?>.</b></h4>	</td>
					<td><h4><b>Printed on <?php echo $date = date("Y-m-d"); ?></b></h4></td>

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

<table  border="1"width="100%">
             <thead>
	<tr>
	<th colspan="11">
	
								<h4><b><center>BULK CHECK IN  REPORT</CENTER> </b></h4>	
</th> 
	</tr>
		

         <tr>
		 
		 		  

		 
    
   
    
<th>Customer</th> 	
	<th>ID No</th> 
	<th>Phone</th> 
	 <th>Rm No </th>
	<th>HS No</th>

	<th>Amount </th> 
	 <th>Check-In </th>
		<th>Check-Out </th>
<th>Room Type</th>
	 <th>Served By</th> 
<td id="non-printable"> </td>


                 </tr>
             </thead>
<?php
	
				echo $this->session->flashdata('msg');
				 echo $this->session->flashdata('deletemsg'); 
		if(validation_errors()):
		 endif;
 if(!is_array($booking)) 

 {




    
       echo '<div class="alert alert-warning text-center">There is no booking found by now from system..</div>';
    
    }else {
?>
    
             <?php 


  	foreach ($booking as $c): 
									// echo$totalpaid= $c->card+$c->amount+$c->mpesa+$c->voucher+$c->cheque;;


             ?>



             <tr>
                
            <?php 
		$id=$c->id;
		
?>
         

             <td><?php echo $c->customer ; ?></td> 
             <td><?php echo $c->idno ; ?></td> 
             <td><?php echo $c->phone ; ?></td> 
			 	<td><?php
				
				if($c->bedname !="1"){
					echo $c->houseno."-".$c->bedname ;
				}else{
					echo $c->houseno;
				}
				
				?></td>
			 
			 
			 
			 
			 
			 
			 
			 
				<td><?php echo $c->plotno ; ?></td> 
				<td><?php echo $c->amount ; ?></td> 

			     <td><?php echo $c->checkin ; ?></td> 
             <td><?php echo $c->checkout ; 
			 
			 
			 
			 
			 		
			
 if( $checkoutroom==true){
	 //
					if( $c->status=="new"){						
											?>

			 <a class=" btn-danger managebtn" id="managebtncheckout"	data-bedid='<?php echo  $c->bedid;?>' 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; ?>'>  Check-Out
						</a>
			
				
						 	<?php
					}
 }
			 
			 
			 
			 
			 
			 
			 
			 
			 ?></td>
			            
<td><?php

						   $chargename = $this->usermodel->populateallarray('charges','id', $c->code);

	echo $chargename=$chargename[0]['type'];

 ?></td> 

													      
		 <td>
												 
	<?php 
					// $branch="";
					 $userid=$c->userid;

					 $user= $this->usermodel->populateall('people','id',$userid);



if(is_array($user)) {

   foreach($user as $userhrow){

   echo $userhrow->surname;
 
 
}} else {
    echo 'No Name.';
}
	
?>
												 
	 </td>	





  
		 	
		 

		 
		 
             </tr>

             <?php endforeach; ?>
			

              <?php }?>
			  <tr>
			  <td colspan="5"> <b>Total sales</b></td>
				 	 <td colspan="2"><b><?php  if(isset($actualtotal)){ echo $actualtotal; } ?></b></td> 
			  </tr>

        </table>

    </div>    </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/myupdatechekoutbedsgoup' , 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="">
 <input type="hidden" id="bedid" name="bedid" class="roomidentifier" placeholder="roomidentifier" value="">

 
 	<select class="form-control" name="status" required >
	<option  value=""  >--Select status-</option>

				   <option selected 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/pendingbeds?=">
 <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="checkoutbedgroup" 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/deleteallbyid' , 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="view"name="view" class="view" placeholder="view" value="admin/viewpallmyplots">
 <input type="hidden" id="itemid"name="itemid" class="itemid" placeholder="itemid" value=""><br>
           <input type="hidden" id="houseno"name="houseno" class="form-control" placeholder="houseno"  value="">

          <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>