<?
require_once '../core/system.php';
require_once 'sys.php';
echo only_reg();
if($user['clan_id'] == 0) {
    header("Location: /clan");
    exit();
} 

$clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$user['clan_id']."' LIMIT 1"));
$header = 'Журнал казны клан "'.$clan['name'].'"';
require_once '../core/head.php';

echo '<div class="player menuList">';
$k_post = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `jr_kazna` WHERE `clan_id` = '".$user['clan_id']."'"), 0);
    
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
    

$q = mysql_query("SELECT *, DATE_FORMAT(date, '%d.%m %H:%i') AS `date1` FROM `jr_kazna` WHERE `clan_id` = '".$user['clan_id']."' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while($rowu = mysql_fetch_assoc($q)) {
    $nick = mysql_fetch_assoc(mysql_query("SELECT `nick`, `storona`, `clan_prava` FROM `user` WHERE `id` = '".$rowu['user_id']."' LIMIT 1"));
    echo '<li><img src="/images/icon/'.$nick['storona'].'.png" width="12" height="12" />
    '.$nick['nick'].' ('.$rowu['date1'].'): '.$rowu['gold'].' золото, '.$rowu['kamni'].' камень </span></li>';
}
echo '</div>';
    
if ($k_page>1){
    echo "<div class='dot-line'></div>";
    str('?',$k_page,$page);
}

include '../core/foot.php';