One Hat Cyber Team
Your IP :
216.73.216.186
Server IP :
84.32.84.108
Server :
Linux in-mum-web1837.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
u322583024
/
domains
/
awaha.in
/
public_html
/
Edit File:
search.php
<?php include 'admin/connection.inc.php'; session_start(); if (isset($_SESSION['user_id'])) { $is_logged_in = true; $user_id = $_SESSION['user_id']; } else { $is_logged_in = false; } ?> <!DOCTYPE html> <html lang="zxx"> <head> <!--====== Required meta tags ======--> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="description" content="eCommerce,shop,fashion"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!--====== Title ======--> <title><?php echo $product['product_name']; ?> - Awaha</title> <!--====== Favicon Icon ======--> <link rel="shortcut icon" href="assets/images/logo/awaha.png" type="image/png"> <!--====== Google Fonts ======--> <link href="https://fonts.googleapis.com/css2?family=Aoboshi+One&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap" rel="stylesheet"> <!--====== Flaticon css ======--> <link rel="stylesheet" href="assets/fonts/flaticon/flaticon_pesco.css"> <!--====== FontAwesome css ======--> <link rel="stylesheet" href="assets/fonts/fontawesome/css/all.min.css"> <!--====== Bootstrap css ======--> <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.min.css"> <!--====== Slick-popup css ======--> <link rel="stylesheet" href="assets/vendor/slick/slick.css"> <!--====== Nice Select css ======--> <link rel="stylesheet" href="assets/vendor/nice-select/css/nice-select.css"> <!--====== Magnific-popup css ======--> <link rel="stylesheet" href="assets/vendor/magnific-popup/dist/magnific-popup.css"> <!--====== Jquery UI css ======--> <link rel="stylesheet" href="assets/vendor/jquery-ui/jquery-ui.min.css"> <!--====== Animate css ======--> <link rel="stylesheet" href="assets/vendor/aos/aos.css"> <!--====== Default css ======--> <link rel="stylesheet" href="assets/css/default.css"> <!--====== Style css ======--> <link rel="stylesheet" href="assets/css/style.css"> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content="Rose : Soothing and hydrating." /> <meta name="twitter:description" content="Check out this amazing product on Digital Cardwale." /> <meta name="twitter:image" content="https://digitalcardwale.com/awaha/<?php echo $product['product_img']; ?>" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content="Rose : Soothing and hydrating." /> <meta name="twitter:description" content="Check out this amazing product on Digital Cardwale." /> <meta name="twitter:image" content="https://digitalcardwale.com/awaha/<?php echo $product['product_img']; ?>" /> <link href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> <!-- Font Awesome CDN (for star icons) --> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet"> <style> /* Overall product container */ .product { border: 1px solid #ddd; border-radius: 12px; padding: 20px; margin: 25px; background-color: #fff; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; overflow: hidden; text-align: center; } /* Hover effect with scaling and shadow */ .product:hover { transform: scale(1.05); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); } /* Product name */ .product h3 { font-size: 30px; font-weight: 700; color: #2c3e50; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 2px; background: linear-gradient(45deg, #ff6347, #ff4500); /* Orange gradient */ -webkit-background-clip: text; color: transparent; } /* Product description */ .product p { font-size: 17px; color: #7f8c8d; margin-bottom: 15px; line-height: 1.5; font-family: 'Arial', sans-serif; } /* Price section */ .product .price { font-size: 26px; font-weight: 600; color: #2ecc71; /* Green color for price */ margin-bottom: 20px; transition: color 0.3s ease; } /* Price hover effect */ .product .price:hover { color: #27ae60; text-decoration: underline; } /* Stock availability */ .product .stock { font-size: 15px; font-style: italic; color: #bdc3c7; } /* Image styling */ .product img { max-width: 100%; border-radius: 12px; margin-top: 20px; transition: transform 0.3s ease; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } /* Image hover effect */ .product img:hover { transform: scale(1.1); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); } /* Make image popup link more interactive */ .product .img-popup { text-decoration: none; display: inline-block; position: relative; overflow: hidden; border-radius: 12px; } .product .img-popup:before { content: "View Image"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 18px; font-weight: bold; background-color: rgba(0, 0, 0, 0.5); padding: 10px; border-radius: 5px; opacity: 0; transition: opacity 0.3s ease; } .product .img-popup:hover:before { opacity: 1; } </style> </head> <body> <!--====== Start Overlay ======--> <div class="offcanvas__overlay"></div> <!--====== Start Sidemenu-wrapper-cart Area ======--> <div class="sidemenu-wrapper-cart"> <div class="sidemenu-content"> <div class="widget widget-shopping-cart"> <h4>My cart</h4> <div class="sidemenu-cart-close"><i class="far fa-times"></i></div> <div class="widget-shopping-cart-content"> <ul class="pesco-mini-cart-list" id="cart-items-list"> <!-- Cart items will be dynamically loaded here --> </ul> <div class="cart-mini-total"> <div class="cart-total"> <span><strong>Subtotal:</strong></span> <span class="amount" id="cart-subtotal">0.00</span> </div> </div> <div class="cart-button-box"> <a href="#" class="theme-btn style-one">Proceed to checkout</a> </div> </div> </div> </div> </div> <!--====== End Sidemenu-wrapper-cart Area ======--> <!--====== Start Header Section ======--> <?php include 'header.php' ?> <!--====== End Header Section ======--> <!--====== Main Bg ======--> <main class="main-bg"> <!--====== Start Page Banner Section ======--> <section class="page-banner"> <div class="page-banner-wrapper p-r z-1"> <svg class="lineanm" viewBox="0 0 1920 347" fill="none" xmlns="http://www.w3.org/2000/svg"> <path class="line" d="M-39 345.187C70 308.353 397.628 293.477 436 145.186C490 -63.5 572 -57.8156 688 255.186C757.071 441.559 989.5 -121.315 1389 98.6856C1708.6 274.686 1940.33 156.519 1964.5 98.6856" stroke="white" stroke-width="3" stroke-dasharray="2 2"/> </svg> <div class="page-image"><img src="assets/images/soap/bgrsoap.png" alt="image"></div> <svg class="page-svg" xmlns="http://www.w3.org/2000/svg"> <path d="M21.1742 33.0065C14.029 35.2507 7.5486 39.0636 0 40.7339V86H1937V64.9942C1933.1 60.1623 1912.65 65.1777 1904.51 62.6581C1894.22 59.4678 1884.93 55.0079 1873.77 52.7742C1861.2 50.2585 1823.41 36.3854 1811.99 39.9252C1805.05 42.0727 1796.94 37.6189 1789.36 36.6007C1769.18 33.8879 1747.19 31.1848 1726.71 29.7718C1703.81 28.1919 1678.28 27.0012 1657.53 34.4442C1636.45 42.005 1606.07 60.856 1579.5 55.9191C1561.6 52.5906 1543.41 47.0959 1528.45 56.9075C1510.85 68.4592 1485.74 74.2518 1460.44 76.136C1432.32 78.2297 1408.53 70.6879 1384.73 62.2987C1339.52 46.361 1298.19 27.1677 1255.08 9.28534C1242.58 4.10111 1214.68 15.4762 1200.55 16.6533C1189.77 17.5509 1181.74 15.4508 1172.12 12.8795C1152.74 7.70033 1133.23 2.88525 1111.79 2.63621C1088.85 2.36971 1073.94 7.88289 1056.53 15.8446C1040.01 23.3996 1027.48 26.1777 1007.8 26.1777C993.757 26.1777 975.854 25.6887 962.844 28.9632C941.935 34.2258 932.059 38.7874 914.839 28.6037C901.654 20.8061 866.261 -2.56499 844.356 7.12886C831.264 12.9222 820.932 21.5146 807.663 27.5255C798.74 31.5679 779.299 42.0561 766.33 39.1166C758.156 37.2637 751.815 31.6349 745.591 28.2443C730.967 20.2774 715.218 13.2948 695.846 10.723C676.168 8.11038 658.554 23.1787 641.606 27.4357C617.564 33.4742 602.283 27.7951 579.244 27.7951C568.142 27.7951 548.414 30.4002 541.681 23.6618C535.297 17.2722 530.162 9.74921 523.263 3.71444C517.855 -1.01577 505.798 -0.852017 498.318 2.09709C479.032 9.7007 453.07 10.0516 431.025 9.64475C407.556 9.21163 368.679 1.61612 346.618 10.3636C319.648 21.0575 291.717 53.8338 254.67 45.2266C236.134 40.9201 225.134 37.5813 204.78 40.7339C186.008 43.6415 171.665 50.7785 156.051 57.3567C146.567 61.3523 152.335 52.6281 151.12 47.9222C149.535 41.7853 139.994 34.5585 132.991 30.4008C120.206 22.8098 90.2848 24.3246 74.2546 24.6502C55.5552 25.0301 37.9201 27.747 21.1742 33.0065Z" fill="#FFFAF3"/> </svg> <div class="shape shape-one"><span></span></div> <div class="shape shape-two"><span></span></div> <div class="shape shape-three"><span><img src="assets/images/shape/curved-arrow.png" alt=""></span></div> <div class="container"> <div class="row"> <div class="col-lg-6"> <div class="page-banner-content"> <h1>Your Search Results </h1> </div> </div> </div> </div> </div> </section><!--====== End Page Banner Section ======--> <!--====== Start Shop Details Section ======--> <section class="shop-details-section pt-120 pb-80"> <div class="container"> <div class="shop-details-wrapper"> <div class="row"> <div class="col-xl-12 text-center"> <!--=== Product Gallery ===--> <?php // Include database connection include('admin/connection.inc.php'); // Enable error reporting for debugging (for development only) ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); // Check if the search query is set if (isset($_GET['query']) && !empty($_GET['query'])) { $searchQuery = $_GET['query']; // Log the search query for debugging error_log("Search Query: " . $searchQuery); // Prepare SQL query to search for products $query = "SELECT * FROM products WHERE (product_name LIKE ? OR product_details LIKE ?)"; $stmt = $conn->prepare($query); if ($stmt === false) { die('Error in SQL prepare statement: ' . $conn->error); } $searchTerm = "%" . $searchQuery . "%"; $stmt->bind_param("ss", $searchTerm, $searchTerm); // Bind search term to the query if (!$stmt->execute()) { die("Error executing query: " . $stmt->error); } $result = $stmt->get_result(); // Check if any results are found echo "<p class='text-center'><strong>Number of products found: " . $result->num_rows . "</strong></p>"; // Debug output if ($result->num_rows > 0) { echo "<div class='row'>"; // Open Bootstrap row for proper grid alignment // Loop through each product and display while ($row = $result->fetch_assoc()) { echo "<div class='col-md-4 mb-4'>"; echo "<div class='card h-100'>"; // Display product image if (!empty($row['product_img'])) { $imgPath = htmlspecialchars($row['product_img']); echo "<a href='awaha/$imgPath' class='img-popup'>"; echo "<img src='awaha/$imgPath' class='card-img-top' alt='Product'>"; echo "</a>"; } else { echo "<img src='placeholder.jpg' class='card-img-top' alt='No Image Available'>"; } echo "<div class='card-body'>"; echo '<h4 class="title"> <a href="product-details.php?id=' . htmlspecialchars($row['id']) . '" class="text-decoration-none text-dark"> ' . htmlspecialchars($row['product_name']) . ' </a> </h4>'; echo"<br>"; echo " <strong> " . $row['product_details'] . "</strong> </p>"; echo"<br>"; echo "<p class='card-text'><strong>Price:</strong> ₹" . htmlspecialchars($row['product_price']) . "</p>"; echo"<br>"; echo "<p class='card-text'><strong>Stock:</strong> " . htmlspecialchars($row['product_stock']) . "</p>"; echo"<br>"; echo "</div>"; // Close card-body echo "</div>"; // Close card echo "</div>"; // Close column } echo "</div>"; // Close Bootstrap row } else { echo "<p class='text-center text-danger'>No products found matching your search.</p>"; } // Close the statement $stmt->close(); } else { echo "<p class='text-center text-warning'>Please enter a search query.</p>"; } ?> </div> </div> </div> </div> </div> </section><!--====== End Shop Details Section ======--> </main> <!--====== Start Footer Main ======--> <?php include 'footer.php' ?> <!--====== End Footer Main ======--> <!--====== Back To Top ======--> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script> document.getElementById('review-form').addEventListener('submit', function(event) { event.preventDefault(); // Prevent default form submission // Create a new FormData object to send the form data via AJAX var formData = new FormData(this); // Make an AJAX request to submit the form data var xhr = new XMLHttpRequest(); xhr.open("POST", "submit-review.php", true); xhr.onload = function() { if (xhr.status === 200) { // Show SweetAlert on success Swal.fire({ title: 'Success!', text: 'Your review has been submitted.', icon: 'success', confirmButtonText: 'OK' }); } else { // Handle errors Swal.fire({ title: 'Error!', text: 'There was a problem submitting your review.', icon: 'error', confirmButtonText: 'Try Again' }); } }; xhr.send(formData); // Send the form data to the server }); </script> <script> document.querySelectorAll('.add-to-cart-btn').forEach(button => { button.addEventListener('click', function (e) { e.preventDefault(); const productId = this.getAttribute('data-product-id'); const quantity = this.closest('.product-cart-variation').querySelector('.quantity').value; fetch('add-to-cart.php', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ product_id: productId, quantity: quantity }), }) .then(response => response.json()) .then(data => { if (data.success) { Swal.fire({ title: 'Success!', text: 'Product added to cart!', icon: 'success', confirmButtonText: 'OK', }); } else { Swal.fire({ title: 'Error!', text: data.message || 'Something went wrong.', icon: 'error', confirmButtonText: 'Try Again', }); } }) .catch(error => { console.error('Error:', error); Swal.fire({ title: 'Network Error!', text: 'A network error occurred. Please try again later.', icon: 'error', confirmButtonText: 'OK', }); }); }); }); document.addEventListener('DOMContentLoaded', () => { const cartContainer = document.querySelector('#cart-items-list'); const cartSubtotal = document.querySelector('#cart-subtotal'); // Fetch cart items from server or localStorage fetch('fetch-cart-items.php') .then(response => response.json()) .then(data => { if (data.success) { let itemsHTML = ''; let subtotal = 0; data.cart_items.forEach(item => { const { product_id, product_name, product_price, product_img, quantity } = item; // Create a cart item list entry itemsHTML += ` <li class="sidebar-cart-item" data-product-id="₹{product_id}"> <a href="#" class="remove-cart" data-product-id="${product_id}"> <i class="far fa-trash-alt"></i> </a> <a href="#"> <img src="awaha/${product_img}" alt="${product_name}"> ${product_name} </a> <span class="quantity">${quantity} × <span><span class="currency">₹</span>${product_price}</span></span> </li> `; // Calculate the subtotal subtotal += product_price * quantity; }); // Update cart UI with new cart items cartContainer.innerHTML = itemsHTML; cartSubtotal.innerHTML = `<span class="currency">₹</span>${subtotal.toFixed(2)}`; } else { cartContainer.innerHTML = '<li>No items in the cart</li>'; } }) .catch(error => { console.error('Error fetching cart items:', error); cartContainer.innerHTML = '<li>Error loading cart items</li>'; }); // Event delegation for removing items cartContainer.addEventListener('click', (event) => { if (event.target.closest('.remove-cart')) { event.preventDefault(); const cartItem = event.target.closest('.sidebar-cart-item'); const productId = cartItem.getAttribute('data-product-id'); // Call an endpoint to remove the item from the cart fetch('remove-cart-item.php', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ product_id: productId }), }) .then(response => response.json()) .then(data => { if (data.success) { cartItem.remove(); // Remove item from the UI updateSubtotal(); } else { console.error(data.message); } }) .catch(error => console.error('Error removing item:', error)); } }); // Function to update subtotal function updateSubtotal() { let total = 0; const cartItems = document.querySelectorAll('.sidebar-cart-item'); cartItems.forEach(item => { const quantity = parseInt(item.querySelector('.quantity').textContent.split(' × ')[0]); const price = parseFloat(item.querySelector('.quantity span span.currency').nextElementSibling.textContent); total += quantity * price; }); cartSubtotal.innerHTML = `<span class="currency">$</span>${total.toFixed(2)}`; } }); </script> <div class="back-to-top" ><i class="far fa-angle-up"></i></div> <!--====== Jquery js ======--> <script src="assets/vendor/jquery-3.7.1.min.js"></script> <!--====== Bootstrap js ======--> <script src="assets/vendor/popper/popper.min.js"></script> <!--====== Bootstrap js ======--> <script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script> <!--====== Slick js ======--> <script src="assets/vendor/slick/slick.min.js"></script> <!--====== Magnific js ======--> <script src="assets/vendor/magnific-popup/dist/jquery.magnific-popup.min.js"></script> <!--====== Nice-select js ======--> <script src="assets/vendor/nice-select/js/jquery.nice-select.min.js"></script> <!--====== Jquery Ui js ======--> <script src="assets/vendor/jquery-ui/jquery-ui.min.js"></script> <!--====== SimplyCountdown js ======--> <script src="assets/vendor/simplyCountdown.min.js"></script> <!--====== Aos js ======--> <script src="assets/vendor/aos/aos.js"></script> <!--====== Main js ======--> <script src="assets/js/theme.js"></script> <script> // JavaScript to handle star rating document.addEventListener('DOMContentLoaded', function () { const starRating = document.querySelector('#star-rating'); const selectedRating = document.querySelector('#selected-rating'); if (starRating) { starRating.addEventListener('click', function (e) { if (e.target.tagName === 'I') { const stars = Array.from(starRating.querySelectorAll('li')); const value = e.target.parentElement.getAttribute('data-value'); selectedRating.value = value; // Reset classes stars.forEach(star => star.classList.remove('selected')); // Highlight selected stars stars.slice(0, value).forEach(star => star.classList.add('selected')); } }); } }); //sharing options function sharePage() { if (navigator.share) { navigator.share({ title: document.title, text: 'Check out this amazing page!', url: window.location.href, }) .then(() => console.log('Thanks for sharing!')) .catch(console.error); } else { alert('Web Share API is not supported in your browser. Please copy the URL manually.'); } } </script> <script> // Function to handle wishlist toggle (click event) function toggleWishlist(event, productId) { event.preventDefault(); // Prevent the default anchor behavior let url = "add-to-wishlist.php?product_id=" + productId; // URL to send request // Perform the AJAX request to toggle the wishlist status fetch(url) .then(response => response.text()) .then(data => { // Reload the page to reflect the updated wishlist state location.reload(); }) .catch(error => console.error('Error:', error)); } // Handle double-click to remove product from wishlist document.querySelector("#wishlist-icon-<?php echo $product_id; ?>").ondblclick = function(event) { event.preventDefault(); // Prevent the default action on double-click let url = "add-to-wishlist.php?product_id=<?php echo $product_id; ?>"; // Same URL for removal // Perform the AJAX request to remove the product from wishlist fetch(url) .then(response => response.text()) .then(data => { // Reload the page to reflect the updated wishlist state location.reload(); }) .catch(error => console.error('Error:', error)); }; </script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.6.0/dist/sweetalert2.min.js"></script> <script> // main.js or scripts.js function toggleWishlist(product_id) { $.ajax({ url: 'toggle-wishlist.php', type: 'POST', data: { product_id: product_id }, dataType: 'json', success: function(response) { let wishlistIcon = $("#wishlist-icon-" + product_id); if (response.status === 'added') { wishlistIcon.addClass('wishlist-added'); } else if (response.status === 'removed') { wishlistIcon.removeClass('wishlist-added'); } } }); } </script> <script> $(document).ready(function() { $('#wishlist-icon').click(function(e) { e.preventDefault(); // Get the product ID and user ID (assuming the user ID is available, such as in a session or as a data attribute) let productId = $(this).data('item-id'); let userId = 1; // Example: Replace this with actual user ID from your session or auth system // Send the data to the backend via AJAX $.ajax({ url: 'add-to-wishlist.php', // PHP script to handle the database insertion method: 'POST', data: { user_id: userId, product_id: productId }, success: function(response) { // Display success message Swal.fire({ icon: 'success', title: 'Added to Wishlist', text: 'The item has been added to your wishlist.', timer: 2000, showConfirmButton: false }); // Optionally, change the icon to indicate it's added to wishlist $('#wishlist-icon').find('i').removeClass('fa-heart').addClass('fa-heart-o'); }, error: function() { Swal.fire({ icon: 'error', title: 'Error', text: 'Something went wrong, please try again later.', timer: 2000, showConfirmButton: false }); } }); }); }); </script> </body> </html>
Simpan