Файл: 3/my_podarok.php
Строк: 55
<?php
require_once ('system/func.php');
$title = 'Подарки';
require_once ('system/header.php');
auth(); // Закроем от гостей
echo'<div class="lent mlra w80">
<div class="bl-ttl"><div class="te"><div class="ttl">
'.$title.'
</div></div></div>';
switch($_GET[mod]){
default:
echo'<div class="block">';
if($_GET['go']=='delete_ok'){
if(isset($_GET['id'])){
$del = num($_GET['id']);
}
if($del){
$db->query("DELETE FROM `podarok_ok` WHERE `id`='".$del."' and `usr`='".$user[id]."' ");
header ("Location: /my_gift"); exit;
}else{
header ("Location: /my_gift"); exit;
}
}
if($_GET['go']=='delete'){
if(isset($_GET['id'])){
$del = num($_GET['id']);
}
if($del){
echo"Вы собираетесь удалить подарок!</div>";
echo "<table style='width:100%;'><tr>";
echo"<td style='width: 33%;' class='center'>
<a class= 'btn-blue' href='?go=delete_ok&id=".$del."'>".ico('icons','ok.png')." Удалить</a></td>";
echo"<td style='width: 33%;' class='center'>
<a class= 'btn-blue' href='?'>".ico('icons','no.png')." Отмена</a></td>";
echo "</tr></table></div>";
require_once ('system/footer.php');
exit;
}else{
header ("Location: /my_gift"); exit;
}
}
$result = $db->query("SELECT * FROM `podarok_ok` WHERE `usr` = '".$user['id']."'")->num_rows;
if ($result == 0)
{
echo "<img src='images/icons/city.png' alt='*'/> У тебя нет подарков.</div></div>";
require_once ('system/footer.php');
exit;
}
else {
$set['p_str']=5;
$k_post=$db->query("SELECT * FROM `podarok_ok` WHERE `usr` = '".$user['id']."' ")->num_rows;
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$qi = $db->query("SELECT * FROM `podarok_ok` WHERE `usr` = '".$user['id']."' ORDER by `id` DESC LIMIT $start,$set[p_str]");
while($msg=$qi->fetch_assoc())
{
$from = strip_tags($msg['nick']);
$froms = strip_tags($msg['times']);
$froms2 = strip_tags($msg['podarok']);
$froms3 = $msg['coment'];
$froms3 =text_msg($froms3);
$req = $db->query("SELECT * FROM `users` WHERE `id` = '".$from."'");
////////////////////////////
$avto=$req->num_rows;
if($avto=="0"){
echo'<img src="images/icons/city.png" alt="*"/> Нет такого персонажа!</div></div>';
require_once ('system/footer.php');
exit;
}
$usdata = $req->fetch_assoc();
$req = $db->query("SELECT * FROM `users` WHERE `id` = '".$from."'");
$pic = $req->fetch_assoc();
echo "<div class='fight'>От: ";
$nik='<span style="text-shadow: 1px 0 10px #'.$pic[gradient2].';">'.gradient(''.$pic[login].'',''.$pic[gradient1].'', ''.$pic[gradient2].'').'</span>';
echo icons_user($pic[id])." <a href='/profile/$pic[id]'>".$nik."</a> ";
echo ico('icons','timereg.png').' <font color=00CC00><small>('.$msg[times].')</small></font>';
echo ' <a href="?go=delete&id='.$msg['id'].'">'.ico('icons','no.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 ico('icons','otzuv.png')." $froms3";
echo'<div style="clear:both"></div></div>';
}}
if($k_post>10){
str('?',$k_page,$page); // Вывод страниц
}
echo ' </div>';
}
echo ' </div>';
require_once ('system/footer.php');
?>