<?php
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
$set['title']='FM История';
include_once '../../sys/inc/thead.php';
title();
err();
aut();
include_once 'online.php';

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_ist`"), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)echo '<div class="menu">Нет игры!</div>';
$q = mysql_query("SELECT * FROM `fm_ist` ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($f = mysql_fetch_array($q))
{
$klubi1 = mysql_fetch_array(mysql_query("SELECT * FROM `fm_club` WHERE `id` = '$f[club1]' LIMIT 1"));
$klubi2 = mysql_fetch_array(mysql_query("SELECT * FROM `fm_club` WHERE `id` = '$f[club2]' LIMIT 1"));
if($num==1){
echo "<div class='f1'>";
$num=0;}
else{
echo "<div class='f2'>";
$num=1;}
echo "<a href='club.php?id=$klubi1[id_user]'>$klubi1[name]</a> <b>$f[goli1] - $f[goli2]</b> <a href='club.php?id=$klubi2[id_user]'>$klubi2[name]</a><br />\n";
echo "</div>";
}
if ($k_page>1)str("ist.php?",$k_page,$page); // Вывод страниц
echo "<div class='foot'>";
echo "&#171; <a href='index.php'>Назад</a><br/>";
echo "</div>";

include_once '../../sys/inc/tfoot.php';

?>
