<!-- Begin Page Content -->
<div class="container-fluid mb-5">
    <div class="row">
        <div class="col-12 col-md-6">
            <div class="card">
                <div class="card-header">
                    <h4 class="text-gray-800">Form Data Pengguna</h4>
                </div>
                <div class="card-body">
                    <form enctype="multipart/form-data" method="post" action="">
                        <input type="hidden" name="id" value="<?php echo $id; ?>" />
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label">Nama Lengkap</label>
                            <div class="col-sm-9">
                                <input required type="text" name="nama_lengkap" class="form-control" id="" placeholder="" value="<?php echo $fetch['nama_lengkap']; ?>">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label">Username</label>
                            <div class="col-sm-9">
                                <input required type="text" name="username" class="form-control" id="" placeholder="" value="<?php echo $fetch['username']; ?>">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label">Password</label>
                            <div class="col-sm-9">
                                <input <?php if (empty($id)) { ?>required<?php } ?> type="password" name="password" class="form-control" id="" placeholder="<?php if ($id) { ?>Kosongkan apabila tidak ingin diperbarui<?php } ?>" value="">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label">Alamat</label>
                            <div class="col-sm-9">
                                <input type="text" name="alamat" class="form-control" id="" placeholder="" value="<?php echo $fetch['alamat']; ?>">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label">No Telp</label>
                            <div class="col-sm-9">
                            <input type="number" id="no_telp" name="no_telp" maxlength="12" pattern="\d{12}" inputmode="numeric" title="Harap masukkan 12 digit angka" value="<?php echo $d['no_telp']; ?>">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label">Role</label>
                            <div class="col-sm-9">
                                <select class="form-control" name="role">
                                    <option <?php if ($fetch['role'] == 'admin') {
                                                echo "selected";
                                            } ?> value="admin">Admin</option>
                                    <option <?php if ($fetch['role'] == 'user') {
                                                echo "selected";
                                            } ?> value="user">User</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="" class="col-sm-3 col-form-label"></label>
                            <div class="col-sm-9">
                                <button class="btn btn-md btn-warning">Simpan</button>
                                <a href="<?php echo base_url(); ?>dashboard/daftar_pengguna" class="btn btn-md btn-danger">Batal</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /.container-fluid -->