Файл: may_podarok.php
Строк: 80
<?php
include 'inc/mysql.php';
include 'inc/check.php';
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'inc/shapka.php';
echo'<div class="menudiv">Подарки</div>';
switch($_GET[mod]){
default:
echo'<div class="text2">';
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: may_podarok.php"); exit;
}else{
header ("Location: may_podarok.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='*'/> У тебя нет подарков.</div>";
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'<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 ' <a href="?go=delete&id='.$msg['id'].'"><img src='pic/main/!.png'></a> <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='.$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>';
echo ' </div>';
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>