<?
include $_SERVER['DOCUMENT_ROOT']."/template/head.php";
if(isset($id))
{
$max_user_str=30;
$page_user=$_GET['page_user'];
if(empty($page_user)){$page_user=0;}
if(!empty($_GET['del']) && !empty($admin))
{
if(mysql_query("delete from user where id='$_GET[del]'") and mysql_query("delete from prof where id='$_GET[del]'")
and mysql_query("delete from priv where id_user='$_GET[del]' or komu='$_GET[del]' or ot_kogo='$_GET[del]'")
and mysql_query("delete from mail where id_user='$_GET[del]' or contact='$_GET[del]'")
and mysql_query("delete from sten where id_user='$_GET[del]'") and rmdir("data/photo/".$_GET[del]))
{echo'Пользователь, и вся информация о нем успешно удалена!';}
}
$result_prof = mysql_query("select * from `prof` order by `id` DESC LIMIT ".$page_user." ,".$max_user_str."");
while ($prof_user = mysql_fetch_array($result_prof))
{
echo '<br/><table width="100%"><tr><td valign="top" width="30%" align="left">';
echo'<a href="anketa.php?id='.$prof_user[id].'">';
photo($prof_user[foto],$prof_user[id]);
echo'</a><br>';
echo '</td><td valign="top" width="55%" align="left">';
echo'<a href="anketa.php?id='.$prof_user[id].'">'.$prof_user[name].' '.$prof_user[fam].'</a><br/>';
online($prof_user[id]);
echo '</td><td valign="top" width="15%" align="left">';
echo '<a href="priv.php?id='.$prof_user[id].'">отправить сообщение</a><p>';
if($admin){echo'<a href="user.php?del='.$prof_user[id].'">Удалить id'.$prof_user[id].'</a><br/>';}
echo '</td></tr></table>';
}
mess_str("prof",$max_user_str,$page_user);
}
include $_SERVER['DOCUMENT_ROOT']."/template/foot.php";
?>