Файл: podarok_my.php
Строк: 73
<?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($_GET['go']=='delete'){
if(isset($_GET['id'])){
$del = $_GET['id'];
}
if($del){
mysql_query("DELETE FROM `podarok_ok` WHERE `id`='".$del."' and `usr`='".$account[id]."' ");
header ("Location: podarok_my.php"); exit;
}else{
header ("Location: podarok_my.php"); exit;
}
}
$result = mysql_result(mysql_query("SELECT COUNT(*) FROM `podarok_ok` WHERE usr = '$account[id]'"),0);
if ($result == 0)
{
echo "<img src='pic/main/!.png' alt='*'/> У тебя нет подарков.";
include 'inc/nogi.php';
exit;
}
else {
$cop=5;
$ca=mysql_result(mysql_query("SELECT COUNT(*) FROM `podarok_ok` WHERE `usr` = '$account[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` = '$account[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 ' <a href="?go=delete&id='.$result['id'].'"><img src='pic/main/zon.png'></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='.$account[id].'&page='.($page-1).'"><</a> ';
}
if($page-1>0){
echo '<a href="?id='.$account[id].'&page='.($page-1).'">'.($page-1).'</a> ';
}
echo '<b>'.$page.'</b>';
if($page+1<=$cp){
echo ' <a href="?id='.$account[id].'&page='.($page+1).'">'.($page+1).'</a>';
}
if($page+1<=$cp){
echo ' <a href="?id='.$account[id].'&page='.($page+1).'">></a>';
}
echo ' </center>';
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>