Файл: friend.php
Строк: 45
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Друзья';
include($path.'files/core.php');
if(isset($_GET['del']))
{
mysql_query("DELETE FROM `friend` WHERE `usr`='".$udata['id']."' and `id`='".$_GET['id']."'");
header('location: ?');exit;
}
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<table width=100%>
<tr>
<td width=35%>
<a href=game.php><div style="background: #882222; border-radius: 7px 0 0 7px" class="m p bts bbs brs bls" align=center>Главная</div></a>
</td><td>';
echo '<a href=?><div class="line bts brs bls bbs p m" style="border-radius: 0 7px 7px 0">
<font color=#ffffff>Друзья
</font>
</div></a></td></tr></table>';
echo '<div class="bat bts brs bls bbs p">';
switch($_GET['fr'])
{
default:
if ($_GET['page'] == "" || $_GET['page'] < 0 || $_GET['page'] == "0")
{
$_GET['page'] = 0;
}
$next = $_GET['page'] + 1;
$back = $_GET['page'] - 1;
$num = $_GET['page'] * 10;
if($_GET['page'] == "0")
{$i = 1;}
else{$i = ($_GET['page']*10)+1;}
$viso = mysql_num_rows(mysql_query("SELECT * FROM friend"));
$puslap = floor($viso/10);
$frid=mysql_query("SELECT * FROM `friend` WHERE `usr`='".$udata['id']."' ORDER BY `id` DESC LIMIT $num,10");
while($fr=mysql_fetch_array($frid))
{
$users=mysql_query("SELECT * FROM `users` WHERE `id`='".$fr['usr2']."'");
$us=mysql_fetch_array($users);
if($us['admin']>0 and $us['admin']<6)
{
echo '<img src=img/main/md.png> ';
}
if($us['admin']>5)
{
echo '<img src=img/main/admin.png> ';
}
echo '<img src=img/main/c'.$us['klass'].'.png> <img src=img/main/r'.$us['rasa'].'.png>
<a href=info.php?id='.$us['id'].'>'.$us['usr'].'</a> <img src=img/main/p10.png>'.$us['lvl'].' <a href=?del&id='.$fr['id'].'>[x]</a><br>';
}
if ($_GET['page'] > 0)
{
echo "<a href="?page=$back">Назад</a>";
}
elseif ($_GET['page'] == 0)
{
echo "Назад";
}
echo" | ";
if($_GET['page'] < $puslap || $_GET['page'] == "" || $_GET['page'] == 0)
{echo "<a href="?page=$next">Далее</a>";}
else
{echo "Далее";}
echo '<br><br>
<img src=img/main/e55.png> <a href=gift.php>Сделать подарок</a><br>
';
break;
}
echo '</div></div>';
include('files/down.php');
?>