D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
newpcjewellers.in
/
Filename :
product.php
back
Copy
<?php // Include database connection include 'config.php'; // Ensure this file contains secure and correct database connection settings include 'header.php'; // Ensure this file contains secure and correct database connection settings // Get the gender parameter from the URL $gender = isset($_GET['gender']) ? $_GET['gender'] : ''; // Prepare the query $query = "SELECT * FROM products WHERE gender = ?"; $stmt = $conn->prepare($query); // Check for query preparation errors if (!$stmt) { die("Query preparation failed: " . $conn->error); } // Bind parameters $stmt->bind_param("s", $gender); // Execute the query if (!$stmt->execute()) { die("Query execution failed: " . $stmt->error); } // Get the result $result = $stmt->get_result(); if (!$result) { die("Result fetching failed: " . $stmt->error); } // Fetch all products $products = $result->fetch_all(MYSQLI_ASSOC); // Close the statement $stmt->close(); // Close the connection $conn->close(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>New PC Jewellers</title> <!-- Favicons --> <link rel="icon" type="image/png" sizes="32x32" href="images/favicon.png"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="theme-color" content="#ffffff"> <!-- Bootstrap and Other Vendors --> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <link rel="stylesheet" href="css/bootstrap-datepicker.min.css"> <link rel="stylesheet" href="css/jquery.fancybox.min.css"> <link rel="stylesheet" href="css/jquery-ui.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link rel="stylesheet" href="css/fontawesome-all.min.css"> <link rel="stylesheet" href="vendors/owl.carousel/css/owl.carousel.min.css"> <link rel="stylesheet" type="text/css" href="vendors/flexslider/flexslider.css" media="screen"> <!-- Fonts --> <link href="https://fonts.googleapis.com/css2?family=Domine:wght@400;500;600;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400&display=swap" rel="stylesheet"> <!-- Styles --> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/responsive.css"> <style> .product2 .imgHov img { width: 100%; height: 250px; object-fit: cover; } </style> </head> <body class="home-2"> <a href="#" id="back-to-top" title="Back to top">↑</a> <div class="innerLayout"> <section id="breadcrumbRow" class="row"> <h2>Products</h2> <div class="row pageTitle m0"> <div class="container"> <ul class="breadcrumb"> <li><a href="index.php">Home</a></li> <li class="active">Products</li> </ul> </div> </div> </section> <section class="row contentRowPad"> <div class="container"> <div class="row"> <?php if (isset($result) && $result->num_rows > 0) { foreach ($products as $row) { ?> <div class="col-sm-3 product2"> <div class="row m0 thumbnail"> <div class="row m0 imgHov"> <img src="newadminpc/uploads/<?php echo htmlspecialchars($row['image1']); ?>" alt="<?php echo htmlspecialchars($row['name']); ?>"> <div class="hovArea row m0"> <div class="links row m0"> <a href="product-details.php?id=<?php echo htmlspecialchars($row['id']); ?>"><i class="fas fa-link"></i></a> <a class="lightbox" href="newadminpc/uploads/<?php echo htmlspecialchars($row['image1']); ?>" data-lightbox="product1" data-title="<?php echo htmlspecialchars($row['name']); ?>"><i class="fas fa-expand"></i></a> </div> </div> </div> <div class="row m0 productIntro"> <h5 class="heading"><a href="product-details.php?id=<?php echo htmlspecialchars($row['id']); ?>"><?php echo htmlspecialchars($row['name']); ?></a></h5> <ul class="list-inline jewelBox"> <li>Purity: <span><?php echo htmlspecialchars($row['purity']); ?></span></li> <li>Weight: <span> <?php echo $row['weight']; ?>GM</span></li> </ul> <a class="jewelAnchor" href="product-details.php?id=<?php echo htmlspecialchars($row['id']); ?>">Explore Details <i class="fas fa-angle-right"></i></a> </div> </div> </div> <?php } } else { echo "<p>No products found in this category and gender.</p>"; } ?> </div> </div> </section> <!-- Social Section --> <section class="social_sec"> <div class="social_div"> <ul class="sociallist"> <li><a href="https://www.facebook.com/newpcjewellersslg01"> <img src="images/icons/facebook.png" alt="social-icon"> </a></li> <li><a href="https://www.instagram.com/newpcjewellerssiliguri/"> <img src="images/icons/instagram.png" alt="social-icon"> </a></li> </ul> </div> <div class="whatsapp_Div"> <a class="video-vemo-icon" href="https://api.whatsapp.com/send/?phone=919734355000"><img src="images/icons/whatsapp.png" alt="WhatsApp"></a> </div> </section> <!-- Footer Section --> <?php require('footer.php') ?> </div> <!-- JS Scripts --> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/bootstrap-datepicker.min.js"></script> <script src="js/jquery.fancybox.min.js"></script> <script src="js/jquery-ui.js"></script> <script src="vendors/owl.carousel/js/owl.carousel.min.js"></script> <script src="vendors/flexslider/jquery.flexslider-min.js"></script> <script src="js/main.js"></script> </body> </html>