



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





				<?PHP
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('addagent' , 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 placeholder="Enter action">

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

    <label for="inputfirstname" class="col-sm-2 control-label">First Name</label>
    <div class="col-sm-7">
		  		<input type="text" name="firstname" value="<?php echo set_value('firstname',$agent[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',$agent[0]['lastname']) ;?>" id="lastname" class="form-control" required 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">Location</label>
    <div class="col-sm-7">
				<input type="text" name="location" value="<?php echo set_value('location',$agent[0]['location']) ;?>" id="exampleInputlocation" class="form-control" required placeholder="Enter Your location">
    <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',$agent[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',$agent[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="phone" name="idno" value="<?php echo set_value('idno',$agent[0]['idno']); ?>" id="idno" class="form-control"  placeholder="Enter IDNO">
    <span class="text-danger"><?php echo form_error('idno'); ?></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= $agent[0]['country'];
$country = $this->adminusermodel->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  value="">--Select Country--</option>
<?php
}
 
								
$country = $this->adminusermodel->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">County</label>
		                    <div class="col-sm-7">
		                        <select name="county" class="form-control" id="section_selector_holder">

								  
								 
								  	<?php
									
									
												
 $Countyid= $agent[0]['county'];
$county = $this->adminusermodel->getcountybyid($Countyid);


if(is_array($county)) {

   foreach($county as $countyrow){

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

   
    <?php

}} else {
    ?>
			                            <option  value="">--Select County--</option>
<?php

	}							
$county = $this->adminusermodel->populateallallacounties();


if(is_array($county)) {

   foreach($county as $countyrow){

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

   
    <?php

}} else {
    echo 'There is no other  county selected.... Please add county first.';
}

?>
			  
		                       
			                        
			                    </select>
								     <span class="text-danger"><?php echo form_error('county'); ?></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="<?= $agent[0]['gender']  ?>"><?= $agent[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="inputaccountname" class="col-sm-2 control-label">Account Name</label>
    <div class="col-sm-7">
				<input type="accountname" name="accountname" value="<?php echo set_value('accountname',$agent[0]['accountname']); ?>" id="accountname" class="form-control"  placeholder="Enter account name">
    <span class="text-danger"><?php echo form_error('accountname'); ?></span>
   </div>
  </div>
  
  
    
   <div class="form-group">
    <label for="inputaccountno" class="col-sm-2 control-label">Account Number</label>
    <div class="col-sm-7">
				<input type="accountno" name="accountno" value="<?php echo set_value('accountno',$agent[0]['accountno']); ?>" id="accountno" class="form-control"  placeholder="Enter  account number">
    <span class="text-danger"><?php echo form_error('accountno'); ?></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('description',$agent[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_agent"value="agent" class="btn btn-primary">Update Agent</button>

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





