php include_once _SERVER DOCUMENT_ROOT php config php define true if i

  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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
include_once($_SERVER['DOCUMENT_ROOT']."/php/config.php");
define('a', true);
if(!isset($_GET["page"]))
{
$_GET["page"]="main";
}
try
{
$catalog=new WebApp($host, $dbname, $user, $pass);
}
catch(Exception $e)
{
echo "<h2 style='margin-top:80px; text-align: center'>Сайт временно не доступен. <br>Зайдите позже</h2>";
exit;
}
if($_GET['page'] == 'catalog')
{
if(isset($_GET["id"]))
{
$id = intval($_GET["id"]);
if($id)
{
if($catalog->checkCategory($id) == false)
{
$_GET["page"]='error404';
$tags=$catalog->createPage($_GET["page"]);
}
else $tags=$catalog->createPageOfCatalog($id);
}
else
{
$_GET["page"]='error404';
$tags=$catalog->createPage($_GET["page"]);
}
}
else
{
$_GET["page"]='error404';
$tags=$catalog->createPage($_GET["page"]);
}
}
else if($_GET['page'] == 'card')
{
if(isset($_GET["id"]))
{
$id = intval($_GET["id"]);
if($id)
{
if($catalog->checkCard($id) == false)
{
$_GET["page"]='error404';
$tags=$catalog->createPage($_GET["page"]);
}
else
{
$tags=$catalog->createPageOfCard($id);
$tags['desc']=$tags['title'].", ".$tags['desc'];
}
}
else
{
$_GET["page"]='error404';
$tags=$catalog->createPage($_GET["page"]);
}
}
else
{
$_GET["page"]='error404';
$tags=$catalog->createPage($_GET["page"]);
}
}
else $tags=$catalog->createPage($_GET["page"]);
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title><?php echo $tags['title']; ?></title>
<meta name='description' content="<?php echo $tags['desc']; ?>">
<meta name="keywords" content="<?php echo $tags['keywords']; ?>">
<link rel="stylesheet" href="/css/normalize.css">
<link rel="stylesheet" href="/css/main.css">
<!--[if lt IE 9]>
<script>
document.createElement('header');
document.createElement('nav');
document.createElement('main');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
</script>
<script type="text/javascript" src="js/mediaquery.js"></script>
<![endif]-->
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/js/link.js"></script>
<script type="text/javascript" src="/js/ui/jquery-ui.js"></script>
<script type="text/javascript" src="/js/ui/animatescroll.js"></script>
<link rel="stylesheet" type="text/css" href="/js/ui/jquery-ui.css" />
<link rel="stylesheet" href="/css/autocomplete.css">
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script src="/js/jquery.mask.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="/js/fancybox/helpers/jquery.fancybox-media.js"></script>
<link rel="stylesheet" type="text/css" href="/js/fancybox/jquery.fancybox.css" media="screen" />
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
</head>
<body>
<div class="wrapper">
<div class="top clearfix">
<h1>Мебель для баров, кафе и ресторанов</h1>
<div class="search clearfix">
<form action="/search.html" method="post" name="form_s">
<input id="search" type="text" name="search" value='' placeholder="поиск по товарам">
<input type='submit' value='' name='submit' />
</form>
</div>
<div id="cart" class="clearfix">
<img src="/ img/cart.png">
<?php
if(!isset($_SESSION['cart']))
$_SESSION['cart']=array();
if(count($_SESSION['cart']) == 0)
echo "<span>Пусто</span>";
else echo "<span>Товаров: ".count($_SESSION['cart'])."</span>";
?>
</div>
</div>
<header class="clearfix">
<a href="/"><img src="/img/logo2.png" alt="logo"></a>
<div class="contact">
<p>
Санкт-Петербург<br><span>(812) 327-71-73</span>
</p>
<p>
Москва<br><span>(499) 340-37-69</span>
</p>
</div>
</header>
<nav>
<span class="clearfix">
<a href="/main.html">КАТАЛОГ</a>
<a href="/proizvodstvo.html">ПРОИЗВОДСТВО</a>
<a href="/interiors.html">ИНТЕРЬЕРЫ</a>
<a href="/contacts.html">КОНТАКТЫ</a>
</span>
</nav>
<?php
/*if(!isset($_GET["page"]))
{
$_GET["page"]="main";
}*/
if($_GET["page"] == "main")
{
include_once("/php/main.php");
}
else if($_GET["page"] == "proizvodstvo")
{
include_once("/php/proizvodstvo.php");
}
else if($_GET["page"] == "interiors")
{
include_once("/php/interiors.php");
}
else if($_GET["page"] == "contacts")
{
include_once("/php/contacts.php");
}
else if($_GET["page"] == "catalog")
{
include_once("/php/catalog.php");
}
else if($_GET["page"] == "card")
{
include_once("/php/card.php");
}
else if($_GET["page"] == "checkorder")
{
include_once("/php/checkorder.php");
}
else if($_GET["page"] == "about")
{
include_once("/php/about.php");
}
else if($_GET["page"] == "search")
{
include_once("/php/search.php");
}
else
{
$_GET["page"] == "error404";
include_once("/php/error404.php");
}
?>
<footer class="clearfix">
<hr>
<div class="addr">
<span>Санкт-Петербург:</span> Шкиперский проток 14/15<br>
<span>Выстовочный зал в Санкт-Петербурге:</span> Кронверкский проспект 75<br>
<span>Москва:</span> Дмитровское шоссе 157, строение 9, офис 9239
</div>
<div class="links">
<a href="/about.html">О компании</a>
<a href="">Оплата</a>
<a href="">Доставка</a>
</div>
<div class="icons">
<img id="fb" src="/img/fb.png">
</div>
</footer>
</div>
</body>
</html>