<%-include('include/_header')%>

<main id="site-main">
  <div class="container">
    <div class="box-nav d-flex justify-between">
      <div class="filter">
        <a href="/"><i class="fas fa-angle-double-left"></i> Data Mahasiswa</a>
      </div>
    </div>
    <div class="form-title text-center">
      <h2 class="text-dark">Ubah Data Mahasiswa</h2>
      <span class="text-light"
        >Isilah Data di Bawah Untuk Mengubah Data Mahasiswa</span
      >
    </div>
    <!-- form handling -->
    <form method="POST" id="update_user">
      <div class="new_user">
        <div class="form-group">
          <label for="name" class="text-light">Nama Mahasiswa</label>
          <input type="hidden" name="id" value="<%= user._id %>" />
          <input type="text" name="name" value="<%= user.name %>" />
        </div>
        <div class="form-group">
          <label for="Email" class="text-light">Email Mahasiswa</label>
          <input type="text" name="email" value="<%= user.email %>" />
        </div>
        <div class="form-group">
          <label for="gender" class="text-light">Jenis Kelamin</label>
          <div class="radio inline">
            <input type="radio" id="radio-2" name="gender" value="Laki-laki" <%=
            user.gender == 'Laki-laki'?'checked':'' %>/>
            <label for="radio-2" class="radio-label">Laki-laki</label>
          </div>
          <div class="radio inline">
            <input type="radio" id="radio-3" name="gender" value="Perempuan" <%=
            user.gender == 'Perempuan'?'checked':'' %>/>
            <label for="radio-3" class="radio-label">Perempuan</label>
          </div>
        </div>

        <div class="form-group">
          <label for="gender" class="text-light">Status</label>
          <div class="radio inline">
            <input type="radio" id="radio-4" name="status" value="Aktif" <%=
            user.status == 'Aktif'?'checked':'' %>/>
            <label for="radio-4" class="radio-label">Aktif</label>
          </div>
          <div class="radio inline">
            <input type="radio" id="radio-5" name="status" value="Tidak Aktif"
            <%= user.status == 'Tidak Aktif'?'checked':'' %> />
            <label for="radio-5" class="radio-label">Tidak Aktif</label>
          </div>
        </div>
        <div class="form-group">
          <button type="submit" class="btn text-dark update">Simpan</button>
        </div>
      </div>
    </form>
  </div>
</main>

<%-include('include/_footer')%>
