D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
siliguritoys.com
/
slgadmintoys
/
Filename :
products.php
back
Copy
<?php include 'config.php'; ?> <!-- meta tags and other links --> <!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 Products</h6> <ul class="d-flex align-items-center gap-2"> <li class="fw-medium"> <a href="index.php" 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">Product List</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">Product List</h5> </div> <div class="card-body"> <div class="table-responsive"> <table class="table bordered-table mb-0"> <thead> <tr> <th>Image</th> <th>Name</th> <th>Age</th> <th>Size</th> <th>Weight</th> <th>Material</th> <th>Category</th> <th>Price</th> <th>Stock Quantity</th> <th>Description</th> <th>Action</th> </tr> </thead> <tbody> <?php $query = "SELECT p.*, c.category_name FROM slgtoys_products p JOIN product_category c ON p.category_id = c.category_id"; $result = mysqli_query($conn, $query); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { ?> <tr> <td><img src="<?= $row['image_1'] ?>" alt="" class="flex-shrink-0 me-12 radius-8" width="50"></td> <td class="text-lg text-secondary-light fw-semibold"><?= $row['name'] ?></td> <td><?= $row['age_category'] ?></td> <td><?= $row['size'] ?></td> <td><?= $row['weight'] ?></td> <td><?= $row['material'] ?></td> <td><?= $row['category_name'] ?></td> <td><?= $row['price'] ?></td> <td><?= $row['stock_quantity'] ?></td> <td style="max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><?= $row['description'] ?></td> <td> <a href="edit_product.php?id=<?= $row['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_product.php?id=<?= $row['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 product?')"> <iconify-icon icon="mingcute:delete-2-line"></iconify-icon> </a> </td> </tr> <?php } } else { ?> <tr> <td colspan="11" class="text-center">No products found</td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <?php include 'Footer.php'; ?> </body> </html>