Файл: 4wx.ru/scripts/tarifs.php
Строк: 55
<?php
include_once '../sys/fnc.php';
/* ---- */
/*
if (!isset($user)) {
header('location: /');
exit;
}
*/
/* ---- */
$title = 'Услуги';
include_once '../sys/head.php';
/*
switch($_GET['act']) {
case 'add_dir':
break;
}
*/
if (isset($_GET['dir']))$dir['id'] = intval($_GET['dir']);
if ($dir['id'] == 0){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `services_dir"), 0) == 0) {
echo '<div class="err">Услуг не было добавлено</div>';
}
$query = mysql_query("SELECT * FROM `services_dir` ORDER BY `id` ASC");
while ($folder = mysql_fetch_assoc($query)) {
echo '<div class="menu"><img src="/style/img/link_g.png"> <a href="?dir='. $folder['id'] .'">
'. html($folder['name']) .' ('. mysql_result(mysql_query("SELECT COUNT(*) FROM `services_orders` WHERE `status_activity` = '0' AND `id_dir` like '%". $folder['id'] ."%'"), 0) .')
</a></div>';
}
}else{
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `services_orders` WHERE `status_activity` = '0' AND `id_dir` = '".$dir['id']."'"),0);
$p_page = '10';
$k_page = k_page($c_p, 10);
$page = page($k_page);
$start = 10*$page-10;
if ($c_p == 0) {
echo '<div class="err">Нет услуг</div>';
}
$query = mysql_query("SELECT * FROM `services_orders` WHERE `status_activity` = '0' AND `id_dir` = '".$dir['id']."' ORDER BY `up` DESC LIMIT $start, ". $p_page);
while ($post = mysql_fetch_assoc($query)) {
echo '<div class="menu_razd">'. html($post['name']) .'</div>
<div class="post">
Место на диске: '. $post['disk'] .' mb<br />
Трафик: '. $post['traffic'] .' <br />
Доменов: '. $post['domain'] .' <br />
Под-доменов: '. $post['sub_domains'] .' <br />
FTP-доступ: '. $post['FTP'] .' <br>
'.($post['installation'] > 0 ? 'Цена установки: '. $post['installation'] .' Руб <br />' : '').'
Цена в месяц: <b>'. sprintf("%.02f", $post['price']) .'</b> Руб <br />
<a href="/scripts/products.php?id_tarif='.$post['id'].'"><span style="color: #2f4779; font-size: 15px; display: block; text-align: center;"><b>[заказать]</b></span></a>
</div>';
}
if ($k_page > 1) str('?dir='. $dir['id'] .'&', $k_page, $page);
}
include_once '../sys/foot.php';
?><?php
include_once '../sys/fnc.php';
/* ---- */
/*
if (!isset($user)) {
header('location: /');
exit;
}
*/
/* ---- */
$title = 'Услуги';
include_once '../sys/head.php';
/*
switch($_GET['act']) {
case 'add_dir':
break;
}
*/
if (isset($_GET['dir']))$dir['id'] = intval($_GET['dir']);
if ($dir['id'] == 0){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `services_dir"), 0) == 0) {
echo '<div class="err">Услуг не было добавлено</div>';
}
$query = mysql_query("SELECT * FROM `services_dir` ORDER BY `id` ASC");
while ($folder = mysql_fetch_assoc($query)) {
echo '<div class="menu"><img src="/style/img/link_g.png"> <a href="?dir='. $folder['id'] .'">
'. html($folder['name']) .' ('. mysql_result(mysql_query("SELECT COUNT(*) FROM `services_orders` WHERE `status_activity` = '0' AND `id_dir` like '%". $folder['id'] ."%'"), 0) .')
</a></div>';
}
}else{
$c_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `services_orders` WHERE `status_activity` = '0' AND `id_dir` = '".$dir['id']."'"),0);
$p_page = '10';
$k_page = k_page($c_p, 10);
$page = page($k_page);
$start = 10*$page-10;
if ($c_p == 0) {
echo '<div class="err">Нет услуг</div>';
}
$query = mysql_query("SELECT * FROM `services_orders` WHERE `status_activity` = '0' AND `id_dir` = '".$dir['id']."' ORDER BY `up` DESC LIMIT $start, ". $p_page);
while ($post = mysql_fetch_assoc($query)) {
$i ++ ;
echo $i % 2 ? '<div class="post">' : '<div class="razd_menu">';
echo '<div class="menu">'. html($post['name']) .'</div>
<div class="post">
Место на диске: '. $post['disk'] .' mb<br />
Трафик: '. $post['traffic'] .' <br />
Доменов: '. $post['domain'] .' <br />
Под-доменов: '. $post['sub_domains'] .' <br />
FTP-доступ: '. $post['FTP'] .' <hr />
'.($post['installation'] > 0 ? 'Цена установки: '. $post['installation'] .' Руб <br />' : '').'
Цена в месяц: '. $post['price'] .' Руб <br />
<a href="/scripts/products.php?id_tarif='.$post['id'].'"><span style="color: #2f4779; font-size: 15px; display: block; text-align: center;"><b>[заказать]</b></span></a>
</div>';
}
if ($k_page > 1) str('?dir='. $dir['id'] .'&', $k_page, $page);
}
include_once '../sys/foot.php';
?>