Файл: user/stat.php
Строк: 228
<?php
/*
* Статы
* DCMS Special
* Модифицировал densnet
* Файл stat.php
*/
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/user.php';
$set['title'] = 'Статы';
require_once '../sys/inc/thead.php';
aut();
$q = mysql_query("SELECT * FROM `user` WHERE `id` = '$user[id]' LIMIT 1");
$user = mysql_fetch_assoc($q);
$stat = mysql_fetch_array(mysql_query("SELECT * FROM `stat` WHERE `user_id` = '" . $user['id'] . "'"));
$act = (isset($_GET['act'])) ? htmlspecialchars($_GET['act']) : null;
switch ($act) {
case 'buy':
echo "<div class = 'razd1'>";
echo "<span class = 'icon icon130' /> Ваши монеты: $user[money] (<font color = 'red'>Вам скидки нет</font>)<br />";
echo "Выберите себе стат. Картинка будет на вашей странице 7 дней";
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/1.png' /><br />";
echo "Балалайка (100 монет)<br />";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=1'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/2.png' /><br />";
echo "Козина (100 монет)<br />";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=2'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/3.png' /><br />";
echo "Бабочка (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=3'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/4.png' /><br />";
echo "Пасха (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=4'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/5.png' /><br />";
echo "Колокол (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=5'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/6.png' /><br />";
echo "Дельфин (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=6'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/7.png' /><br />";
echo "Яйцо (200 монет)<br/>";
if ($user['money'] >= 200) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=7'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/8.png' /><br />";
echo "Слон (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=8'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/9.png' /><br />";
echo "Гиппопотам (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=9'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/10.png' /><br />";
echo "Матрешка (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=10'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/11.png' /><br />";
echo "Панда (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=11'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/12.png' /><br />";
echo "Заяц (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=12'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/13.png' /><br />";
echo "Самовар (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=13'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/14.png' /><br />";
echo "Серп и Молот (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=14'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/15.png' /><br />";
echo "Черепаха (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=15'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<img src = '/style/stat/16.png' /><br />";
echo "Валенки (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "<form method = 'post' name = 'message' action = '?act=ok&select=16'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Купить</span>";
echo "</button></form>n";
} else {
echo "Купить<br />";
}
echo "</div><div class = 'razd'>";
echo "<span class = 'icon icon63' /> <a href = '/user/stat.php'>Назад</a>";
echo "</div>";
break;
case 'ok':
$select = abs(intval($_GET['select']));
if ($select == 1) {
$price = $user['money'] - 100;
}
if ($select == 2) {
$price = $user['money'] - 100;
}
if ($select == 3) {
$price = $user['money'] - 100;
}
if ($select == 4) {
$price = $user['money'] - 100;
}
if ($select == 5) {
$price = $user['money'] - 100;
}
if ($select == 6) {
$price = $user['money'] - 100;
}
if ($select == 7) {
$price = $user['money'] - 200;
}
if ($select == 8) {
$price = $user['money'] - 100;
}
if ($select == 9) {
$price = $user['money'] - 100;
}
if ($select == 10) {
$price = $user['money'] - 100;
}
if ($select == 11) {
$price = $user['money'] - 100;
}
if ($select == 12) {
$price = $user['money'] - 100;
}
if ($select == 13) {
$price = $user['money'] - 100;
}
if ($select == 14) {
$price = $user['money'] - 100;
}
if ($select == 15) {
$price = $user['money'] - 100;
}
if ($select == 16) {
$price = $user['money'] - 100;
}
if ($select >= 1 AND $select <= 3) {
if ($price >= 0) {
echo "Стат успешно куплен!<br />";
echo "<a href = '/info.php'>В анкету →</a>";
mysql_query("UPDATE `stat` SET `stat_id` = '$select', `time` = '$time' WHERE `user_id` = '" . $user['id'] . "'");
mysql_query("UPDATE `user` SET `money` = '$price' WHERE `id` = '" . $user['id'] . "'");
} else {
echo "Операция не выполнена";
}
} else {
echo "Операция не выполнена";
}
break;
default:
echo "<div class = 'razd'>";
echo "Стат - это мини картинка, которая появится на вашей странице... И будет видна всем<br />";
if (isset($user)) {
echo "<form method = 'post' name = 'message' action = '?act=buy'>";
echo "<button class = 'button'>";
echo "<span class = 'label'>Выбрать</span>";
echo "</button></form>n";
}
echo "</div><div class = 'razd'>";
echo "<span class = 'icon icon63' /> <a href = '/umenu.php'>Кабинет</a>";
echo "</div>";
if (!isset($stat['user_id'])) {
mysql_query("INSERT INTO `stat` SET `user_id` = '" . $user['id'] . "'");
}
break;
}
require_once '../sys/inc/tfoot.php';