
		
<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>
				Update this Charge
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('addplotcharge' , 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="inputhouseno" class="col-sm-2 control-label">Plot Number</label>
    <div class="col-sm-7">
				  		<input type="hidden" name="id" value="<?php echo set_value('plotno',$charge[0]['id']); ?>"id="houseno" class="form-control" required placeholder="Enter plot number">

			  		<input type="text" name="plotno" value="<?php echo set_value('plotno',$charge[0]['plotno']); ?>"id="houseno" class="form-control" required placeholder="Enter plot number">

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

     <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">Charge Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="chargeid" class="form-control" required>


		<?php 
   $chargid = $this->accomodationmodel->getchargesbyid($charge[0]['chargeid']);
								


if(is_array($chargid)) {

   foreach($chargid as $chargidrow){

 
   ?>
	    <option selected="selected"value="<?php echo set_value('chargeid',$chargidrow->id); ?> "><?=$chargidrow->type?></option>

   
    <?php

}} else {
    echo 'There is no charge in the system.... try again.';
}


	$charges = $this->accomodationmodel->getplotcharges($charge[0]['plotno']);
if(is_array($charges)) {

   foreach($charges as $chargesrow){

   $chargesrowid=$chargesrow->chargeid;

  
    $chargesbyid = $this->accomodationmodel->getchargesbyid($chargesrowid);
								


if(is_array($chargesbyid)) {

   foreach($chargesbyid as $chargesbyidrow){

 
   ?>
	    <option value="<?php echo set_value('chargeid',$chargesbyidrow->id); ?> "><?=$chargesbyidrow->type?></option>

   
    <?php

}} else {
    echo 'There is no charge in the system.... try again.';
}
   
    

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

?>
	</select>
				

	  <span class="text-danger"><?php  echo form_error('amount'); ?></span>
	</div>
  </div>			
  
 <div class="form-group">
    <label for="inputcost" class="col-sm-2 control-label">Amount</label>
    <div class="col-sm-7">
				<input type="text" name="cost" value="<?php echo set_value('cost',$charge[0]['cost']); ?>" id="cost" class="form-control" required placeholder="Enter cost of the charge">
        <span class="text-danger"><?php echo form_error('cost'); ?></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 selected="selected" value="<?php echo $charge[0]['status']; ?>"><?php  echo $charge[0]['status']; ?> </option>
		                            <option value="">--Select status--</option>
			                         <option  value="active">active</option>
									   <option value="inactive">inactive</option>
			                    </select>
								     <span class="text-danger"><?php echo form_error('status'); ?></span>
			                </div>
	</div>
					
  
  
  

  <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">Update All Houses?</label>
		                    <div class="col-sm-7">
		                        <select name="allhouses"  required class="form-control" id="allhouses">
		                            <option value="" selected="selected">--Do you want to update all existing houses in this plot with the new charge?--</option>
			                         <option  value="no">No</option>
									   <option value="yes">Yes</option>
			                    </select>
								     <span class="text-danger"><?php echo form_error('allhouses'); ?></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 set_value('description',$charge[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_charge"value="charge" class="btn btn-primary">Update Charge</button>

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