Вход Регистрация
Файл: user.php
Строк: 57
<?

include $_SERVER['DOCUMENT_ROOT']."/template/head.php";


if(isset(
$id))
{    

    if(isset(
$_GET['del']) && $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 unlink("data/photo/".$_GET[del]))
        {
$err='Пользователь, и вся информация о нем успешно удалена!';}
    }
    
    if(isset(
$_GET['add']))
    {
        
mysql_query("insert into `drug_add`(`id_user`,`drug`) values('".$_GET['add']."','$id');");
        
$err="Заявка на добовление в друзья отправлена...";
    }
    
    
    
$max_user_str=30;
    
$page_user=$_GET['page_user'];
    if(empty(
$page_user)){$page_user=0;}
    
$users mysql_query("select * from `user` where `id`!='$id' order by `id` DESC  LIMIT ".$page_user." ,".$max_user_str."");
    
?>
    
    <div id="mhead" class="mhead">
        <div class="btn back">
            <div class="b">
                <div class="title">
                    <h1>Поиск друзей</h1>
                </div>
            </div>
        </div>
    </div>
    <div id="mcont" class="mcont">
        <div class="pcont friends">
            
            <!--<div class="panel">
                <ul class="tabs">
                    <li class="cur">
                        <a href="/friends?section=all" class="al_tab">Все <em></em></a> 
                    </li>
                    <li>
                        <a href="/friends?section=online" class="al_tab">Онлайн <em></em></a> 
                    </li>
                </ul>
                <div class="status"><?=$err?></div>
                <form action="?searsh" class="oneline qsearch">
                    <table>
                        <tr>
                            <td width="100%">
                                <div class="iwrap">
                                    <input id="qsearch_fld" type="text" class="text" name="q" value="" placeholder="Кого ищем?">
                                </div>
                            </td>
                            <td class="last">
                                <input id="qsearch_btn" class="btn" type="submit" value="Искать" />
                            </td>
                        </tr>
                    </table>
                </form>
            </div>-->
            <div class="status"><?=$err?></div>
            <div class="upanel">
                <div class="items bl_cont">
                <?
                
if(mysql_num_rows($users)==0){echo'<div class="panel prof_panel">К сожелению кроме вас больше не кто не зарегестрирован :(</div>';}
                while (
$users_array mysql_fetch_array($users)) 
                {
                    
$prof mysql_fetch_array(mysql_query("select * from `prof` where `id`='$users_array[id]'"));
                    
$drug mysql_query("select * from `drug` where `id_user`='$id' and `drug`='$users_array[id]'");
                
?>
                    <div class="friend">
                        <div class="i">
                            <a class="al" href="wall.php?id=<?=$prof[id]?>"><img src="data/photo/<?=$prof[id]?>/<?=$prof[foto]?>" class="" align="left" /></a>
                        </div>
                        <div class="cont">
                            <a class="user al" href="wall.php?id=<?=$prof[id]?>"><?=$prof[name]?> <?=$prof[fam]?></a><? online($prof[id]); ?>
                            <dl><dt><?online($prof[id]);?></dd></dl>
                            <dl><dt>Город:</dt><dd><?=$prof[gorod]?></dd></dl>
                            <div class="links">
                                <a href="priv.php?id=<?=$prof[id]?>">Написать</a>
                            </div>
                            <?
                            
if(mysql_num_rows($drug)==0)
                            {
                            
?>
                            <div class="links">
                                <a href="user.php?add=<?=$prof[id]?>">Добавить в друзья</a>
                            </div>
                            <?
                            
}
                            if(
$admin)
                            {
                            
?>
                            <div class="links">
                                <a href="user.php?del=<?=$prof[id]?>">Удалить пользователя</a>
                            </div>
                            <?
                            
}
                            
?>
                        </div>
                    </div>
                <?    
                
}
                
$dop_user="where `id`!='$id'";
                
mess_str("user",$max_user_str,$page_user,$dop_user);
                
?>    
                </div>
            </div>
        </div>
    </div>
    <div id="mfoot" class="mfoot">
        <ul class="main_menu footer_menu">
            <li><a href="/">На главную</a></li>
            <li><a href="/?exit">Выход</a></li>
        </ul>
    </div>
    
    
<?
}
include 
$_SERVER['DOCUMENT_ROOT']."/template/foot.php";
?>
Онлайн: 2
Реклама