Файл: selemege.tk/medals/rank.php
Строк: 192
<?
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/user.php';
error_reporting(0);
if (!isset($user) && !isset($_GET['id'])){header("Location: /index.php?".SID);exit;}
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));
if ((!isset($_SESSION['refer']) || $_SESSION['refer']==NULL)
&& isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL &&
!ereg('gifts.php',$_SERVER['HTTP_REFERER']))
$_SESSION['refer']=str_replace('&','&',ereg_replace('^http://[^/]*/','/', $_SERVER['HTTP_REFERER']));
if (isset($user))
{
$p = (isset($_GET['p'])) ? htmlspecialchars($_GET['p']) : null;
switch($p){
case 'send_rank':
include_once '../sys/inc/thead.php';
$set['title']='Наградить'; // заголовок страницы
title();
aut();
if ($user['group_access']>=7){
$pid = intval($_GET['pid']);
if (isset($_GET['go'])){
$curr=date("d.m.y / H:i");
$balls = 0;
$msg=$_POST['msg'];
$ank['id'];
if($ank==0){
msg ('Пользователь не найден :(');
}else{if (isset($user) & $user['balls']<=$balls){
msg ('У Вас не достаточно денег :(');}else{
////////////////////
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']-$balls)."' WHERE `id` = '$user[id]' LIMIT 1",$db);
mysql_query("UPDATE `user` SET `balls` = '".($ank['balls']+1000)."' WHERE `id` = '$ank[id]' LIMIT 1");
////////////////////
mysql_query("INSERT INTO `fin_oper` (`user`, `oper`, `time`, `cena`) values('$user[id]', 'Отправлен подарок $balls KM для $ank[nick]', '$time', '$balls')",$db);
////////////////////
mysql_query("INSERT INTO `rank` (`id_user`, `ot_id`, `text`, `time`, `id_rank`) values('$ank[id]', '$user[id]', '$msg', '$time', '$pid')",$db);
////////////////////
$msgrat="Вас наградил админ! Зайдите на страничку!";
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$msgrat', '$time')");
msg ('Пользователь награжден');
}}
echo '<link rel="stylesheet" type="text/css" href="/style/themes/akc/touch.css"/>';
echo "<div class='gradient_block1 list_item'>";
echo '<a href="/info.php?id='.$ank[id].'">Вернуться к '.$ank['nick'].' </a></div>';
include_once '../sys/inc/tfoot.php';}
echo"<img src='/rank/".$pid.".gif' alt='' class='icon'/>";
echo "<form method="post" action="rank.php?p=send_rank&id=$ank[id]&pid=".$_GET['pid']."&go">";
echo "Награждаем:<b> $ank[nick]</b><br/><br />n";
echo "Ваше сообщение:<br/>";
echo "<input type="text" name="msg" value=""/><br />rn";
echo "<input type="submit" value="Наградить" />";
echo "</form>n";
}
include_once '../sys/inc/tfoot.php';
break;
}
$pod = (isset($_GET['pod'])) ? htmlspecialchars($_GET['pod']) : null;
$set['title']='Награды';
include_once '../sys/inc/thead.php';
title();
aut();
////////////
if ($user['group_access']>=7){
switch($pod) {
case '1':
echo '<link rel="stylesheet" type="text/css" href="/style/themes/akc/touch.css"/>';
echo "<div class='gradient_block1 list_item'>";
echo "<img src='/rank/24.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=24">наградить</a><br/>";
echo "<img src='/rank/25.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=25">наградить</a><br/>";
echo "<img src='/rank/26.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=26">наградить</a><br/>";
echo "<img src='/rank/5.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=5">наградить</a><br/>";
echo "<img src='/rank/6.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=6">наградить</a><br/>";
echo "<img src='/rank/7.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=7">наградить</a><br/>";
echo "<img src='/rank/9.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=9">наградить</a><br/>";
echo "<img src='/rank/10.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=10">наградить</a><br/>";
echo "<img src='/rank/30.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=30">наградить</a><br/>";
echo "<img src='/rank/11.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=11">наградить</a><br/>";
echo "<img src='/rank/12.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=12">наградить</a><br/>";
echo "<img src='/rank/13.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=13">наградить</a><br/>";
echo "<img src='/rank/14.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=14">наградить</a><br/>";
echo "<img src='/rank/15.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=15">наградить</a><br/>";
echo "<img src='/rank/16.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=16">наградить</a><br/>";
echo "<img src='/rank/17.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=17">наградить</a><br/>";
echo "<img src='/rank/18.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=18">наградить</a><br/>";
echo "<img src='/rank/19.gif' alt=''> <a href="rank.php?p=send_rank&id=$ank[id]&pid=19">наградить</a></div>";
}
}
else{
echo "Иди нахер хакер. Нах трогать сайт нормального чела??";
}
}else{
include_once '../sys/inc/thead.php';
$set['title']='Наградить'; // заголовок страницы
title();
aut();
echo'А тебе это и не нужно :) ';}
include_once '../sys/inc/tfoot.php';
?>