<link href="<?php echo base_url(); ?>/public/admin/css/essentials.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>/public/admin/css/layout.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>/public/admin/css/color_scheme/green.css" rel="stylesheet" type="text/css" id="color_scheme" />
<link href="<?php echo base_url(); ?>/public/admin/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8" >
<title>Skills for Africa - Update user</title>
								<!-- Section -->
        <div class="col-12 info">
        	<center>
	        <?php if($saved){
	         if($success>0){ ?>
	          <center>&#9432; User updated</center>
	         <?php }else{ ?>
	         <center>&#xf071; Failed.<?php echo $message ; ?>  </center>
	        <?php }} ?>
	        </center>
	    </div>

<div class="padding-5">
			<div class="login-box">
				<form action="<?php echo base_url('updateuser') ; ?>" method="post" class="sky-form boxed" novalidate="novalidate">
					<header><i class="fa fa-users"></i> Update Account </header>
					
					<fieldset>	
					<label class="input">
						<i class="icon-append fa fa-envelope"></i>
						<input type="email" name="email" id="email" value="<?php echo  $user['email'] ;     ?>" placeholder="Email" readonly/>
						<b class="tooltip tooltip-bottom-right">Needed to verify your email</b>
					</label>				
						<label class="input">
							<i class="icon-append fa fa-user"></i>
							<input type="hidden" name="userid"  value="<?php echo $user['userID'] ; ?>">
							<b class="tooltip tooltip-bottom-right">Needed to verify your account</b>
						</label>
					
						<label class="input">
							<i class="icon-append fa fa-lock"></i>
							<input type="password" name="pass" id="pass" value="" placeholder="Password" />
							<b class="tooltip tooltip-bottom-right">Only latin characters and numbers</b>
						</label>
					
						<label class="input">
							<i class="icon-append fa fa-lock"></i>
							<input type="password" name="passcon" id="passcon" value="" placeholder="Confirm Password" />
							<b class="tooltip tooltip-bottom-right">Only latin characters and numbers</b>
						</label>
					</fieldset>
						
					<fieldset>
						<div class="row">
							<div class="col-md-6">
								<label class="input">
									<input type="text" class="form-control" name="fname" id="fname" value="<?php echo  $user['firstName'] ; ?>" placeholder="First Name" required/>
								</label>
							</div>
							<div class="col col-md-6">
								<label class="input">
									<input type="text" class="form-control" name="sname" id="sname" value="<?php echo  $user['secondName'] ;     ?>" placeholder="Second Name" required/>
								</label>
							</div>
						</div>
					</fieldset>
					<?php
					 $session = \Config\Services::session();
  $userType = $session->get('userType');
					if($userType==1){
					 ?>
<div class="form-group">
<div class="">
						<select name="usertype" id="demo-category" class="form-control" required>
							<option value="">- User Type -</option>
							<option value="1"  <?php if($user['userType']==1){echo 'SELECTED';}           ?>  >Admin</option>
							<option value="4" <?php if($user['userType']==4){echo 'SELECTED';}           ?>>User</option>

						</select>
					</div>
				</div>
				<?php } ?>

					<footer>
						<button type="submit" class="btn btn-primary pull-right"><i class="fa fa-check"></i> Update Account</button>
					</footer>
				</form>
			</div>
		</div>