This repository has been archived by the owner on May 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
item.php
101 lines (86 loc) · 3.07 KB
/
item.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
require_once 'back/header.php';
require_once 'back/page-settings.php';
require_once 'back/shop-list.php';
require_once 'back/footer.php';
require_once 'back/db.php';
require_once 'back/utils.php';
require_once 'back/users.php';
$page_title = "СарИсскуство";
$data = 0;
$images = [];
$__id = parseGet($_GET['id']);
if($__id){
$data = getItem($__id);
$images = getItemImages($__id);
}
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<? renderHeader(); ?>
</head>
<body>
<? renderTop(); ?>
<div class="container content item-page">
<?
if($__id) {
?>
<div class="d-flex flex-row justify-content-center flex-wrap">
<?
foreach ($images as $img) {
?>
<div class="d-flex flex-row justify-content-center image-item">
<img src="<?=$img['url']?>">
</div>
<?
}
?>
</div>
<br>
<div class="col">
<div class="row">
<h1><?=$data['name']?></h1>
</div>
<? if($_SESSION['isAdmin']) { ?>
<p class="row"><a href="item-edit.php?id=<?=$__id?>" class="btn-link">Изменить</a></p>
<? } ?>
<p class="text-body row"></p>
<p class="text-info row"><?=$data['tags']?></p>
<p class="font-weight-light row">Автор: <?=$data['author']?></p>
<p class="d-flex font-weight-light flex-row align-items-center row">
Цена:
<span style="padding-right: 10px;"> </span>
<span class="btn btn-light"><?=$data['price']?> руб</span>
</p>
<br/>
<p class="row">
<!--<a href="#" class="btn btn-primary btn-lg" role="button">Купить</a>
<span style="padding-right: 10px;"> </span>-->
<a href="cart.php?add=<?=$data["id"]?>" class="btn btn-secondary btn-lg d-inline-flex" role="button">
<? if(!isInCart($data['id'], $_SESSION['id'])){ ?>
<i class="material-icons" style="padding-right: 4px;">shopping_cart</i>
В корзину
<?} else {?>
<i class="material-icons" style="padding-right: 4px;">remove_shopping_cart</i>
Убрать из корзины
<? } ?>
</a>
</p>
</div>
<?
} else {
?>
<h2>Товар не найден</h2>
<div class="row">
<a href="index.php" class="btn btn-secondary btn-lg d-inline-flex" role="button">
На главную
</a>
</div>
<?
}
?>
</div>
<? renderBottom(); ?>
</body>
</html>