-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
108 lines (97 loc) · 3.44 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
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
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<link href="styles/site.css" rel="stylesheet">
<script src="scripts/jquery.js"></script>
<script src="scripts/site.js"></script>
<title>Онлайн магазин</title>
</head>
<body>
<header>
<div id="headerInside">
<div id="logo"></div>
<div id="companyName">Brand</div>
<div id="navWrap">
<a href="/">
Главная
</a>
<a href="index.php?page=shop">
Магазин
</a>
</div>
</div>
</header>
<div id="content">
<?php
$goods = [
[
'id' => 1,
'name' => 'Iphone',
'desc' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium',
'img' => '/images/goods/iphone.jpg',
'price' => '2000 $'
],
[
'id' => 2,
'name' => 'HTC',
'desc' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium',
'img' => '/images/goods/htc.jpg',
'price' => '1200 $'
],
[
'id' => 3,
'name' => 'Samsung',
'desc' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium',
'img' => '/images/goods/samsung.jpg',
'price' => '1400 $'
],
];
$page = $_GET['page'];
if (!isset($page)) {
require('templates/main.php');
} elseif ($page == 'shop') {
require('templates/shop.php');
} elseif ($page == 'product') {
$id = $_GET['id'];
$good = [];
foreach ($goods as $product) {
if ($product['id'] == $id) {
$good = $product;
break;
}
}
require('templates/openedProduct.php');
}
?>
</div>
<footer>
<div id="footerInside">
<div id="contacts">
<div class="contactWrap">
<img src="images/envelope.svg" class="contactIcon">
</div>
<div class="contactWrap">
<img src="images/phone-call.svg" class="contactIcon">
8 800 555 00 00
</div>
<div class="contactWrap">
<img src="images/placeholder.svg" class="contactIcon">
Москва, пр-т Ленина, д. 1 офис 304
</div>
</div>
<div id="footerNav">
<a href="/">Главная</a>
<a href="index.php?page=shop">Магазин</a>
</div>
<div id="social">
<img class="socialItem" src="images/vk-social-logotype.svg">
<img class="socialItem" src="images/google-plus-social-logotype.svg">
<img class="socialItem" src="images/facebook-logo.svg">
</div>
<div id="copyrights">© Brand</div>
</div>
</footer>
</body>
</html>