-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
51 lines (41 loc) · 1.34 KB
/
index.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
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @var $link
* @var $config
* @var $pageTitle
* @var $userName
* @var $categories
* @var $lots
* @var $promoMenu
* @var $menu
* @var $lotsPerPage
*/
require_once __DIR__ . '/bootstrap.php';
require_once __DIR__ . '/get-winner.php';
$lotsPerPage = $config['pagination']['mainLotsPage'];
$currentPageNumber = getCurrentPageNumber($_GET);
$itemsCount = getCountLotsOpened($link);
$totalPagesCount = getTotalPagesCount($itemsCount, $lotsPerPage);
$lots = getLots($link, $lotsPerPage, $currentPageNumber);
$menu = includeTemplate('menu.php', ['categories' => $categories]);
$promoMenu = includeTemplate('promo_menu.php', ['categories' => $categories]);
$lotsList = includeTemplate('lots-list.php', [
'lots' => $lots,
'link' => $link,
]);
$pagination = includeTemplate('pagination.php', [
'totalPagesCount' => $totalPagesCount,
'currentPageNumber' => $currentPageNumber,
]);
$pageContent = includeTemplate('main.php', [
'promoMenu' => $promoMenu,
'lotsList' => $lotsList,
'pagination' => $pagination,
]);
$footer = includeTemplate('footer.php', ['categories' => $categories, 'menu' => $menu]);
$layoutContent = includeTemplate('layout.php', [
'footer' => $footer,
'pageTitle' => $pageTitle . ' | Главная',
'pageContent' => $pageContent,
]);
print($layoutContent);