D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
slg.encodersunlimited.com
/
slgadmintoys
/
Filename :
categories.php
back
Copy
<?php include 'config.php'; ?> <!DOCTYPE html> <html lang="en" data-theme="light"> <head> <?php include 'style.php'; ?> </head> <body> <?php include 'sidebar.php'; ?> <main class="dashboard-main"> <?php include 'header.php'; ?> <div class="dashboard-main-body"> <div class="d-flex flex-wrap align-items-center justify-content-between gap-3 mb-24"> <h6 class="fw-semibold mb-0">View Categories</h6> <ul class="d-flex align-items-center gap-2"> <li class="fw-medium"> <a href="index.html" class="d-flex align-items-center gap-1 hover-text-primary"> <iconify-icon icon="solar:home-smile-angle-outline" class="icon text-lg"></iconify-icon> Dashboard </a> </li> <li>-</li> <li class="fw-medium">Categories Table</li> </ul> </div> <div class="row gy-4"> <div class="col-lg-12"> <div class="card"> <div class="card-header"> <h5 class="card-title mb-0">Category List</h5> </div> <div class="card-body"> <div class="table-responsive"> <table class="table bordered-table mb-0"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Description</th> <th>Image</th> <th>Status</th> <th>Created At</th> <th>Action</th> </tr> </thead> <tbody> <?php $query = "SELECT * FROM product_category ORDER BY category_id DESC"; $result = mysqli_query($conn, $query); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { ?> <tr> <td><?= $row['category_id']; ?></td> <td><?= $row['category_name']; ?></td> <td style="max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> <?= $row['category_desc']; ?> </td> <td> <img src="uploads/<?= $row['category_image']; ?>" alt="Category Image" class="img-fluid radius-8" width="50"> </td> <td><?= $row['category_status']; ?></td> <td><?= date("Y-m-d", strtotime($row['created_at'])); ?></td> <td> <a href="edit_category.php?id=<?= $row['category_id']; ?>" class="w-32-px h-32-px bg-success-focus text-success-main rounded-circle d-inline-flex align-items-center justify-content-center"> <iconify-icon icon="lucide:edit"></iconify-icon> </a> <a href="delete_category.php?id=<?= $row['category_id']; ?>" class="w-32-px h-32-px bg-danger-focus text-danger-main rounded-circle d-inline-flex align-items-center justify-content-center" onclick="return confirm('Are you sure you want to delete this category?');"> <iconify-icon icon="mingcute:delete-2-line"></iconify-icon> </a> </td> </tr> <?php } } else { echo "<tr><td colspan='7' class='text-center'>No categories found</td></tr>"; } mysqli_close($conn); ?> </tbody> </table> </div> </div> </div><!-- card end --> </div> </div> </div> <?php include 'Footer.php'; ?> </main> </body> </html>