

         <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);
		   
        });
		
		
		

    </script>   
 
 <div class="row">
  	<?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['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="col-md-12">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
		VIEW Room asigned to users
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
					
					
				
					

						 <a href="<?php echo base_url();?>admin/viewhousekeeping" class="btn btn-primary">  Go back</a>	
									 <a data-toggle='modal' data-target='#roomallocationreportModal' class="btn btn-success"> View  for Room Alloction List </a>


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

				<div class="widget-content nopadding table_holder table-responsive" >				
	
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	
									
									
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
			 	<th colspan="11">
	
								<h4><b><center>CLEANERS'S ROOM ALLOCATION LIST</CENTER> </b></h4>	
</th> 
         <tr>
     <th>Name</th>

	 <th>House No</th>
	 	 <th>Plot No</th>
	  	 <th>Type</th>

<th>Status</th>		

<th>Floor</th>		


     <th>Date Allocated</th>

 
		
	<th>More</th>	

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

			 }else{

    
       
  
  	foreach ($asignrooms as $c): 

		 

             ?>



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


?>

    

  <td><?php  $memberid=$c->memberid ; 
  
    $myadvance = $this->usermodel->populateallarray('people','id', $memberid);

	 echo$name=$myadvance[0]['firstname']." ".$myadvance[0]['surname'];
  
  ?></td>
    <td><?php echo $c->houseno ; ?></td>
	    <td><?php echo $c->plotno ; ?></td>

    <td><?php 


    $houses = $this->accomodationmodel->getplothousebyallstatusid($c->plotno,$c->houseno);

	 echo$name=$houses[0]['type'];
	?></td>

     
	 
  
  
  
  
  
	  <td><?php echo $c->status ; ?></td>
	  <td><?php echo $c->floor ; ?></td>

  <td><?php echo $c->exactdate ; ?></td>          

	  

	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										<?php
										if($usertype=="admin"){
											
											?>
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Cancel Room Assigned
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                       	  <!--- 
                                     	  <li> 


	 <a class="btn btn-primary editbtn" id="editbtn" data-type='<?php echo  $c->type;?>' data-plotno='<?php echo  $c->plotno;?>' data-houseno='<?php echo  $c->houseno;?>' data-userid='<?php echo  $c->userid;?>' data-exactdate='<?php echo  $c->exactdate;?>' data-status='<?php echo  $c->status;?>'data-approval='<?php echo  $c->approval;?>'data-name='<?php echo  $c->name;?>' data-comments='<?php echo  $c->comments;?>'   data-description='<?php echo  $c->description;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Update
                                                </a>
                                                        </li>
														-->
															<?php
										}
										?>
										     
                                    </ul>
										
                                </div>
</td>
		 
		 
		 
             </tr>

	<?php endforeach;} ?>

             
<tbody>
        </table>

									
									
									
					</div>	

<div id="roomallocationreportModal" 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 allocation</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/searchroomsallocated' , 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="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">
    <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">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="clean" name="btn_Alloctionrooms" class="btn btn-primary"> View Alloction List   </button>

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

    

				</div>

		</div>
	    </div>
    </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">Cancel</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to Cancel this room assignment? </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="asignrooms">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewassignedrooms">
 <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"> Cancel  </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/viewassignedrooms"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>		
									
							</div>
						</div>
				

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

 
</div>


















