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/carts/ |
Upload File : |
<main class="flex-1 py-4 px-4"> <div class="flex items-center justify-between mb-4"> <h1 class="text-xl font-bold text-[#333]">Cart History</h1> </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; ?> <!-- Cart History Table --> <div class="bg-white rounded-lg shadow-md overflow-hidden"> <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-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customer</th> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Product</th> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date Added</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200"> <?php if (empty($carts)): ?> <tr> <td colspan="5" class="px-4 py-2 text-center text-gray-500">No cart history found</td> </tr> <?php else: ?> <?php foreach ($carts as $index => $cart): ?> <tr class="<?php echo $index % 2 === 0 ? 'bg-white' : 'bg-gray-50'; ?> hover:bg-gray-50 transition-colors"> <td class="px-4 py-2 whitespace-nowrap"> <div class="flex items-start flex-col"> <div class="text-sm font-medium text-gray-900"><?php echo $cart->customer_name; ?></div> <div class="text-xs text-gray-500"><?php echo $cart->customer_email; ?></div> <div class="text-xs text-gray-500"><?php echo $cart->customer_phone; ?></div> </div> </td> <td class="px-4 py-2"> <div class="text-sm text-gray-900"><?php echo $cart->product_name; ?></div> <div class="text-xs text-gray-500">ID: <?php echo $cart->product_id; ?></div> </td> <td class="px-4 py-2 whitespace-nowrap"> <div class="text-sm text-gray-900"><?php echo date('d M Y', strtotime($cart->created_at)); ?></div> <div class="text-xs text-gray-500"><?php echo date('h:i A', strtotime($cart->created_at)); ?></div> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> <!-- Pagination --> <div class="bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"> <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"> <div> <p class="text-sm text-gray-700"> Showing <span class="font-medium">1</span> to <span class="font-medium"><?php echo count($carts); ?></span> of <span class="font-medium"><?php echo count($carts); ?></span> results </p> </div> <div> <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination"> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Previous</span> <i data-feather="chevron-left" class="h-5 w-5"></i> </a> <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"> 1 </a> <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"> 2 </a> <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"> 3 </a> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Next</span> <i data-feather="chevron-right" class="h-5 w-5"></i> </a> </nav> </div> </div> </div> </div> <!-- Details Modal --> <div id="detailsModal" class="fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center hidden"> <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl"> <div class="flex items-center justify-between border-b px-6 py-4"> <h3 class="text-lg font-medium text-gray-900">Product Details</h3> <button id="closeModal" class="text-gray-400 hover:text-gray-500"> <i data-feather="x" class="h-6 w-6"></i> </button> </div> <div class="p-6" id="modalContent"> <!-- Content will be loaded here --> </div> <div class="bg-gray-50 px-6 py-4 flex justify-end"> <button id="closeModalBtn" class="bg-gray-500 hover:bg-gray-600 text-white py-2 px-4 rounded-lg"> Close </button> </div> </div> </div> </main> <script> document.addEventListener('DOMContentLoaded', function() { // Initialize Feather icons if (typeof feather !== 'undefined') { feather.replace(); } }); </script>