function AllyPage_Home()
{
    global $GlobalUser;
    global $session;
    global $ally;
    $now = time();
    $members = CountAllyMembers($ally['ally_id']);
    $rank = LoadRank($GlobalUser['ally_id'], $GlobalUser['allyrank']);
    $result = EnumApplications($ally['ally_id']);
    $apps = dbrows($result);
    ?>
<script src="js/cntchar.js" type="text/javascript"></script><script src="js/win.js" type="text/javascript"></script>
<?php 
    if ($ally['imglogo'] !== "") {
        ?>
<tr><th colspan=2><img src="/game/img/preload.gif" class="reloadimage" title="pic.php?url=<?php 
        echo $ally['imglogo'];
        ?>
"></td></tr>
<?php 
    }
    ?>
<table width=519>
<tr><td class=c colspan=2>Ваш альянс</td></tr>
<tr><th>Аббревиатура</th><th><?php 
    echo $ally['tag'];
    if ($now < $ally['tag_until']) {
        echo " (бывш. " . $ally['old_tag'] . ")";
    }
    ?>
</th></tr>
<tr><th>Имя</th><th><?php 
    echo $ally['name'];
    if ($now < $ally['name_until']) {
        echo " (бывш. " . $ally['old_name'] . ")";
    }
    ?>
</th></tr>
<tr><th>Члены</th><th><?php 
    echo $members;
    if ($rank['rights'] & 0x8) {
        echo " (<a href=\"index.php?page=allianzen&session={$session}&a=4\">список членов</a>)";
    }
    ?>
</th></tr>
<tr><th>Ваш ранг</th><th><?php 
    echo $rank['name'];
    if ($rank['rights'] & 0x20) {
        echo " (<a href=\"index.php?page=allianzen&session={$session}&a=5\">управление альянсом</a>)";
    }
    ?>
</th></tr>
<?php 
    if ($apps > 0) {
        ?>
<tr><th>Заявки</th><th><a href="index.php?page=bewerbungen&session=<?php 
        echo $session;
        ?>
"><?php 
        echo $apps;
        ?>
 Заявление (-я)</a></th></tr>
<?php 
    }
    if ($rank['rights'] & 0x80) {
        ?>
<tr><th>Общее сообщение</th><th><a href="index.php?page=allianzen&session=<?php 
        echo $session;
        ?>
&a=17">Послать общее сообщение</a></th></tr>
<?php 
    }
    ?>
<tr><th colspan=2 height=100><?php 
    echo bb($ally['exttext']);
    ?>
</th></tr>
<tr><th>Домашняя страница</th><th><a href="redir.php?url=<?php 
    echo $ally['homepage'];
    ?>
" target="_blank"><?php 
    echo $ally['homepage'];
    ?>
</a></th></tr>
<tr><td class=c colspan=2>Внутренняя компетенция</th></tr><tr><th colspan=2 height=100><?php 
    echo bb($ally['inttext']);
    ?>
</th></tr>
</table><br>
<?php 
    if ($GlobalUser['allyrank'] != 0) {
        ?>
<table width=519>
<form action="index.php?page=allianzen&session=<?php 
        echo $session;
        ?>
&a=3" method=POST>
<tr><td class=c colspan=2>Покинуть этот альянс</td></tr><tr><th colspan=2><input type=submit value="Да!"></th></tr></table></form>
<?php 
    }
}
        $query = "UPDATE " . $db_prefix . "users SET ally_id = {$ally_id}, allyrank = 1, joindate = {$now} WHERE player_id = {$player_id}";
        dbquery($query);
        RemoveApplication($show);
    }
    if ($_POST['aktion'] === "Отклонить" && $show > 0) {
        $app = LoadApplication($show);
        RemoveApplication($show);
        // Выслать сообщение об отказе.
        $reason = "-причина не указана-";
        if ($_POST['text'] !== "") {
            $reason = $_POST['text'];
        }
        SendMessage($app['player_id'], va("Альянс [#1]", $ally['tag']), va("Регистрация [#1] отклонена", $ally['tag']), $reason, 0);
    }
}
$result = EnumApplications($ally['ally_id']);
$apps = dbrows($result);
if ($apps > 0) {
    ?>

<!-- CONTENT AREA -->
<div id='content'>
<center>
<table width=519>
<tr><td class=c colspan=2>Обзор регистрации в этом альянсе [<?php 
    echo $ally['tag'];
    ?>
]</td></tr>
<?php 
    if ($show > 0) {
        $app = LoadApplication($show);