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/laciasmara.com/public_html/shop/application/views/admin_new/settings/users/ |
Upload File : |
<div class="container mx-auto px-4 py-4"> <div class="flex justify-between items-center mb-4"> <h1 class="text-xl font-bold text-[#333]">Pengaturan User Admin</h1> <button type="button" id="btnAddUser" class="px-4 py-2 bg-[#7A4397] text-white rounded-lg hover:bg-[#7A4397]"> + Tambah User </button> </div> <?php if ($this->session->flashdata('message')): ?> <div class="mb-4 alert flex items-center justify-between bg-<?php echo $this->session->flashdata('message_type') === 'success' ? 'green' : 'red'; ?>-100 border-l-4 border-<?php echo $this->session->flashdata('message_type') === 'success' ? 'green' : 'red'; ?>-500 text-<?php echo $this->session->flashdata('message_type') === 'success' ? 'green' : 'red'; ?>-800 px-6 py-4 rounded-lg shadow-lg transition transform duration-300"> <div class="flex items-center"> <i data-feather="<?php echo $this->session->flashdata('message_type') === 'success' ? 'check-circle' : 'x-circle'; ?>" class="h-6 w-6 mr-3"></i> <span class="font-semibold"><?php echo $this->session->flashdata('message'); ?></span> </div> <button class="ml-4 text-<?php echo $this->session->flashdata('message_type') === 'success' ? 'green' : 'red'; ?>-500 hover:text-<?php echo $this->session->flashdata('message_type') === 'success' ? 'green' : 'red'; ?>-700 focus:outline-none" onclick="this.parentElement.style.display='none'"> <i data-feather="x" class="h-5 w-5"></i> </button> </div> <?php endif; ?> <div class="bg-white rounded-lg shadow-md overflow-hidden mb-6"> <div class="p-4 bg-white border-b"> <h2 class="text-lg font-medium text-[#333]">Daftar User</h2> <p class="text-sm text-gray-500">User yang bisa masuk ke admin laciasmara</p> </div> <?php if (empty($users)): ?> <div class="p-8 text-center text-gray-500"> <svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto mb-4 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /> </svg> <p class="mb-2">Belum ada user yang ditambahkan</p> <a href="<?= base_url('admin/settings/users/add') ?>" class="text-blue-600 hover:text-blue-800 font-medium">Tambah User Sekarang</a> </div> <?php else: ?> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">User</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Role</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <?= $this->session->userdata('role') == 'super_admin' ? '<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">Aksi</th>' : '' ?> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200"> <?php foreach ($users as $user): ?> <tr class="hover:bg-gray-50" data-id="<?= $user->id ?>"> <td class="px-6 py-4"> <div class="text-sm text-gray-900"><?= $user->name ?></div> <?php if (!empty($user->name)): ?> <div class="text-sm text-gray-500"> Email: <?= $user->email ?> </div> <?php endif; ?> </td> <td class="px-6 py-4"> <div class="text-sm text-gray-900"><?= $user->role ?></div> </td> <td class="px-6 py-4 whitespace-nowrap"> <?php if ($user->status == 'active'): ?> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"> Aktif </span> <?php else: ?> <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800"> Nonaktif </span> <?php endif; ?> </td> <?php if ($this->session->userdata('role') == 'super_admin'): ?> <td class="px-4 py-3 whitespace-nowrap text-center text-sm font-medium"> <a href="<?= base_url('admin/settings/users/edit/' . $user->id) ?>" class="text-blue-600 hover:text-blue-900 mr-3">Edit</a> </td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php endif; ?> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const CSRF_TOKEN = "<?= $this->security->get_csrf_token_name(); ?>"; const CSRF_HASH = "<?= $this->security->get_csrf_hash(); ?>"; document.getElementById('btnAddUser').addEventListener('click', function() { window.open('<?= base_url('admin/settings/users/add') ?>', '_blank'); }); }); </script>