Файл: user/settings/stat.php
Строк: 113
<?php
/* Мод "Статы"
* Версия v0.0.1
* Дата последнего редактирования 20.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Файл stat.php
* Описание: дает возможность пользователю, ставить мини картинки на своей странице, на обозрение всем
*/
require_once '../../sys/inc/start.php';
require_once H . 'sys/inc/compress.php';
require_once H . 'sys/inc/sess.php';
require_once H . 'sys/inc/settings.php';
require_once H . 'sys/inc/db_connect.php';
require_once H . 'sys/inc/ipua.php';
require_once H . 'sys/inc/fnc.php';
require_once H . 'sys/inc/user.php';
$set['title'] = 'Статы';
user::only_reg();
require_once H . 'sys/inc/thead.php';
title();
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 = 'razd'>";
echo img16('money.png') . " Ваши монеты: $user[money] (<font color = 'yellow'>Вам скидки нет</font>)<br />";
echo "Выберите себе стат. Картинка будет на вашей странице 7 дней";
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=1'>";
} else {
echo "";
}
echo "<img src = '/style/stat/1.png' /><br />";
echo "Балалайка (100 монет)<br />";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=2'>";
} else {
echo "";
}
echo "<img src = '/style/stat/2.png' /><br />";
echo "Козина (100 монет)<br />";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=3'>";
} else {
echo "";
}
echo "<img src = '/style/stat/3.png' /><br />";
echo "Бабочка (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=4'>";
} else {
echo "";
}
echo "<img src = '/style/stat/4.png' /><br />";
echo "Пасха (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=5'>";
} else {
echo "";
}
echo "<img src = '/style/stat/5.png' /><br />";
echo "Колокол (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=6'>";
} else {
echo "";
}
echo "<img src = '/style/stat/6.png' /><br />";
echo "Дельфин (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=7'>";
} else {
echo "";
}
echo "<img src = '/style/stat/7.png' /><br />";
echo "Яйцо (200 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=8'>";
} else {
echo "";
}
echo "<img src = '/style/stat/8.png' /><br />";
echo "Слон (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=9'>";
} else {
echo "";
}
echo "<img src = '/style/stat/9.png' /><br />";
echo "Гиппопотам (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=10'>";
} else {
echo "";
}
echo "<img src = '/style/stat/10.png' /><br />";
echo "Матрешка (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=11'>";
} else {
echo "";
}
echo "<img src = '/style/stat/11.png' /><br />";
echo "Панда (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=12'>";
} else {
echo "";
}
echo "<img src = '/style/stat/12.png' /><br />";
echo "Заяц (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=13'>";
} else {
echo "";
}
echo "<img src = '/style/stat/13.png' /><br />";
echo "Самовар (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=14'>";
} else {
echo "";
}
echo "<img src = '/style/stat/14.png' /><br />";
echo "Серп и Молот (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=15'>";
} else {
echo "";
}
echo "<img src = '/style/stat/15.png' /><br />";
echo "Черепаха (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div><div class = 'razd'>";
if ($user['money'] >= 100) {
echo "<a href = '?act=ok&select=16'>";
} else {
echo "";
}
echo "<img src = '/style/stat/16.png' /><br />";
echo "Валенки (100 монет)<br/>";
if ($user['money'] >= 100) {
echo "</a>";
} else {
echo "";
}
echo "</div>";
echo "<div class = 'razd'><a class = 'add' href = '/user/stat.php'>" . img16('left.png') . " Назад</a></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 <= 16) {
if ($price >= 0) {
echo "<div class = 'msgs'>";
echo "Стат успешно куплен!<br />";
echo "<a href = '/info.php'>" . img16('left.png') . " В профиль</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'] . "'");
echo "</div>";
} else {
echo "<div class = 'errs'>";
echo "Операция не выполнена";
echo "</div>";
}
} else {
echo "<div class = 'errs'>";
echo "Операция не выполнена";
echo "</div>";
}
break;
default:
if (isset($user)) {
echo "<form method = 'post' class = 'razd' name = 'message' action = '?act=buy'>";
echo "Стат - это мини картинка, которая появится на вашей странице... И будет видна всем<br />";
echo "<button class = 'button sign-ins'>Выбрать";
echo "</button></form>n";
}
echo "<div class = 'razd'><a class = 'add' href = '/umenu.php'>" . img16('left.png') . " Кабинет</a></div>";
if (!isset($stat['user_id'])) {
mysql_query("INSERT INTO `stat` SET `user_id` = '" . $user['id'] . "'");
}
break;
}
require_once H . 'sys/inc/tfoot.php';