
  <div class="container-fluid">
 
 <div class="row">

						<div class="col-md-12">
  
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
				User Details
            	</div>
            </div>
			<div class="panel-body">

			
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
							
					
	
				<?PHP
 echo $this->session->flashdata('msg'); 
		?>
		
		
			<?PHP
				$session_data = $this->session->userdata('adminlogged_in');


		
                 echo form_open('admin/adduser' , 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-10">

		  		<input type="text" name="firstname" value="<?php echo set_value('firstname'); ?>"id="firstname" class="form-control" required placeholder="Enter your First Name">
		 
				
		<span class="text-danger"> 	Enter firs two names  here..<?php echo form_error('firstname'); ?>
		
		</span>
	</div>
  </div>	

	<div class="form-group">
    <label for="inputsurname" class="col-sm-2 control-label">	 Surname</label>
    <div class="col-sm-10">
		
				<input type="text" name="surname" value="<?php echo set_value('surname') ;?>" id="surname" class="form-control" required placeholder="Enter Your Surname">

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

  

	<div class="form-group">
    <label for="inputusername" class="col-sm-2 control-label">		Username</label>
    <div class="col-sm-10">

<input type="text" name="username" value="<?php echo set_value('username'); ?>" id="username" class="form-control" required placeholder="e.g.  james">
			
		<span class="text-danger"> Enter Correct username<?php echo form_error('username'); ?>
		
		</span>
	</div>
  </div>
  		<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">	Phone Number</label>
    <div class="col-sm-10">

				<input type="text" name="phone" value="<?php echo set_value('phone'); ?>" id="phone" class="form-control" required placeholder="e.g.  072382345">
			
		<span class="text-danger"> Enter Correct phone Number<?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
	
	
	
	<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">	Id Number</label>
    <div class="col-sm-10">

				<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" id="idno" class="form-control" required placeholder="e.g.  45782345">
			
		<span class="text-danger"> Enter Correct National ID Number /Passport / Birth Certificate Number<?php echo form_error('idno'); ?>
		
		</span>
	</div>
  </div>
	
	
		<div class="form-group">
    <label for="inputusername" class="col-sm-2 control-label">	Email</label>
    <div class="col-sm-10">

				<input type="text" name="email" value="<?php echo set_value('email'); ?>" id="email" class="form-control" required placeholder="e.g someone@jkuat.ac.ke">
			
		<span class="text-danger"> Enter Correct Email <?php echo form_error('email'); ?>
		
		</span>
	</div>
  </div>
	
	
		
    
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
     <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label"> Status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status">
	
			
				<option value="active">active</option>
				<option value="inactive" > inactive </option>
				<option value="Other" >Other</option>
				
				</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>
  
  
  	<div class="form-group">
    <label for="inputpassword" class="col-sm-2 control-label">	Password</label>
    <div class="col-sm-10">

		  		<input type="password" name="password" value="<?php echo set_value('password'); ?>"id="firstname" class="form-control" required placeholder="Update password">
		 
				
		<span class="text-danger"> You can update password  here..<?php echo form_error('password'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit" name="btn_adduser" value="user" class="btn btn-success"> Update/Save data  </button>

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

$admin = $this->adminusermodel->populateusers();

if(is_array($admin)) {
?>


 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >

  <tr>

    <th> Names</th>

    <th>Username</th>    

    <th>Phone </th>   

    <th>Email </th> 

    
 

    <th>Action</th>    

  </tr>
  
  <?php

   foreach($admin as $row){

  echo "<tr>";

    $id=$row->id ;

    echo "<td>". $row->surname ." ".$row->firstname ."</td>";

    echo "<td>". $row->username ."</td>";
      echo "<td>". $row->phone ."</td>";  
       echo "<td>". $row->email ."</td>";
          
               
      echo "<td>";
	  ?>
	                       <a  class="btn btn-success"  id="more" href="<?php echo base_url();?>administrator/welcome?randomitemidentifier=<?php   {echo  $id;}  ?>">Update  </a>

						   
						   <?php
	  
	  echo"</td>";

 
  echo "</tr>";    
}
 echo "</table>";   



} else {
    echo 'There is no user data available.... try again.';
}






?>

							
						</div>
					</div>

					
			
			</div>
		</div>
  
  </div>
 
</div>




















































