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

<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#list" data-toggle="tab"><i class="entypo-menu"></i> 
					Edit this Bookings 
                    	</a></li>
						<li>
            									 <a href="<?php echo base_url(); ?>admin/viewpallmyplots">Back Home </a>


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





		
<div class="row">
	<div class="col-md-12">
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
				Edit this Booking
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('addrentbooking' , 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">
  		<input type="hidden" name="action" value="<?php echo set_value('action','update'); ?>"id="action" class="form-control" required >

		<input type="hidden" name="id" value="<?php echo set_value('id',$booking[0]['id']); ?>"id="bookingno" class="form-control" required placeholder="Enter booking number">

    <label for="inputhouseno" class="col-sm-2 control-label">Room Number</label>
    <div class="col-sm-7">
		<input type="text" readonly name="houseno" value="<?php echo set_value('houseno',$booking[0]['houseno']); ?>"id="bookingno" class="form-control" required placeholder="Enter booking number">


     <span class="text-danger"><?php echo form_error('houseno'); ?></span>
   </div>
  </div>
  <div class="form-group">

    <label for="inputplotno" class="col-sm-2 control-label">House Number</label>
    <div class="col-sm-7">
			  		<input type="text" readonly name="plotno" value="<?php echo set_value('plotno',$booking[0]['plotno']); ?>" id="bookingno" class="form-control" required placeholder="Enter booking number">


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



  
  
  
    <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Customer Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="tenantid"  class="chzn-select" required>
<option value="" >---Select Customer for allocation---</option>

		<?php 


	$tenantid=$booking[0]['tenantid'];
		   $tenants = $this->accomodationmodel->gettenantbyid($tenantid);
								


if(is_array($tenants)) {

   foreach($tenants as $tenantsrow){
	     $names= $tenantsrow->lastname. "  ".$tenantsrow->firstname ; 
	   ?>
	    <option  selected="selected" value="<?php echo set_value('tenant',$tenantsrow->id); ?> "><?=$tenantsrow->lastname." ".$tenantsrow->firstname." IDNO ".$tenantsrow->idno;?></option>

					<?php

 
    

}} else {
    


						

} 


if(is_array($tenant)) {

   foreach($tenant as $tenantrow){

    ?>
	    <option value="<?php echo set_value('tenant',$tenantrow->id); ?> "><?=$tenantrow->lastname." ".$tenantrow->firstname." IDNO ".$tenantrow->idno;;?></option>

   
    <?php

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

?>
	</select>
				

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

  
  <div class="form-group">
    <label for="inputtotalamount" class="col-sm-2 control-label">Current Balance</label>
    <div class="col-sm-7">
				<input type="text" name="totalamount" value="<?php echo set_value('totalamount',$booking[0]['totalamount']); ?>" id="idno" class="form-control" required placeholder="Enter total balance">
        <span class="text-danger"><?php echo form_error('totalamount'); ?></span>
	</div>
  </div>
				
  
  
    
  <div class="form-group">
    <label for="inputoverpayment" class="col-sm-2 control-label">Over payment</label>
    <div class="col-sm-7">
				<input type="text" name="overpayment" value="<?php echo set_value('overpayment',$booking[0]['overpayment']); ?>" id="idno" class="form-control" required placeholder="Enter total over payment">
        <span class="text-danger"><?php echo form_error('overpayment'); ?></span>
	</div>
  </div>
				
  
  
    <div class="form-group">
    <label for="inputdeposite" class="col-sm-2 control-label">Deposite payment</label>
    <div class="col-sm-7">
				<input type="text" name="deposite" value="<?php echo set_value('deposite',$booking[0]['deposite']); ?>" id="idno" class="form-control" required placeholder="Enter total deposite payment">
        <span class="text-danger"><?php echo form_error('deposite'); ?></span>
	</div>
  </div>
			
  
  
   <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Entry Date</label>
    <div class="col-sm-7">
				<input type="text" name="entrydate" value="<?php echo set_value('entrydate',$booking[0]['entrydate']); ?>" id="idno" class="form-control" required placeholder="Enter Start 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">Status</label>
		                    <div class="col-sm-7">
		                        <select name="status" class="form-control" id="section_selector_holder">
		        	 <option value="<?=$booking[0]['status']  ?>"><?=$booking[0]['status']  ?></option>

									<option value="">--Select status--</option>
			                         <option value="active">active</option>
									   <option value="inactive">Check out</option>
			                    </select>
							 <span class="text-danger"><?php echo form_error('status'); ?></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 Description" class="form-control"><?php echo $booking[0]['description']; ?></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-7">
     
	       <button type="submit" name="btn_booking" value="booking" class="btn btn-primary">Update Allocation</button>

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


   </div>
</div>




			