



		
<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  Customer
            	</div>
            </div>
			<div class="panel-body">






				<?PHP
				echo $this->session->flashdata('msg'); 
		
                 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">First Name</label>
    <div class="col-sm-7">
		<input type="hidden" name="view" value="admin/viewalltenant"id="action" class="form-control" required placeholder="Enter action">

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

			  	
		  		<input type="text" name="firstname" value="<?php echo set_value('firstname',$tenant[0]['firstname']); ?>"id="firstname" class="form-control" required placeholder="Enter firstname">
     <span class="text-danger"><?php echo form_error('firstname'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <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',$tenant[0]['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="inputlocation" class="col-sm-2 control-label">Company</label>
    <div class="col-sm-7">
				<input type="text" name="location" value="<?php echo set_value('company',$tenant[0]['company']) ;?>" id="location" class="form-control"  placeholder="Enter Company/Business name">
    <span class="text-danger"><?php echo form_error('location'); ?></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',$tenant[0]['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="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',$tenant[0]['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="inputphone3" class="col-sm-2 control-label">Id Number </label>
    <div class="col-sm-7">
				<input type="TEXT" name="idno" value="<?php echo set_value('idno',$tenant[0]['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="inputphone3" class="col-sm-2 control-label">Pin Number </label>
    <div class="col-sm-7">
				<input type="text" name="idnumber" value="<?php echo set_value('idnumber',$tenant[0]['idnumber']); ?>" id="idno" class="form-control"  placeholder="Enter PIN NO">
    <span class="text-danger"><?php echo form_error('idnumber'); ?></span>
   </div>
  </div>
  
   <div class="form-group">
    <label for="inputaddress_1" class="col-sm-2 control-label"> Number </label>
    <div class="col-sm-7">
				<input type="text" name="address_1" value="<?php echo set_value('address_1',$tenant[0]['address_1']); ?>" id="idno" class="form-control"  placeholder="Enter Number">
    <span class="text-danger"><?php echo form_error('address_1'); ?></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">

								  
								 
								  	<?php
									
									
												
 $countryid= $tenant[0]['country'];
$country = $this->accomodationmodel->getcountrybyid($countryid);


if(is_array($country)) {

   foreach($country as $countryrow){

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

   
    <?php

}} else {
	  ?>
			                            <option selected="selected" value="">--Select Country--</option>
<?php
	
}
 							
$country = $this->accomodationmodel->populateallcountries();


if(is_array($country)) {

   foreach($country as $countryrow){

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

   
    <?php

}} else {
    echo 'There is no other  country selected.... 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">Gender</label>
		                    <div class="col-sm-7">
		                        <select name="gender" class="form-control" id="section_selector_holder">
		                        <option value="<?= $tenant[0]['gender']  ?>"><?= $tenant[0]['gender']  ?></option>

								   <option value="">--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="inputphone3" class="col-sm-2 control-label">Description </label>
    <div class="col-sm-7">
	<textarea name="description" id="ttt" rows="5" placeholder="add message" class="form-control"><?php echo set_value('comments',$tenant[0]['comments']); ?></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_tenant"value="tenant" class="btn btn-primary">Update customer</button>

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





