Файл: public_html/modules/alliance/journal.php
Строк: 37
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
allianceStatus(1);
$header = "Журнал альянса";
include_once ($root.'/core/head.php');
if(isset($_GET['clear']))
{
if($u['alliance_rank'] < 4) redirect('/alliance/journal');
$db->query("DELETE FROM `alliance_journal` WHERE `alliance` = '".$u['alliance_id']."'");
redirect('/alliance/journal', 'Журнал очищен!');
}
$count = $db -> query("SELECT * FROM `alliance_journal` WHERE `alliance` = '".$u['alliance_id']."'") -> num_rows;
$k_page = k_page($count,10);
$page = page($k_page);
$start = 10*$page-10;
$sql = $db -> query("SELECT * FROM `alliance_journal` WHERE `alliance` = '".$u['alliance_id']."' ORDER BY `time` DESC LIMIT $start, 10");
while($q = $sql->fetch_object())
{
echo '<div class="b">['.tm($q->time).'] '.$q->msg.'</div>
<div class="line"></div>';
}
if($count == 0) echo '<div class="b">Нет записей!</div>';
if($count >= 10) echo str('/alliance/journal/?', $k_page, $page);
if($u['alliance_rank'] >= 4) echo '<a class="link" href="?clear">Очистить журнал</a>';
include_once ($root.'/core/foot.php');