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/badges/ |
Upload File : |
<main class="py-4 px-4 flex-1 bg-purple-50 min-h-screen"> <!-- Header Section --> <div class="flex flex-col sm:flex-row sm:items-center justify-between mb-6 gap-4"> <div> <h1 class="text-2xl font-bold text-gray-800 mb-1">Badge</h1> <p class="text-sm text-gray-600">Tambahkan dan atur badge pada produk untuk memberi label khusus seperti promosi, best seller, atau lainnya.</p> </div> <?php $this->load->view('admin_new/components/add_button', [ 'href' => base_url('admin/badge/create'), 'label' => 'Tambah Badge', ]); ?> </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"> <!-- Ikon Feather sesuai jenis pesan --> <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> <script> feather.replace(); </script> <?php endif; ?> <!-- Badges Table --> <div class="bg-white rounded-xl p-6 mb-8 shadow-sm border border-gray-100"> <div class="flex items-center space-x-3 mb-6"> <div class="p-2 bg-indigo-50 rounded-lg"> <i data-feather="tag" class="w-5 h-5 text-indigo-600"></i> </div> <div> <h2 class="text-lg font-semibold text-gray-800">Daftar Badge Produk</h2> <p class="text-sm text-gray-600">Lihat dan kelola label khusus yang ditampilkan pada produk, seperti "Laku Banget" atau "Lagi Diskon".</p> </div> </div> <div class="overflow-x-auto"> <table class="w-full" id="badgesTable"> <thead> <tr class="border-b border-gray-200"> <th class="text-left py-3 px-4 font-medium text-gray-700">Badges</th> <th class="text-center py-3 px-4 font-medium text-gray-700 hidden sm:table-cell">Warna Background</th> <th class="text-center py-3 px-4 font-medium text-gray-700 hidden sm:table-cell">Warna Teks</th> <th class="text-right py-3 px-4 font-medium text-gray-700 hidden sm:table-cell">Ikon</th> <th class="text-right py-3 px-4 font-medium text-gray-700">Aksi</th> </tr> </thead> <tbody class="divide-y divide-gray-100"> <?php foreach ($badges as $index => $badge): ?> <tr class="hover:bg-gray-50 transition-colors duration-200 group"> <!-- Badge Info --> <td class="py-4 px-4"> <div class="flex items-center space-x-3"> <div class="flex-shrink-0"> <div class="w-3 h-3 rounded-full shadow-sm" style="background-color: <?= $badge->background_color ?>"></div> </div> <div class="min-w-0 flex-1"> <div class="text-sm font-medium text-gray-900 truncate" title="<?= $badge->name ?>"> <div class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium shadow-sm" style="background-color: <?= $badge->background_color ?>; color: <?= $badge->text_color ?>;"> <span><?= $badge->icon ?></span> <span class="ml-2"><?= $badge->name ?></span> </div> </div> <?php if (!empty($badge->description)): ?> <div class="text-xs text-gray-500 sm:hidden mt-2"><?= $badge->description ?></div> <?php endif; ?> </div> </div> </td> <!-- Background Color --> <td class="py-4 px-4 text-center hidden sm:table-cell"> <span class="inline-block px-2 py-1 text-xs font-semibold rounded" style="background-color: <?= $badge->background_color ?>; color: <?= $badge->text_color ?>"> <?= $badge->background_color ?> </span> </td> <!-- Text Color --> <td class="py-4 px-4 text-center hidden sm:table-cell"> <span class="inline-block px-2 py-1 text-xs font-semibold rounded border border-gray-300" style="background-color: <?= $badge->text_color ?>; color: #FFFFFF"> <?= $badge->text_color ?> </span> </td> <!-- Icon --> <td class="py-4 px-4 text-right hidden sm:table-cell text-xl"> <?= $badge->icon ?> </td> <!-- Actions --> <td class="py-4 px-4 text-right space-x-2"> <a href="<?= base_url('admin/badge/' . $badge->id . '/products') ?>" class="inline-flex items-center justify-center p-1 rounded hover:bg-gray-100 transition" title="Lihat produk dengan badge <?= $badge->name ?>"> <i data-feather="box" class="w-5 h-5 text-indigo-500"></i> </a> <a href="<?= base_url('admin/badge/' . $badge->id . '/edit') ?>" class="inline-flex items-center justify-center p-1 rounded hover:bg-gray-100 transition" title="Edit <?= $badge->name ?>"> <i data-feather="edit" class="w-5 h-5 text-primary"></i> </a> <a href="<?= base_url('admin/badge/' . $badge->id . '/delete') ?>" onclick="return confirm('Yakin ingin menghapus badge <?= htmlspecialchars($badge->name, ENT_QUOTES) ?>?')" class="inline-flex items-center justify-center p-1 rounded hover:bg-gray-100 transition" title="Hapus badge <?= $badge->name ?>"> <i data-feather="trash" class="w-5 h-5 text-red-500"></i> </a> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> </main>