|
Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/indolok.id/application/views/admin/user/ |
Upload File : |
<div class="modal-header">
<p><a href="<?= base_url('admin/user'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Users Page</a></p><br>
<h3><?= empty($user->id) ? 'Add a new user' : 'Edit user: '
. $user->name; ?></h3>
</div>
<div class="modal-body">
<?= form_open(); ?>
<table class="table">
<tr>
<td>Name</td>
<td><?= form_input('name' , set_value('name', $user->name), 'class="form-control"'); ?>
<?= form_error('name'); ?>
</td>
</tr>
<tr>
<td>Role</td>
<td>
<p>
<?php
/* $options = array(
'admin' => 'Admin',
'apoteker' => 'Apoteker',
'kepala apoteker' => 'Kepala Apoteker',
'director' => 'Director',
'finance' => 'Finance',
'purchasing' => 'Purchasing',
'requester po' => 'Requester PO',
); */
$options = array(
'marketing' => 'Marketing',
);
if($role == 'super admin') {
$options['super admin'] = 'Super Admin';
}
echo form_dropdown('role', $options, $user->role, 'class="form-control role"'); ?>
</p>
<?= form_error('role'); ?>
</td>
</tr>
<tr id="warehouseBlock">
<td>Warehouse</td>
<td><p>
<?php
$options = array(
'' => 'Choose warehouse...'
);
//get all warehouse
$this->db->select('id, name')->from('warehouse')->order_by('id', 'ASC');
$warehouses = $this->db->get()->result();
foreach ($warehouses as $item) {
$options[$item->id] = $item->name;
}
echo form_dropdown('warehouse_id', $options, $user->warehouse_id, 'class="form-control warehouse"');
?>
</p>
<?= form_error('warehouse_id'); ?>
</td>
</tr>
<tr>
<td>Email</td>
<td>
<?= form_input('email', set_value('email', $user->email), 'class="form-control"'); ?>
<?= form_error('email'); ?>
</td>
</tr>
<tr>
<td>Password</td>
<td>
<?= form_password('password','','class="form-control"'); ?>
<?= form_error('password'); ?>
</td>
</tr>
<tr>
<td>Confirm Password</td>
<td>
<?= form_password('password_confirm', '', 'class="form-control"'); ?>
<?= form_error('password_confirm'); ?>
</td>
</tr>
<tr>
<td></td>
<td>
<?= form_submit('submit', 'Enter', 'class="btn btn-primary btn-success "'); ?>
</td>
</tr>
</table>
<?= form_close(); ?>
</div>
<script>
$(document).ready(function() {
$('#warehouseBlock').hide();
if($('.role').val() == 'apoteker') {
$('#warehouseBlock').show();
}
$(document).on('change', '.role', function() {
// Does some stuff and logs the event to the console
if($('.role').val() == 'apoteker') {
$('#warehouseBlock').show();
} else {
$('#warehouseBlock').hide();
}
});
});
</script>