<form action="../config/tambah.php" method="post" enctype="multipart/form-data">
  <div class="card-body">
    <div class="form-group row">
      <label for="id" class="col-sm-2 col-form-label">ID</label>
      <div class="col-sm-10">
        <input type="text" name="id" id="id" class="form-control" placeholder="ID" required>
      </div>
    </div>
    
    <div class="form-group row">
      <label for="username" class="col-sm-2 col-form-label">Username</label>
      <div class="col-sm-10">
        <input type="text" name="username" id="username" class="form-control" placeholder="username" required>
      </div>
    </div>
    
    <div class="form-group row">
      <label for="nama" class="col-sm-2 col-form-label">Nama</label>
      <div class="col-sm-10">
        <input type="text" name="nama" id="nama" class="form-control" placeholder="nama" required>
      </div>
    </div>
    
    <div class="form-group row">
      <label for="password" class="col-sm-2 col-form-label">Password</label>
      <div class="col-sm-10">
        <input type="password" name="password" id="password" class="form-control" placeholder="Kosongkan Jika Tidak Diganti">
      </div>
    </div>
    
    <div class="form-group row">
      <label for="role" class="col-sm-2 col-form-label">Role</label>
      <div class="col-sm-10">
        <select name="role" id="role" class="form-control" required>
          <option value="">-- Pilih Role --</option>
          <?php
          // Fetch roles from database
          $roles_query = mysqli_query($conn, "SELECT * FROM roles");
          while ($role = mysqli_fetch_assoc($roles_query)) {
              echo '<option value="'.$role['role_id'].'">'.$role['role_name'].'</option>';
          }
          ?>
        </select>
      </div>
    </div>
    
    <div class="modal-footer justify-content-between">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      <button type="submit" class="btn btn-primary">Save changes</button>
    </div>
  </div>
</form>

