Файл: podarok_infa.php
Строк: 91
<?php
include 'inc/mysql.php';
include 'inc/check.php';
include ("inc/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'inc/shapka.php';
switch($_GET[mod]){
default:
if (intval($_GET['id'])==$account['id']){
header("Location: /personaj.php");
exit;
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `account` WHERE `id`='".intval($_GET['id'])."'"),0)){
$acc=mysql_fetch_assoc(mysql_query("SELECT * FROM `account` WHERE `id`='".intval($_GET['id'])."'"));
}else{
header('Location: games.php?');
exit;
}
$result = mysql_result(mysql_query("SELECT COUNT(*) FROM `podarok_ok` WHERE usr = '$acc[id]'"),0);
if ($result == 0)
{
echo "<img src='/pic/main/!.png' alt='*'/> У персонажа <b>$acc[login]</b> нет подарков.";
echo'<div class="ssl">';
echo '<a class="navi" href="podarok.php?id2='.$acc[id].'">  <img src="/pic/main/gifts.png" alt="*"/> Подарить подарок '.$acc[login].'</a></div>';
echo'<div class="ssl">';
echo '<a class="navi" href="infa.php?id='.$acc[id].'">  <img src="/pic/main/rotate.png" alt="*"/> Вернуться к '.$acc[login].'</a></div>';
include 'inc/nogi.php';
exit;
}
else {
$cop=5;
$ca=mysql_result(mysql_query("SELECT COUNT(*) FROM `podarok_ok` WHERE `usr` = '$acc[id]' "),0);
$cp=ceil($ca/$cop);
if(isset($_GET['page']) && is_numeric($_GET['page'])){
$page = $_GET['page'];
if($_GET['page']>$cp) $page=$cp;
if($_GET['page']<1)$page=1;
}else{
$page=1;
}
$start=$page*$cop-$cop;
$dlist = 'list1';
$qi = mysql_query("SELECT * FROM `podarok_ok` WHERE `usr` = '$acc[id]' ORDER by `id` DESC LIMIT $start,$cop ");
while($msg=mysql_fetch_array($qi))
{
$from = strip_tags($msg['nick']);
$froms = strip_tags($msg['times']);
$froms2 = strip_tags($msg['podarok']);
$froms3 = $msg[coment];
$coment = strip_tags($msg['froms3']);
$froms3 = smiles($froms3);
$req = mysql_query("SELECT * FROM `account` WHERE `id` = '$from'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo'Нет такого персонажа!';
include 'inc/nogi.php';
exit;
}
$usdata = mysql_fetch_array($req);
$req = mysql_query("SELECT `login`,`status`,`sex`,`id` FROM `account` WHERE `id` = '$from'");
$pic = mysql_fetch_array($req);
echo "От: ";
if($pic['status']=="gm"){
$nik = gradient(''.$pic[login].'','00FF00', '00CC00');
echo '<us><img src="pic/main/'.$pic[sex].'.png" alt="*"/><a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a>';
}else{
if($pic['status']=="moder"){
$nik = gradient(''.$pic[login].'','0066CC', 'AB82FF');
echo '<us><img src="pic/main/'.$pic[sex].'.png" alt="*"/><a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a>';
}else{
if($pic['status']=="bot"){
$nik = gradient(''.$pic[login].'','FFCC00', 'FF9933');
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a>';
}else{
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'">'.htmlspecialchars(stripslashes($pic['login'])).'</a>';
}}}
echo"<br><img src='http://$_SERVER[SERVER_NAME]$msg[podarok]' alt='*'/>";
echo "<br><img src='pic/main/otzuv.png' alt='*'/> <small>$froms3</small><br>";
echo'<div class="bts"></div>';
}}
echo '
<center>
Навигация:
';if($page-1>0){
echo '<a href="?id='.$acc[id].'&page='.($page-1).'"><</a> ';
}
if($page-1>0){
echo '<a href="?id='.$acc[id].'&page='.($page-1).'">'.($page-1).'</a> ';
}
echo '<b>'.$page.'</b>';
if($page+1<=$cp){
echo ' <a href="?id='.$acc[id].'&page='.($page+1).'">'.($page+1).'</a>';
}
if($page+1<=$cp){
echo ' <a href="?id='.$acc[id].'&page='.($page+1).'">></a>';
}
echo ' </center>';
echo'<div class="ssl">';
echo '<a class="navi" href="podarok.php?id2='.$acc[id].'">  <img src="/pic/main/gifts.png" alt="*"/> Подарить подарок '.$acc[login].'</a></div>';
echo'<div class="ssl">';
echo '<a class="navi" href="infa.php?id='.$acc[id].'">  <img src="/pic/main/rotate.png" alt="*"/> Вернуться к '.$acc[login].'</a></div>';
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>