This commit is contained in:
kirill.khorkov
2025-12-17 01:18:27 +03:00
parent 8a93cf8657
commit a7282f7363
394 changed files with 16013 additions and 146 deletions

View File

@@ -1,6 +1,6 @@
<?php
session_start();
require_once __DIR__ . '/../config/database.php';
require_once __DIR__ . '/config/database.php';
if (!isset($_SESSION['isLoggedIn']) || $_SESSION['isLoggedIn'] !== true) {
header('Location: login.php?error=auth_required&redirect=' . urlencode($_SERVER['REQUEST_URI']));
@@ -156,6 +156,7 @@ try {
<html>
<head>
<meta charset="UTF-8">
<base href="/cite_practica/">
<title>AETERNA - Каталог</title>
<link rel="stylesheet/less" type="text/css" href="style_for_cite.less">
<script src="https://cdn.jsdelivr.net/npm/less"></script>
@@ -735,9 +736,9 @@ try {
Все категории <span>&#9660;</span>
<div class="catalog-dropdown__menu">
<ul>
<li><a href="/catalog.php">Все товары</a></li>
<li><a href="catalog.php">Все товары</a></li>
<?php foreach ($categories as $category): ?>
<li><a href="/catalog.php?category=<?= $category['category_id'] ?>">
<li><a href="catalog.php?category=<?= $category['category_id'] ?>">
<?= htmlspecialchars($category['name']) ?>
</a></li>
<?php endforeach; ?>
@@ -811,7 +812,7 @@ try {
<div class="header__bottom">
<div class="container header__bottom-content">
<div class="catalog-menu">
<a href="/catalog.php" class="catalog-link active-catalog">
<a href="catalog.php" class="catalog-link active-catalog">
<div class="catalog-icon">
<span class="line"></span>
<span class="line"></span>
@@ -899,12 +900,12 @@ try {
<i class="fas fa-eye"></i> Настройки отображения
</h4>
<?php if ($show_all): ?>
<a href="/catalog.php?<?= http_build_query(array_merge($_GET, ['show_all' => 0])) ?>"
<a href="catalog.php?<?= http_build_query(array_merge($_GET, ['show_all' => 0])) ?>"
class="btn btn-primary" style="background: #453227; color: white; padding: 8px 15px; border-radius: 4px; text-decoration: none; display: inline-block;">
<i class="fas fa-eye-slash"></i> Скрыть недоступные товары
</a>
<?php else: ?>
<a href="/catalog.php?<?= http_build_query(array_merge($_GET, ['show_all' => 1])) ?>"
<a href="catalog.php?<?= http_build_query(array_merge($_GET, ['show_all' => 1])) ?>"
class="btn btn-info" style="background: #17a2b8; color: white; padding: 8px 15px; border-radius: 4px; text-decoration: none; display: inline-block;">
<i class="fas fa-eye"></i> Показать все товары
</a>
@@ -943,13 +944,13 @@ try {
<div class="filter-group">
<h4 class="filter-title">КАТЕГОРИИ</h4>
<ul class="filter-list">
<li><a href="/catalog.php<?= $show_all ? '?show_all=1' : '' ?>"
<li><a href="catalog.php<?= $show_all ? '?show_all=1' : '' ?>"
class="<?= !$category_id ? 'active-category' : '' ?>">
Все товары
</a></li>
<?php foreach ($categories as $category): ?>
<li>
<a href="/catalog.php?category=<?= $category['category_id'] ?><?= $show_all ? '&show_all=1' : '' ?>"
<a href="catalog.php?category=<?= $category['category_id'] ?><?= $show_all ? '&show_all=1' : '' ?>"
class="<?= $category_id == $category['category_id'] ? 'active-category' : '' ?>">
<?= htmlspecialchars($category['name']) ?>
</a>
@@ -963,7 +964,7 @@ try {
<h4 class="filter-title">ПОДКАТЕГОРИИ</h4>
<ul class="filter-list">
<?php foreach ($subcategories as $sub): ?>
<li><a href="/catalog.php?category=<?= $category_id ?>&subcategory=<?= $sub['subcategory_id'] ?><?= $show_all ? '&show_all=1' : '' ?>">
<li><a href="catalog.php?category=<?= $category_id ?>&subcategory=<?= $sub['subcategory_id'] ?><?= $show_all ? '&show_all=1' : '' ?>">
<?= htmlspecialchars($sub['name']) ?>
</a></li>
<?php endforeach; ?>
@@ -1043,7 +1044,7 @@ try {
<?php if ($search): ?>
<p style="color: #666;">
Результаты поиска по запросу: "<strong><?= htmlspecialchars($search) ?></strong>"
<a href="/catalog.php<?= $show_all ? '?show_all=1' : '' ?>" style="margin-left: 10px; color: #617365; text-decoration: none;">
<a href="catalog.php<?= $show_all ? '?show_all=1' : '' ?>" style="margin-left: 10px; color: #617365; text-decoration: none;">
<i class="fas fa-times"></i> Очистить поиск
</a>
</p>
@@ -1112,7 +1113,7 @@ try {
data-product-id="<?= $productId ?>"
data-available="<?= $product['is_available'] && $product['stock_quantity'] > 0 ? 'true' : 'false' ?>">
<div class="product-image-container">
<img src="<?= htmlspecialchars($product['image_url'] ?? 'img2/default.jpg') ?>"
<img src="<?= htmlspecialchars($product['image_url'] ?? 'img/1.jpg') ?>"
alt="<?= htmlspecialchars($product['name']) ?>"
class="<?= strpos($sizeClass, 'small1') !== false ? 'product-img1' : 'product-img' ?>">
@@ -1145,7 +1146,7 @@ try {
<div class="footer__col">
<h5 style="color: #453227;">ПОКУПАТЕЛЮ</h5>
<ul>
<li><a href="/catalog.php" style="color: #453227;">Каталог</a></li>
<li><a href="catalog.php" style="color: #453227;">Каталог</a></li>
<li><a href="services.php" style="color: #453227;">Услуги</a></li>
</ul>
</div>
@@ -1226,12 +1227,7 @@ try {
const isAvailable = $(this).data('available');
if (isAvailable) {
if (productId == 2) {
window.location.href = 'product_modern.php';
} else {
window.location.href = 'product_detail.php?id=' + productId;
}
window.location.href = 'product.php?id=' + productId;
}
}
});