<?php
//form edit open
echo form_open(base_url('user/edit/'.$user->id));
?>


<div class="form-group row">
    <label for="nama" class="col-sm-2 col-form-label">Nama User</label>
    <div class="col-sm-9">
      <input type="text" name="nama" class="form-control" placeholder="Nama User" value="<?php echo $user->nama?>" required>
    </div>
  </div>

  <div class="form-group row">
    <label for="email" class="col-sm-2 col-form-label">Email</label>
    <div class="col-sm-9">
      <input type="email" name="email" class="form-control" placeholder="Email" value="<?php echo $user->email ?>" required>
    </div>
  </div>

  <div class="form-group row">
    <label for="userid" class="col-sm-2 col-form-label">User ID</label>
    <div class="col-sm-9">
      <input type="text" name="userid" class="form-control" placeholder="Userid" value="<?php echo $user->userid ?>" disabled>
    </div>
  </div>

  <div class="form-group row">
    <label for="password" class="col-sm-2 col-form-label">Password</label>
    <div class="col-sm-9">
      <input type="password" name="password" class="form-control" placeholder="Password" value="<?php echo set_value('password') ?>">
      <small class="text-danger">Jika akan melakukan perubahan data, password wajib diisi kembali sama atau berbeda minimal 6 karakter dan maksimal 32 karakter</small>
    </div>
  </div>

   <div class="form-group row">
    <label for="level" class="col-sm-2 col-form-label">Level Hak Akses</label>
    <div class="col-sm-9">
      <select name="level" class="form-control">
        <option value="Administrator" <?php if($user->level=="Administrator") { echo "selected"; } ?>>
        Administrator</option>
        <option value="Operator" <?php if($user->level=="Operator") { echo "selected"; } ?>>
        Operator</option>
		<option value="CS" <?php if($user->level=="CS") { echo "selected"; } ?>>
        Customer Service</option>
        <option value="Penguji" <?php if($user->level=="Penguji") { echo "selected"; } ?>>
        Penguji</option>
        <option value="Peserta" <?php if($user->level=="Peserta") { echo "selected"; } ?>>
        Peserta</option>
      </select>
    </div>
  </div>

   <div class="form-group row">
    <label for="ok" class="col-sm-2 col-form-label"></label>
    <div class="col-sm-9">
       <button type="submit" class="btn btn-primary">
          <i class="fa fa-save"></i> Simpan Data
      </button>
      <button type="reset" class="btn btn-info">
          <i class="fa fa-times"></i> Reset
      </button>
      <a href="<?php echo base_url('user') ?>" class="btn btn-default">
      	<i class="fa fa-backward"></i> Kembali      	
      </a>
    </div>
  </div>

<?php
//form close
echo form_close();
?>