<?
include 'config.php';
include 'func.php';
head();
aut();
ban();
////////////////////////

if ( $_GET['mod'] == 'clan' ) $title = 'Приглашение в группу';

echo head . $title . div;

$mod = html($_GET['mod']);

$result = mysql_query("SELECT * FROM uvedom WHERE `mod` = '".$mod."' AND `user` = '".$id_session."'");

while($a = mysql_fetch_assoc($result)){
    $clan_info = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$a['mod_id']."'"));
    
    echo '<div class="'.($i++ % 2 ? 'link1' : 'link2').'">';
    echo "<img src='http://".$_SERVER['HTTP_HOST']."/clan/logo/".$a['url_file']." ' WIDTH=40 HEIGHT=40 alt='.'/><br/ >";
    echo 'Название: <a href="http://'.$_SERVER['HTTP_HOST'].'/clan/view.php?id='.$clan_info['id'].'">'.$clan_info['name'].'</a><br/ >';
    $all_users = mysql_result(mysql_query("SELECT count(*) FROM clans_user WHERE `clan` = '".$clan_info['id']."'"), 0);
    echo 'Участников: <a href="http://'.$_SERVER['HTTP_HOST'].'/clan/users.php?id='.$clan_info['id'].'">'.$all_users.'</a><br/ >';
    if ( $a['private'] == 0) 
    $status = 'Открытая';
    else
    $status = 'Закрытая';
    echo 'Тип: '.$status.'<br/ ><br/ >';
    echo '<a href="http://'.$_SERVER['HTTP_HOST'].'/clan/add_user.php?id='.$clan_info['id'].'">Вступить</a> | <a href="http://'.$_SERVER['HTTP_HOST'].'/clan/view.php?id='.$clan_info['id'].'">Отклонить</a><br/ >';
    echo div;
    
    }
////////////////////////

pod_navig();
foot();
?>