ci3-app/application/views/dashboard/v_pengguna_tambah.php
2025-04-27 07:06:24 +07:00

102 lines
7.0 KiB
PHP
Executable File

<div class="content-wrapper">
<section class="content-header">
<h1>
Pengguna
<small>Tambah Pengguna</small>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-lg-6">
<a href="<?php echo site_url('dashboard/pengguna'); ?>" class="btn btn-sm btn-primary">
<i class="fa fa-arrow-left"></i> Kembali
</a>
<br/><br/>
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">Tambah Pengguna</h3>
</div>
<div class="box-body">
<?php echo form_open('dashboard/pengguna_aksi', ['enctype' => 'multipart/form-data']); ?>
<div class="box-body">
<!-- CSRF Protection -->
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
<div class="form-group">
<label>Nama</label>
<input type="text" name="nama" class="form-control" placeholder="Masukkan nama pengguna .." value="<?php echo set_value('nama'); ?>" required>
<small class="text-danger"><?php echo form_error('nama'); ?></small>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="email" class="form-control" placeholder="Masukkan email pengguna .." value="<?php echo set_value('email'); ?>" required>
<small class="text-danger"><?php echo form_error('email'); ?></small>
</div>
<div class="form-group">
<label>Username</label>
<input type="text" name="username" class="form-control" placeholder="Masukkan username pengguna.." value="<?php echo set_value('username'); ?>" required>
<small class="text-danger"><?php echo form_error('username'); ?></small>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" class="form-control" placeholder="Masukkan password pengguna.." required>
<small class="text-danger"><?php echo form_error('password'); ?></small>
</div>
<div class="form-group">
<label>Gambar Sampul</label>
<input type="file" name="sampul" required>
<p class="help-block">Silakan upload Gambar...!</p>
<?php if(isset($gambar_error)): ?>
<div class="text-danger"><?php echo $gambar_error; ?></div>
<?php endif; ?>
<?php echo form_error('sampul', '<div class="text-danger">', '</div>'); ?>
</div>
<div class="form-group">
<label for="level">Level</label>
<select id="level" class="form-control" name="level" required>
<option value="">- Pilih Level -</option>
<option value="admin" <?php echo set_select('level', 'admin'); ?>>Admin</option>
<option value="satker" <?php echo set_select('level', 'satker'); ?>>SATKER</option>
</select>
<small class="text-danger"><?php echo form_error('level'); ?></small>
</div>
<div class="form-group" id="satker-select" style="display: none;">
<label>Nama Satker</label>
<select class="form-control" name="satker_id">
<option value="">- Pilih Satker -</option>
<?php if (!empty($satkers)): ?>
<?php foreach ($satkers as $satker): ?>
<option value="<?php echo $satker->satker_id; ?>" <?php echo set_select('satker_id', $satker->satker_id); ?>><?php echo $satker->nama_satker; ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
<small class="text-danger"><?php echo form_error('satker_id'); ?></small>
</div>
<div class="form-group">
<label>Status</label>
<select class="form-control" name="status" required>
<option value="">- Pilih Status -</option>
<option value="1" <?php echo set_select('status', '1'); ?>>Aktif</option>
<option value="0" <?php echo set_select('status', '0'); ?>>Non-Aktif</option>
</select>
<small class="text-danger"><?php echo form_error('status'); ?></small>
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success">Simpan</button>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</section>
</div>