55ok
| Direktori : /home/u307599615/domains/costumeonrent.in/public_html/ |
| Current File : /home/u307599615/domains/costumeonrent.in/public_html/more-costumes.php |
<?php
include('include/header.php');
include('admin/connection.php');
// Fetch mid category ID for "others"
$midQuery = mysqli_query($con, "SELECT m_id FROM mid_category WHERE LOWER(title) = 'more costumes' LIMIT 1");
$midData = mysqli_fetch_assoc($midQuery);
if ($midData) {
$mid_id = $midData['m_id'];
// Fetch all products from "others" category
$productQuery = mysqli_query($con, "SELECT * FROM product WHERE m_id = '$mid_id' ORDER BY p_id DESC");
} else {
$productQuery = false;
}
?>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f9fa;
}
.container {
display: flex;
padding: 20px;
}
a h5.pro_name {
font-size: 14px;
color: black;
font-weight: 600;
margin-top: 5px;
}
h5.pro_price {
font-size: 14px;
color: black;
font-weight: 600;
margin-top: 5px;
}
/* Sidebar */
.sidebar {
width: 250px;
margin-right: 20px;
background-color: #e0e9f2;
padding: 15px;
border-radius: 5px;
}
.filter-group {
margin-bottom: 30px;
background: white;
border: 1px solid #b3cbe1;
border-radius: 4px;
overflow: hidden;
}
.filter-group h4 {
background-color: #6b9bc7;
color: white;
padding: 10px;
margin: 0;
font-size: 16px;
}
.filter-options {
padding: 10px;
}
.filter-options label {
display: flex;
align-items: center;
margin-bottom: 10px;
font-weight: bold;
color: #444;
}
.filter-options input[type="checkbox"] {
margin-right: 10px;
}
.price-range {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 10px;
}
.slider {
width: 100%;
}
/* Main Content */
.main-content {
flex: 1;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
background-color: #6b9bc7;
color: white;
padding: 10px 15px;
border-radius: 5px;
}
.toolbar select {
padding: 5px;
border-radius: 3px;
border: none;
outline: none;
}
.product-grid {
display: flex;
flex-wrap: wrap;
gap: 20px;
}
.product-card {
width: calc(25% - 20px);
background: white;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
text-align: center;
transition: transform 0.3s ease;
}
.product-card:hover {
transform: translateY(-5px);
}
.product-card img {
max-width: 100%;
height: auto;
border-radius: 4px;
aspect-ratio: 4 / 4;
}
@media (max-width: 992px) {
.product-card {
width: calc(33.33% - 20px);
}
}
@media (max-width: 768px) {
.container {
flex-direction: column;
}
.sidebar {
width: 100%;
margin-bottom: 20px;
}
.product-card {
width: calc(50% - 20px);
}
}
@media (max-width: 480px) {
.product-card {
width: 100%;
}
}
</style>
<div class="container">
<!-- Main Content -->
<div class="main-content">
<!-- Product Grid -->
<div class="product-grid">
<?php if ($productQuery && mysqli_num_rows($productQuery) > 0): ?>
<?php while ($p = mysqli_fetch_assoc($productQuery)):
$imgs = json_decode($p['Image'], true);
$img = $imgs[0] ?? 'default.jpg';
?>
<div class="product-card">
<a href="<?= path(); ?>product-details.php?slug=<?= htmlspecialchars($p['slug']); ?>">
<img src="<?= path(); ?>/admin/assets/images/categorie/<?= $img; ?>" alt="<?= htmlspecialchars($p['pro_name']); ?>">
<h5 class="pro_name"><?= htmlspecialchars($p['pro_name']); ?></h5>
<h5 class="pro_price">Buy: Rs. <?= htmlspecialchars($p['buy']); ?></h5>
</a>
</div>
<?php endwhile; ?>
<?php else: ?>
<p>No products found in this category.</p>
<?php endif; ?>
</div>
</div>
</div>
<?php
include('include/footer.php');
?>