Файл: setk/user/money/nevidimka.php
Строк: 87
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/adm_check.php';
include_once '../../sys/inc/user.php';
$set['title']='Здесь Вы можете купить себе услугу Невидимка';
include_once '../../sys/inc/thead.php';
title();
if (!isset($user))
header("location: /index.php?");
err();
echo "<div class='act'>";
echo "<a class='act_noactive' href='/user/money/index.php'>Дополнительные услуги</a>";
echo'<a class="act_active">Невидимка</a>';
echo"</div>";
aut();
if (isset($user))
{
if (isset($_POST['stav']))
{
if ($_POST['stav']==1)
{
$st=1;
$tm=$time+86400;
}
else if ($_POST['stav']==2)
{
$st=2;
$tm=$time+172800;
}
else if ($_POST['stav']==3)
{
$st=3;
$tm=$time+259200;
}
else if ($_POST['stav']==4)
{
$st=4;
$tm=$time+345600;
}
else if ($_POST['stav']==5)
{
$st=5;
$tm=$time+432000;
}
else if ($_POST['stav']==6)
{
$st=6;
$tm=$time+518400;
}
else if ($_POST['stav']==7)
{
$st=7;
$tm=$time+604800;
}
if ($user['money']>=$st)
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_nevidimka` WHERE `id_user` = '$user[id]'"), 0)==0) {
mysql_query("INSERT INTO `user_nevidimka` (`id_user`, `anonim`, `time`) values('$user[id]', '1', '$tm')");
} else
mysql_query("UPDATE `user_nevidimka` SET `time` = '$tm', `anonim` = '1' WHERE `id_user` = '$user[id]'");
mysql_query("UPDATE `user` SET `money` = '".($user['money']-$st)."' WHERE `id` = '$user[id]' LIMIT 1");
$_SESSION['message'] = 'Поздравляем, вы успешно подключили услугу';
header("Location: index.php?");
exit;
}else{
$err='У вас не достаточно средств';
}
}
err();
echo"<div class='hide2'>n";
echo "Услуга невидимка<br /> 1 $sMonet[1] = 1 день пользования превилегией.";
echo"</div>n";
$c2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `user_nevidimka` WHERE `id_user` = '$user[id]' AND `time` > '$time'"), 0);
if ($c2 == 0)
{
echo "<div class='na1'><form method="post" action="?">n";
echo 'Ставка: <select name="stav">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select> ' . $sMonet[0] . '<br />';
echo "<input value="Купить услугу" type="submit" />n";
echo "</form></div>n";
}else{
echo"<div class='advertising'>n";
echo "Услуга подключена";
echo"</div>n";
}
}
include_once '../../sys/inc/tfoot.php';
?>