| Server IP : 66.29.146.62 / Your IP : 216.73.216.152 Web Server : LiteSpeed System : Linux premium231.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 User : dokkdzvi ( 925) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dokkdzvi/./itsluxury-uae.store/ |
Upload File : |
<?php
include 'controlPanel/Database.php';
$db = new Database();
if (!isset($_SESSION["user"])) {
$_SESSION["user"] = rand();
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$user = $_SESSION["user"];
if (!empty($_POST['product_id']) and !empty($user)){
$product_id = $_POST["product_id"];
$query = "SELECT * FROM cart WHERE product_id = $product_id AND user = '$user'";
$result = $db->dbQuery($query);
if ($db->dbNumRows($result) > 0) {
$query = "UPDATE cart SET quantity=(quantity+1) WHERE product_id = $product_id AND user = '$user'";
$result = $db->dbQuery($query);
if ($result) {
header("location:cart.php");
}else{
echo "no";
}
}else {
$query = "INSERT INTO cart (product_id, quantity, user) VALUES ($product_id, 1, '$user')";
$result = $db->dbQuery($query);
if ($result) {
header("location:cart.php");
}else{
echo "no1";
}
}
}else{
header("location:index.php");
}
}
$category_id = $_GET['category_id'];
$query = "SELECT title FROM `subclasses` WHERE `id` = $category_id";
$result = $db->dbQuery($query);
if($db->dbNumRows( $result)){
$rows = $db->dbFetchResult($result);
foreach($rows as $row){
$title = $row['title'];
}
}
?>
<html lang="ar" dir="rtl">
<head>
<?php include "head.php"; ?>
</head>
<body style="overflow: auto;" data-new-gr-c-s-check-loaded="14.1125.0" data-gr-ext-installed="">
<div class="loaderk d-flex justify-content-center align-items-center" style="display: none; height: 0px;">
</div>
<?php include "header.php"; ?>
<main>
<section class="mt-5 py-3">
</section>
<section class="container-fluid">
<nav aria-label="breadcrumb" style="margin-top: 15px;">
<ol class="breadcrumb pt-md-0 pt-2">
<li class="breadcrumb-item"><a href="index.php" class=" text-dark">الرئيسية</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $title ?></li>
</ol>
</nav>
<h5 class="text-start text-secondary container-fluid">
<?= $title ?>
</h5>
<!-- itmes -->
<div class="container">
<div class="row">
<?php
$query = "SELECT * FROM `products` WHERE `category_id` = $category_id ORDER BY `product_id` DESC";
$result = $db->dbQuery($query);
if($db->dbNumRows( $result)){
$rows = $db->dbFetchResult($result);
foreach($rows as $row){ ?>
<div class="col-md-3 col-6 mb-2">
<a href="product.php?product_id=<?= $row['product_id']; ?>" class="text-decoration-none">
<div class="product">
<img src="uploads/<?= $row['image']; ?>" class="w-100 " alt="<?= $row['name']; ?>">
<div class="container position-relative">
<p class="productName my-0 mt-2 mb-1"><?= $row['name']; ?></p>
<p class="mb-2 text-secondary text-center">
<span><?= $row['dec'] == 0 ? $row['price'] : $row['dec']; ?></span>
<span>د.إ</span>
</p>
<div>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST">
<input type="hidden" name="qnt" value="1" id="">
<input type="hidden" name="product_id" value="<?= $row['product_id']; ?>" id="">
<button type="submit" name="addCart" class="btn btn-sm btn-dark w-100">
إضافة للسلة
</button>
</form>
</div>
</div>
</div>
</a>
</div>
<?php } } ?>
</div>
</div>
</section>
<a href="https://wa.me/<?= $Whatsapp ?>" class="contact py-2 px-3 bg-success rounded-circle">
<i class="fab fa-whatsapp text-white my-1 fa-2x"></i>
</a>
</main>
<?php
include "footer.php";
include "script.php";
?>
</body>
</html>