	 <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", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid").val(itemid); 
		  
		  
		   
        });
		
		
		 $(document).on("click", "#managebtncheckout", function()
        {
          var itemid2 = $(this).data('id');
		  $("#itemid1").val(itemid2); 
		  
		    var houseno2 = $(this).data('houseno');
		  $("#houseno2").val(houseno2); 
		     var plotno2 = $(this).data('plotno');
		  $("#plotno2").val(plotno2); 
		   
        });
		
		
		
		
		
		
		$(function () {
        $("#type").change(function () {
            if ($(this).val() == "Cash") {
             $("#due").hide();
		   $("#accountno").hide();
              $("#cash").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("mpesa").value = myfinaltotal;
						
			document.getElementById("credit").value = 0;
			 document.getElementById("card").value = 0;
			document.getElementById("voucher").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;


            } else if ($(this).val() == "Mpesa") {
              $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
              
$("#mpesa").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("mpesa").value = myfinaltotal;
						
			document.getElementById("cash").value = 0;
			document.getElementById("credit").value = 0;
			 document.getElementById("card").value = 0;
			document.getElementById("voucher").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;



            }else if ($(this).val() == "Bank") {
             $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
			   $("#cheque").focus().value = "";

			     	 var myfinaltotal = document.getElementById('myfinaltotal').value;

                 document.getElementById("cheque").value = myfinaltotal;
						
			document.getElementById("cash").value = 0;
			document.getElementById("credit").value = 0;
			 document.getElementById("card").value = 0;
			document.getElementById("voucher").value = 0;

			 document.getElementById("mpesa").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;


            }else if ($(this).val() == "Voucher") {
            $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
                     $("#voucher").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("voucher").value = myfinaltotal;
						
			document.getElementById("cash").value = 0;
			document.getElementById("credit").value = 0;
			 document.getElementById("mpesa").value = 0;
			document.getElementById("card").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;

            }else if ($(this).val() == "Creditnote") {
             $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
               $("#creditnotee").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("creditnotee").value = myfinaltotal;
						
			document.getElementById("cash").value = 0;
			document.getElementById("credit").value = 0;
			 document.getElementById("mpesa").value = 0;
			document.getElementById("card").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("voucher").value = 0;

            }else if ($(this).val() == "Points") {
           $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
              
         $("#points").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("points").value = myfinaltotal;
						
			document.getElementById("cash").value = 0;
			document.getElementById("credit").value = 0;
			 document.getElementById("mpesa").value = 0;
			document.getElementById("card").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("creditnotee").value = 0;
			document.getElementById("voucher").value = 0;
            }else if ($(this).val() == "Card") {
           $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
              $("#card").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("card").value = myfinaltotal;
						
			document.getElementById("cash").value = 0;
			document.getElementById("credit").value = 0;
			 document.getElementById("mpesa").value = 0;
			document.getElementById("voucher").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;

            }
			
			
			
			else  if ($(this).val() == "Credit") {
           
				             $("#accountno").hide();
				$("#credit").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("credit").value = myfinaltotal;
						
						  document.getElementById("cash").value = 0;
			document.getElementById("mpesa").value = 0;
			 document.getElementById("card").value = 0;
			document.getElementById("voucher").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;

							 
				$("#due").show();
            }else  if ($(this).val() == "Invoice") {
              $("#accountno").hide();
			 $("#name").show(); 
				                
				$("#due").show();
					$("#credit").focus().value = "";
  	 var myfinaltotal = document.getElementById('myfinaltotal').value;

            document.getElementById("credit").value = myfinaltotal;
						
						  document.getElementById("cash").value = 0;
			document.getElementById("mpesa").value = 0;
			 document.getElementById("card").value = 0;
			document.getElementById("voucher").value = 0;

			 document.getElementById("cheque").value = 0;
			document.getElementById("points").value = 0;
			document.getElementById("creditnotee").value = 0;
            }
            else {
               $("#accountno").show();
				$("#name").hide();
               $("#due").hide();
            }
        });
    });
		
    </script>	 
			
<ul class="nav nav-tabs bordered">
			
			<li class="active">
            	<a href="#list" data-toggle="tab" class="btn btn-warning"><i class="entypo-plus-circled"></i>
					
					View All Bookings for this room 
                    	</a></li>
						
						
									<li>
            	<a href="#back" data-toggle="tab"><i class="entypo-plus-circled"></i>
			
				 <a href="<?php echo base_url(); ?>admin/viewpallmyplots">	Go back/Next Booking</a>
                    	</a></li>
						
						
								<li>
            	<a href="#customer" data-toggle="tab"><i class="entypo-plus-circled"></i>
			
				 <a href="<?php echo base_url(); ?>admin/viewalltenant">View all	Customer</a>
                    	</a></li>
						
						
						<li>
            				 <a class="btn btn-success"href="<?php echo base_url(); ?>admin/viewprndingmoneyreceived">	Pending MPESA</a>

                    	</a></li>	
						
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active" id="list">
				
     


 <div class="table-responsive" >
  <div class="row">
  
   	

   	<div class="col-md-12"> 
<table  border="1" width="100%">
             <thead>
			
         <tr>
		 <th>Ref No</th> 	

    	<th>Check Out</th> 
		<th>Print </th> 
				<th>Form </th> 

    <th>Rm No </th>
	<th>HS No</th>
    
<th>Customer</th> 	
	<th>Id Number</th> 
	<th>Phone Number</th> 
	<th>Check-In </th> 
 <th>Days</th> 		
	 <th>TT Exp</th> 
 <th>Sale Price</th> 


	 <th>Cash </th> 
	  <th>Mpesa </th> 
	 <th>Card </th> 
	 	 <th>Cheque </th> 

	 	 <th>Credit </th> 
		 	 	 <th>Voucher </th> 
				  <th>Food </th> 
	 <th>Dsc </th> 



	 <th> Status </th> 
	
		 <th>Code  </th> 

	
	
	
	
	
	
	 <th>Rm Status</th> 


		 <th>NB  </th> 

	 <th>Staff</th> 
	 
	 <th>View</th> 
<th>More</th> 



                 </tr>
             </thead>
<?php
function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}
				
	 $session_data = $this->session->userdata('logged_in');
    $from=date("Y-m-d");

    $mydate=date("Y-m-d H:i:s");
	
	$next_date = date('Y-m-d', strtotime(' +1 day'));
    $closedatedate=($next_date);


 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
		 $imgid = rand(100, 990000).time();


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

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

	 
	 
				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): 
	$myroomtype=($c->roomtype);
		//$roomtype=($roomtype)+($myroomtype);
		 

             ?>



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


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

		 
		 
		 	<td>
			<?php
			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='#Checkout<?php  $c->id; ?>'>	                      Check-out
						</a>
 

						<?php

				}
			?>
			

						
                         
						
						
				</td>
				
		  	<td>
			
			 <a class="btn btn-primary"  target="_blank" id="more" href="<?php echo base_url();?>admin/housereceiptbyno?randomitemidentifier=<?php   {echo  $c->id;}  ?>&plotno=<?php   {echo  $c->plotno;}  ?>&houseno=<?php   {echo  $c->houseno;}  ?>">Print  </a>

						
						

				</td>
				  	<td>
			
			 <a class="btn btn-primary"  target="_blank" id="more" href="<?php echo base_url();?>admin/guestform?randomitemidentifier=<?php   {echo  $c->id;}  ?>&plotno=<?php   {echo  $c->plotno;}  ?>&houseno=<?php   {echo  $c->houseno;}  ?>">Form  </a>

						
						

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

						 				         <td><?php 
					
   $tenantid=$c->tenantid;
				    $tenants = $this->accomodationmodel->gettenantbyid($tenantid);
 if(is_array($tenants)) {
   foreach($tenants as $tenantsrow){

    $names=$tenantsrow->lastname. " ".$tenantsrow->firstname ; 
   
   ?>
   
                     <a class="btn btn-warning"  target="_blank"   style="margin:5px" id="more" href="<?php echo base_url();?>admin/edittenant?randomitemidentifier=<?php   {echo  $tenantid;}  ?>"><?php   {echo  $names;}  ?>  </a>

   
   <?php
    

}
    } else {
    echo 'No tenant.';
}
?>
				 
				 
		</td>

				 		<td><?php  $tenantid=$c->tenantid ; 
				 
				 
				    $tenantsid = $this->accomodationmodel->gettenantbyid($tenantid);
								


if(is_array($tenantsid)) {

   foreach($tenantsid as $tenantsidrow){

   echo $tenantsidrow->idno; 
    

}} else {
    echo $c->tenantid;
}
				 
				 
				 
				 
				 
				 ?></td>
				 
				 
				 		<td><?php  $tenantid=$c->tenantid ; 
				 
				 
				    $tenantsid = $this->accomodationmodel->gettenantbyid($tenantid);
								


if(is_array($tenantsid)) {

   foreach($tenantsid as $tenantsidrow){

   echo $tenantsidrow->phone; 
    

}} else {
   echo" GENERAL";
}
				 
				 
				 
				 
				 
				 ?></td>
				 
				 
              									<td><?php echo $c->createdat; ?></td>
       <td><?php echo $c->number; ?></td>
<td><?php echo $myroomtype; ?></td>
					               					                      <td><?php echo $c->total; ?></td>					               

									<td><?php echo $c->amount; ?></td>
					 <td><?php echo $c->mpesa; ?></td>
					 					 <td><?php echo $c->card; ?></td>
					 <td><?php echo $c->cheque; ?></td>

										 <td><?php echo $c->credit; ?></td>
										 <td><?php echo $c->voucher; ?></td>
										 <td>
										 
										 <?php



 $roomsales = $this->usermodel->populatealldatanoarrayfour('roomsales','houseno', $houseno,'plotno', $plotno,'description', $c->id,'customerid', $c->tenantid);			   

				
				
				
				
				
 if(!is_array($roomsales)) 

 {


  
    }else {
?>
    
             <?php 
  $total=0;
  	foreach ($roomsales as $row){ 

		   $total=$total+$row->total;
	}
	}
			  								if(isset($total)) {echo   formatMoney($total, true); }
							 
										 
				?>						 </td>
										 
										 <td><?php echo $c->discount; ?></td>

								

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

								

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

					 
					 
					 
					 
					 
					 
					 
					 
					 
					 
					 
					 
								 
				<td><?php  $status = $c->status ;
				if($status=="reserved"){
					
					echo "reserved";
				}else 
				if($status=="active"){
					
					echo "occupaid";
				}else{
					echo "vacant";
					
				}
				?></td> 
         				
               
		 
		 
		 
		  <td><?php echo $c->description; ?></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>	

		 

		 <td>
		
		 						<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 ?>"> View  </a>

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

                                        
                                         <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 class="divider"></li>														
										<?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
                                                </a>
                                                        </li>
										<?php
										}
										?>
									
                                     
                                    </ul>
										
                                </div>
		 
		 </td>
             </tr>

             <?php endforeach; ?>

              <?php }?>

        </table>
</div>

</div>

</div>

</div>
		<!----CREATION FORM STARTS---->
				   <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">
        <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/updatechekout' , 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" name="roomidentifier" value="<?php  echo $roomidentifier ; ?>"id="roomidentifier" class="form-control"  placeholder="Enter roomidentifier">

 <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="&randomitemidentifier1=">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/allocate?randomitemidentifier=">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
        
 	<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>



	 



		 <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="updatecharges" value="charges" 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="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">Add new customer</h4>
      </div>
      <div class="modal-body">
      
	  	


		
				  		
	

				<?PHP

 $transactionid = 'rand' .rand(100, 9900) . 'trc' . time();

 
		 $date=date("Y-m-d");

                 echo form_open('addtenant' , 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;?>
					
  <div class="form-group">

    <label for="inputfirstname" class="col-sm-2 control-label">Customer Name</label>
    <div class="col-sm-7">
	
	
	
					 <input type="hidden" name="type"    value="tenant"  class="form-control">
					 <input type="hidden" name="view"    value="admin/allocate?randomitemidentifier=<?php echo $houseno ?>&randomitemidentifier1=<?php echo $plotno ?>&roomidentifier=<?php echo $roomidentifier ?>"  class="form-control">

	
				 <input type="hidden" name="img_id"    value="<?php echo set_value('img_id', $imgid); ?>"  class="form-control">

	<input type="hidden" name="action" value="<?php echo set_value('action','insert'); ?>"id="action" class="form-control" required placeholder="Enter action">
	<input type="hidden" name="transactionid" value="<?php echo set_value('transactionid',$transactionid); ?>"id="transactionid" class="form-control" required placeholder="Enter transactionid">

		  		<input type="text" name="firstname" value="<?php echo set_value('firstname'); ?>"id="firstname" class="form-control" required placeholder="Enter customer name">
     <span class="text-danger"><?php echo form_error('firstname'); ?></span>
   </div>
  </div>
    <div class="form-group" style="display:none">
    <label for="inputlastname" class="col-sm-2 control-label">Last Name</label>
    <div class="col-sm-7">
		<input type="text" name="lastname" value="<?php echo set_value('lastname') ;?>" id="lastname" class="form-control"  placeholder="Enter lastname">
       <span class="text-danger"><?php echo form_error('lastname'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputphone3" class="col-sm-2 control-label">Id Number </label>
    <div class="col-sm-7">
				<input type="phone" name="idno" value="<?php echo set_value('idno'); ?>" id="idno" class="form-control"  placeholder="Enter ID NO">
    <span class="text-danger"><?php echo form_error('idno'); ?></span>
   </div>
  </div>
  
	
   
		
 
  <div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">Phone Number</label>
    <div class="col-sm-7">
				<input type="text" name="phone" value="<?php echo set_value('phone'); ?>" id="phone" class="form-control"  placeholder="Enter Your phone">
        <span class="text-danger"><?php echo form_error('phone'); ?></span>
	</div>
  </div>
  
  	  <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">Gender</label>
		                    <div class="col-sm-7">
		                        <select name="gender"  class="form-control" id="section_selector_holder">
		                            <option value="" selected>--Select Gender--</option>
			                         <option value="Male">Male</option>
									   <option value="Female">Female</option>
			                    </select>
							 <span class="text-danger"><?php echo form_error('gender'); ?></span>

			                </div>
	</div>			
     <div class="form-group">
    <label for="inputlocation" class="col-sm-2 control-label">Company</label>
    <div class="col-sm-7">
				<input type="text" name="location" value="<?php echo set_value('location') ;?>" id="exampleInputlocation" class="form-control"  placeholder="Enter Your company/business name">
    <span class="text-danger"><?php echo form_error('location'); ?></span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputEmail" class="col-sm-2 control-label">Email</label>
    <div class="col-sm-7">
				<input type="email" name="email" value="<?php echo set_value('email') ;?>" id="exampleInputEmail" class="form-control"  placeholder="Enter Your email">
    <span class="text-danger"><?php echo form_error('email'); ?></span>
	</div>
  </div>

 
<div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">Country</label>
		                    <div class="col-sm-7">
		                        <select name="country" class="form-control" id="section_selector_holder">
		                            <option value="">--Select Country--</option>
									   <?php
									$country = $this->accomodationmodel->populateallcountries();


if(is_array($country)) {

   foreach($country as $countryrow){

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

   
    <?php

}} else {
    echo 'There is no other  country for this house.... Please add country first.';
}

?>
			                        
			                    </select>
								     <span class="text-danger"><?php echo form_error('country'); ?></span>
			                </div>
	</div>
	
	
	 <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">County</label>
		                    <div class="col-sm-7">
		                        <select name="county" class="form-control" id="section_selector_holder">
		                            <option selected="select" value="">--Select County--</option>
									   <?php
									$county = $this->accomodationmodel->populateallallacounties();


if(is_array($county)) {

   foreach($county as $countyrow){

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

   
    <?php

}} else {
    echo 'There is no other  county for this house.... Please add county first.';
}

?>
			                        
			                    </select>
								     <span class="text-danger"><?php echo form_error('county'); ?></span>
			                </div>
	</div>
	
	
		
			
	
	
	
	
	
		
		
		
		
		
	   <div class="form-group">
    <label for="inputphone3" class="col-sm-2 control-label">Entry Date </label>
    <div class="col-sm-7">
				<input type="phone" name="entrydate" value="<?php echo set_value('entrydate',$date); ?>" id="idno" class="form-control"  placeholder="Enter Entry date">
    <span class="text-danger"><?php echo form_error('entrydate'); ?></span>
   </div>
  </div>
  	  <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">House Status</label>
		                    <div class="col-sm-7">
		                        <select name="status" required class="form-control" id="section_selector_holder">
		                            <option value="" >--Select Status--</option>
			                         <option selected="selected"value="active">active</option>
									   <option value="inactive">inactive</option>
			                    </select>
							 <span class="text-danger"><?php echo form_error('gender'); ?></span>

			                </div>
	</div>
	
	 <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label"> photo</label>
		                    <div class="col-sm-7">
		                      		<input type="file" name="photo" width="400"  value="<?php echo set_value('photo') ;?>" placeholder="Select Image"  class="form-control"  >

							 <span class="text-danger"><?php echo form_error('photo'); ?></span>

			                </div>
	</div>
	
	
	

   <div class="form-group">
    <label for="inputphone3" class="col-sm-2 control-label">Description </label>
    <div class="col-sm-7">
	<textarea name="description" id="ttt" rows="5" placeholder="Add any description/comment" class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
  
  
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	       <button type="submit" name="btn_tenant"value="tenant" class="btn btn-primary">Add Customer</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('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="&randomitemidentifier1=">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/allocate?randomitemidentifier=<?php echo $houseno ?>&randomitemidentifier1=<?php echo $plotno ?>&roomidentifier=<?php echo $roomidentifier ?>">
 <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="<?php echo $houseno;?>">

          <input type="hidden" id="plotno1"name="plotno" class="form-control" placeholder="plotno"  value="<?php echo $plotno;?>">
 <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>
	
	

			