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/contents/pages/ |
Upload File : |
<main class="flex-1 py-4 px-4 bg-purple-50"> <div class="flex items-center mb-4"> <h1 class="text-xl font-bold text-[#333]">Halaman Statis</h1> <div class="ml-auto flex items-center gap-2"> <button type="button" id="addPage" class="border border-gray-300 text-sm rounded-lg px-4 py-2 bg-white hover:bg-gray-50 gap-4 flex items-center justify-between focus:outline-none focus:ring-1 focus:ring-[#7A4397] hover:bg-[#5a2f73] hover:bg-[#5a2f73] transition duration-300 ease-in-out text-[#333]"> <i data-feather="plus" class="h-4 w-4"></i> <span>Tambah Halaman</span> </button> </div> </div> <?php if ($this->session->flashdata('message')): ?> <div class="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; ?> <!-- Search and Filters --> <div class="mt-4 flex flex-col gap-4 sm:flex-row sm:flex-wrap text-sm"> <!-- Search --> <div class="w-full sm:flex-1 sm:min-w-[300px]"> <div class="relative"> <input id="searchInput" type="text" placeholder="Cari berdasarkan judul halaman..." class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-1 focus:ring-[#7A4397]"> <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> <svg class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /> </svg> </div> </div> </div> </div> <div class="overflow-x-auto rounded-lg shadow-lg mt-4 mb-8"> <table class="min-w-full divide-y divide-gray-200"> <thead class=" bg-gray-50"> <tr> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Judul Halaman</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Aksi</th> </tr> </thead> <tbody id="pageTableBody" class="bg-white divide-y divide-gray-200"> <?php foreach ($pages as $page): ?> <tr class="border-b hover:bg-gray-50 "> <td class="px-4 py-2 whitespace-nowrap"><?= $page->page_title; ?> | <?= $page->page_title_en; ?></td> <td class="px-4 py-2 whitespace-nowrap"><?= $page->status == 1 ? 'Aktif' : 'Tidak Aktif'; ?></td> <td class="px-4 py-2 whitespace-nowrap"> <a href="<?= base_url('admin/contents/static-pages/edit/' . $page->id_pages); ?>" class="text-blue-500 hover:text-blue-600">Edit</a> | <a href="<?= base_url('admin/contents/delete_page/' . $page->id_pages); ?>" onclick="return confirm('Apakah Anda yakin ingin menghapus halaman ini?');" class="text-red-500 hover:text-red-600">Hapus</a> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </main> <script> document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const pageTableBody = document.getElementById('pageTableBody'); const rows = pageTableBody.querySelectorAll('tr'); const ADD_PAGE_URL = "<?= base_url('admin/contents/add_page') ?>"; searchInput.addEventListener('input', function() { const searchTerm = searchInput.value.toLowerCase(); rows.forEach(row => { const titleCell = row.cells[0].textContent.toLowerCase(); if (titleCell.includes(searchTerm)) { row.style.display = ''; } else { row.style.display = 'none'; } }); }); const addPageButton = document.querySelector('button[id="addPage"]'); addPageButton.addEventListener('click', function(event) { event.preventDefault(); window.open(`${ADD_PAGE_URL}`, '_blank'); }); }); </script>