-
Notifications
You must be signed in to change notification settings - Fork 0
/
all-lots.php
40 lines (31 loc) · 962 Bytes
/
all-lots.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require_once('./init.php');
if (!isset($_GET['category']) || !is_numeric($_GET['category'])) {
$content = include_template('404.php');
$title = 'Нет такой страницы';
$layout = include_template('layout.php', [
'title' => $title,
'content' => $content,
'categories' => $full_categories
]);
print($layout);
exit();
}
$category_id = (int) $_GET['category'];
$category_title = "";
foreach ($full_categories as $category) {
if ($category['id'] === $category_id) {
$category_title = $category['title'];
}
}
$lots = get_category_lots($link, $category_id) ?? [];
$content = include_template('all-lots.php', [
'lots' => $lots,
'category_title' => $category_title
]);
$layout = include_template('layout.php', [
'title' => 'Все лоты в категории ' . $category_title,
'content' => $content,
'categories' => $full_categories
]);
print($layout);