

         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		$(document).on("click", "#editbtn", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		   
		   		   
   var maincategory = $(this).data('maincategory');
		   $("#maincategory").val(maincategory);
 
		    var name = $(this).data('name');
		   $("#name").val(name); 
		   
		     var description = $(this).data('description');
		   $("#description").val(description); 
		 
		  
		     var comments = $(this).data('comments');
		   $("#comments").val(comments); 
		 
		   var status = $(this).data('status');
		   $("#status").val(status);
		    var houseno = $(this).data('houseno');
		   $("#houseno").val(houseno);
		     var plotno = $(this).data('plotno');
		   $("#plotno").val(plotno);
		     var type = $(this).data('type');
		   $("#type").val(type);
		      var approval = $(this).data('approval');
		   $("#approval").val(approval);
		      var userid = $(this).data('userid');
		   $("#userid").val(userid);
		         var exactdate = $(this).data('exactdate');
		   $("#exactdate").val(exactdate);
		   
        });
		
		
		
		
		
			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 = "../admin/viewhousekeeping";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../admin/viewhousekeeping";

		    // document.body.innerHTML = originalContents;

	}
}


		
		
		
		
		
		
		
		
		

    </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">
	<?php
	
	 $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];

 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
	 
	 	 $data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	  echo $this->session->flashdata('deletemsg'); 

				echo $this->session->flashdata('msg'); 
		      $assignrooms=$this->usermodel->populatuserpermissionsdataarray('accomodation','assignrooms',$userid);

	?>
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading" id="non-printable" >
		VIEW HOUSE KEEPING HISTORY

            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>

			 <a href="<?php echo base_url();?>admin/viewhousekeeping" class="btn btn-info"> Search again</a>	
								 <a href="<?php echo base_url();?>admin/viewpallmyplots" class="btn btn-info">  Go back to home page</a>	


            	<div class="pull-right">
<form name="print" method="post" action="">

<input type="submit" id="print"  accesskey="p" class="btn btn-info"  name="print"onclick="printDiv('printableArea')" value="print receipt!" />
</form>

            	</div>
            	</div>
            </div>
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
	<?PHP


								?>	
										
					<div class="row">
						<div class="col-md-12">
			<div id="printableArea">
							<div class="panel-body">
				<table width="100%">

									
											<tr>
				 	
	<td colspan="2" width="100%">
	<center>
					
					
						<?php 
																				 $countbranch=$this->usermodel->countbranches($companyid);

										 if( $countbranch>1){
										 $mybranches= $this->usermodel->populateallarray('branch','id',$branchid);
										$branchdescription=$mybranches[0]['description']; if(isset($branchdescription)) {echo   $branchdescription; }


										}else{
									$bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }
 
											 
										 }
										?>
		</center>	
		</td>

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

												  

				<h4><b>Bookings  between <?php echo $MYfromdate = date("d/m/Y H:i:a", strtotime($fromdate)); ?> to  <?php  echo $MYtodate = date("d/m/Y H:i:a", strtotime($todate));  ?>.</b></h4>	</td>
					<td><h4><b>Printed on <?php echo $date = date("Y-m-d"); ?></b></h4></td>

		</tr>
			
			
				<?php 
				
				}
			
			?>
		  </table>		
  <table cellpadding="1" cellspacing="1" border="1" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
			 
			 
			 	<tr>
	<th colspan="11">
	
								<h4><b><center>ROOMS SOLD VS  ROOMS CLEANED  REPORT</CENTER> </b></h4>	
</th> 
	</tr>
         <tr>
		      <th>Date</th>

     <th> No of Room Sold</th>

	 <th>No of Room Cleaned</th>




<th>Remarks for Manager/ Supervisor</th>		


 
		


                 </tr>
             </thead><tbody>
<?php
 if(!is_array($viewhousekeeping)) {
				    echo '<div class="alert alert-danger text-center">There was no data found in the system</div>';

			 }else{

    
       
  
  	foreach ($viewhousekeeping as $c): 

		 

             ?>



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


?>

    
  <td><?php 

												   	  echo $datespent = date("d/m/Y H:i:a", strtotime($c->exactdate));



  ?></td>          

  <td><?php
  
  $bookings = $this->accomodationmodel->getmyhousebooingsandroomscleaned("all","all",$companyid,$fromdate,$todate);
  //$bookings = $this->accomodationmodel->getmyhousebooingsandroomscleaned($c->plotno,$c->houseno,$companyid,$fromdate,$todate);

  
   echo $bookings[0]["booings"] ; 
  
  
  
  
  ?></td>
  	  <td><?php echo $c->counter ; ?></td>

     
	 
  
  
  
  
  

		  	  <td></td>
	

	  

		  
		  
		 
		 
             </tr>

	<?php endforeach;} ?>

             
<tbody>
        </table>

									
									
									
					</div>	

					
					
					
					
					
						<div id="uploadModal" 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">Please Upload Correct Products Category data(CSV)</h4>
		
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/uploadcategoryproducts' , 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="view" value="user/viewproductcategory"id="view" class="form-control" required placeholder="Enter view">
	
	
	<div class="form-group">
    <label for="inputsurname" class="col-sm-2 control-label">	CSV LIST</label>
    <div class="col-sm-10">
		
			<input type="file" name="file" width="400"  value="<?php echo set_value('file') ;?>" placeholder="Select EXCELL" class="form-control" required placeholder="Enter Surname"  >

		  		
				
		<span class="text-danger"> Upload correct format of CSV File  here..<?php echo form_error('file'); ?>
		
		</span>
	</div>
  </div>	
  
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="products" name="btn_uploadcategoryproducts" class="btn btn-primary">Upload products Category </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
				   
				
<div id="editProductModel" 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">Update house keeping</h4>
      </div>
      <div class="modal-body">
      
	  	
	  	

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

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/posthousekeeping' , 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="view" value="admin/viewhousekeeping"id="view" class="form-control" required placeholder="Enter status">
<input type="hidden" name="action" value="update" class="form-control" required placeholder="Enter action">
	<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">



 <div class="form-group">
    <label for="inputexactdate" class="col-sm-2 control-label"> Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="exactdate" id="exactdate" value="" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('exactdate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
 <div class="form-group">
    <label for="inputuser" class="col-sm-2 control-label">User?</label>
    <div class="col-sm-10">
	<select class="form-control" name="user" id="userid"  required>
	
	<option value=""  >---Select user---</option>

			<?php
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

 		
				
	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
						<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>




	<?php

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

	</div>
  </div>
  


  
  
  <div class="form-group">
    <label for="inputhouseno" class="col-sm-2 control-label">Room No.?</label>
    <div class="col-sm-10">
	<select class="form-control" name="houseno"  id="houseno"  required>
		<option value=""  >---Select room Number---</option>


	
	
	<?php 
					 
						$house= $this->usermodel->populateall('house','companyid',$companyid);

					 


if(is_array($house)) {

   foreach($house as $houserow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $houserow->id;   ?>"><?=  $houserow->houseno."-Plotno :" .$houserow->plotno; ?></option>



	<?php

}} else {
    echo 'No Room  available.';
}
	
?>
</select>
		

	</div>
  </div>
  
  <div class="form-group">
    <label for="inputplotno" class="col-sm-2 control-label">Plotno	Number </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="plotno"  id="plotno" value="<?php echo set_value('plotno'); ?>" class="form-control" required placeholder="Enter the plotno">
		 
				
		<span class="text-danger"> <?php echo form_error('plotno'); ?>
		
		</span>
	</div>
  </div>
  
  <div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">House type </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="type"  id="type" value="<?php echo set_value('type'); ?>" class="form-control" required placeholder="Enter the house type">
		 
				
		<span class="text-danger"> <?php echo form_error('type'); ?>
		
		</span>
	</div>
  </div>
  
    <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Status	?</label>
    <div class="col-sm-10">
		<select class="form-control" name="status" id="status"  required>
			<option  value=""selected="selected"  ></option>

	<option  value=""  >--Select room status-</option>
   <option value="vacant" >Vacant</option>
						 <option value="occupied"  >occupied</option>
			  
 <option value="freezed"  >Freezed</option>
																 									   <option value="Pending">Pending</option>



	
</select>
	</div>
  </div>
  
  
				  		
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">Incharge	Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name"  id="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter the person incharge">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>

   <div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">Description </label>
    <div class="col-sm-10">
	<textarea name="description"  id="description"   placeholder="Enter any description" class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
	
   <div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">Supervisor Comment </label>
    <div class="col-sm-10">
	<textarea name="comments"   placeholder="Enter any comments" id="comments" class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('comments'); ?></span>
   </div>
  </div>
    
	<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Approval Status	?</label>
    <div class="col-sm-10">
		<select class="form-control" name="approval" id="approval" required>
	<option  value=""  >--Select Approval status-</option>
   <option value="approved" selected="selected">approved</option>
						 <option value="rejected"  >rejected</option>
			  						 <option value="new"  >new</option>
			  						 <option value="pending"  >pending</option>
			  						 <option value="closed"  >closed</option>

																 									   <option value="Pending">Pending</option>



	
</select>
	</div>
  </div>

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="house" name="btn_addhousekeeping" class="btn btn-primary"> Post House Keeping   </button>

    </div>
  </div>
  					<?php echo form_close();?>
	</div>					
									
							
								
			<div class="modal-footer">

    

				</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('logged_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="housekeeping">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewhousekeeping">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <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 id="addModal" 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">Asign room</h4>
      </div>
      <div class="modal-body">
      
	  	

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

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/asignrooms' , 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="view" value="admin/viewhousekeeping"id="view" class="form-control" required placeholder="Enter status">
<input type="hidden" name="action" value="insert" class="form-control" required placeholder="Enter action">
<input type="hidden" name="mycategoryid" value="" class="form-control" required placeholder="Enter action">






 <div class="form-group">
    <label for="inputexactdate" class="col-sm-2 control-label"> Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="exactdate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('exactdate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
 <div class="form-group">
    <label for="inputuser" class="col-sm-2 control-label">User?</label>
    <div class="col-sm-10">
	<select class="form-control" name="user" required>
	
	<option value=""  >---Select user---</option>

			<?php
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'category','user');

 		
				
	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
						<option selected="selected" value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>




	<?php

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

	</div>
  </div>
  


  
  
  <div class="form-group">
    <label for="inputhouseno" class="col-sm-2 control-label">Room No.?</label>
    <div class="col-sm-10">
	<select class="form-control" name="houseno"  required>
		<option value=""  >---Select room Number---</option>


	
	
	<?php 
					 
						$house= $this->usermodel->populateall('house','companyid',$companyid);

					 


if(is_array($house)) {

   foreach($house as $houserow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $houserow->id;   ?>"><?=  $houserow->houseno."-Plotno :" .$houserow->plotno; ?></option>



	<?php

}} else {
    echo 'No Room  available.';
}
	
?>
</select>
		

	</div>
  </div>
  
				  		
	
  
  

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="clean" name="btn_asignrooms" class="btn btn-primary"> Asign Room   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>





			
  
<div id="cleaniningreportModal" 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">Report for rooms cleaned</h4>
      </div>
      <div class="modal-body">
      
	  	

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

				echo $this->session->flashdata('deletemsg'); 


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/searchroomscleaned' , 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="view" value="admin/viewhousekeeping"id="view" class="form-control" required placeholder="Enter status">
<input type="hidden" name="action" value="insert" class="form-control" required placeholder="Enter action">
<input type="hidden" name="mycategoryid" value="" class="form-control" required placeholder="Enter action">






 <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">From Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="fromdate" value="<?php echo  date("Y-m-d 00:00:00"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
 <div class="form-group">
    <label for="inputenddate" class="col-sm-2 control-label">To Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="enddate" value="<?php echo  date("Y-m-d 23:59:59"); ?>" class="form-control" required placeholder="Enter end date">
		 
				
		<span class="text-danger"> <?php echo form_error('enddate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
 <div class="form-group">
    <label for="inputuser" class="col-sm-2 control-label">Select User?</label>
    <div class="col-sm-10">
	<select class="form-control" name="user" required>
	
	<option value=""  >---Select user---</option>
	<option value="all" selected="selected"  >--ALL/Everyone---</option>

			<?php
			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'category','user');

 		
				
	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
						<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>




	<?php

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

	</div>
  </div>
  


  
  
	
  
  

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="clean" name="btn_asignrooms" class="btn btn-primary"> Asign Room   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>



		
									
									
							</div>		
									
							</div>
						</div>
				

			
			</div>
		</div>
  
  </div>
			
				
		
		
  

 
</div>


















