

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

        });
		
		
					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/searchrooms";
		alert(" printing...........");
    }else {

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

		    // document.body.innerHTML = originalContents;

	}
}


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

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

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




<ul class="nav nav-tabs bordered" id="non-printable" >
			<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 class="btn btn-info"href="<?php echo base_url(); ?>admin/viewpallmyplots">	Go back</a>
                    	</a></li>
				<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>
						
		</ul>
    	<!------CONTROL TABS END------>
        
		
		<?php
					echo $this->session->flashdata('deletemsg'); 
		   $session_data = $this->session->userdata('logged_in');

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


			?>
            <!----TABLE LISTING STARTS-->
          	<div class="row">
	
	
	<div class="col-md-12">
			<div id="printableArea">

	 	<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; }
 
											 
										 }
										?>
										</BR>
										   <center><B>ROOMS LIST</B> </Center>	
		</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 id="example"  cellspacing="1" border="1" class="table  table" width="100%">
             <thead>
			
         <tr>
	
  <th>Room No </th>
	<th>House No</th>
	<th>Floor</th>
	<th>Type</th>
 


<td id="non-printable" > More</td>
                 </tr>
             </thead>
<?php
 $grandtotal=0;
echo $this->session->flashdata('msg'); 
 if(!is_array($house)) 

 {



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

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

		 

             ?>



             <tr>
                
            <?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"];

?>


             <td><?php echo $c->houseno ; ?></td> 
				<td><?php echo $c->plotno ;

$allplotno=$c->plotno;				?></td> 
				
<td><?php echo $c->floor ; ?></td>
<td><?php echo $c->type ; ?></td>  
			
			
		   
		 
		 
		 
		 
		 <td id="non-printable" > 

 
 
					<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">
                                  <?php
										if($booking!=FALSE){
											
											?>
										
											  <li> 
										
                                         <li> 
						<a  id="more" class="btn btn-warning" href="<?php echo base_url();?>user/mychangepayment?myid=<?php echo $c->id ?>&randomitemidentifier=<?php echo $houseno ?>&randomitemidentifier1=<?php echo $plotno ?>&roomidentifier=<?php echo $roomidentifier ?>"> Update Payment  </a>


                                                </a>
                                                        </li> 
                                                        </li>
														  <li class="divider"></li>

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

                                                        </li> 
  <li class="divider"></li>
														<?php
										if($usertype=="admin"){
											
											?>
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'   data-plotno='<?php echo  $c->plotno;?>'  data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


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

             <?php endforeach; ?>

              <?php }?>
			 
			 

        </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">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="selected">Vacant</option>
									  
 <option value="freezed"  >Freezed</option>
																 									   <option value="Pending">Pending</option>



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

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

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


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

  </div>

  </div>
		
		







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

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

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

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

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

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

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

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


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

  </div>

  </div>






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

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

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

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

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

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

  </div>

  </div>

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




			