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/rabbithabit.com/public_html/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> Kembali ke halaman pengguna</a></p><br> <h3><?= empty($user->id) ? 'Tambah Pengguna baru' : 'Edit Pengguna: ' . $user->name; ?></h3> </div> <div class="modal-body"> <?= form_open(); ?> <table class="table"> <tr> <td>Nama</td> <td><?= form_input('name' , set_value('name', $user->name), 'class="form-control"'); ?> <?= form_error('name'); ?> </td> </tr> <tr style="display:none;"> <td>Role</td> <td> <p> <?php $options = array( 'super admin' => 'Super Admin' // 'admin' => 'Admin', // 'apoteker' => 'Apoteker', // 'kepala apoteker' => 'Kepala Apoteker', // 'director' => 'Director', // 'finance' => 'Finance', // 'purchasing' => 'Purchasing', // 'requester po' => 'Requester PO', ); 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>Gudang</td> <td><p> <?php $options = array( '' => 'Pilih Gudang...' ); //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>E-mail</td> <td> <?= form_input('email', set_value('email', $user->email), 'class="form-control"'); ?> <?= form_error('email'); ?> </td> </tr> <tr> <td>Kata Sandi</td> <td> <?= form_password('password','','class="form-control"'); ?> <?= form_error('password'); ?> </td> </tr> <tr> <td>Konfirmasi Kata Sandi</td> <td> <?= form_password('password_confirm', '', 'class="form-control"'); ?> <?= form_error('password_confirm'); ?> </td> </tr> <tr> <td></td> <td> <?= form_submit('submit', 'Simpan', '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>