Файл: podarok_pers.php
Строк: 98
<?php
include 'inc/mysql.php';
include 'inc/check.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;
}
echo'<div class="menudiv">Подарки '.$acc[login].'</div>';
echo'<div class="text2">';
$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> нет подарков.</div><br />";
echo '<center>';
echo '<a href="podarok.php?id2='.$acc[id].'" class="menu_j"><img src="pic/main/podarok.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Подарить подарок '.$acc[login].'</a>';
echo '<a href="infa.php?id='.$acc[id].'" class="menu_j"><img src="pic/main/rotate.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Вернуться к '.$acc[login].'</a>';
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'<img src="pic/index/!.png" alt="*"/> Нет такого персонажа!';
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 ' <img src="pic/main/timereg.png" alt="*"/> <font color=00CC00><small>('.$msg[times].')</small></font>';
echo '<br>';
echo'<img src="http://'.$_SERVER[SERVER_NAME].''.$msg[podarok].'" style = "width:40px; height:40px;float:left;margin-left:0px;margin-bottom:2px;margin-right:6px;" alt="ID:lake_8"/>';
echo "<img src='pic/main/otzuv.png' alt='*'/> $froms3";
echo'<div style="clear:both"></div><div class="separ2"></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><br />';
echo '<center>';
echo'<a href="podarok.php?id2='.$acc[id].'" class="menu_j"><img src="pic/main/podarok.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Подарить подарок '.$acc[login].'</a>';
echo'<a href="infa.php?id='.$acc[id].'" class="menu_j"><img src="pic/main/rotate.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Вернуться к '.$acc[login].'</a>';
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>