<?php
/*Онлайн игра Football Manager под DCMS версии 6.6.4

 *ВНИМАНИЕ!!! Данный скрипт нельзя распространять, нельзя продавать, менять и т.д.

 *Автор скрипта: Doctor

 *Тех поддержка: 

 *icq: 624552318

 *e-mail: dudringvala@yahoo.com

 *skype: isevgio

 */
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';
if (!isset($user) && !isset($_GET['id'])){header("Location: index.php?".SID);exit;}
if (isset($_GET['id']))$id=intval($_GET['id']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_chempionat` WHERE `id` = '$id' LIMIT 1"),0)==0){header("Location: index.php?".SID);exit;}

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_chempionat_game` where `id_chempionat` = '$id'"), 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_chempionat_game` where `id_chempionat` = '$id' 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[id_club1]' LIMIT 1"));
$klubi2 = mysql_fetch_array(mysql_query("SELECT * FROM `fm_club` WHERE `id` = '$f[id_club2]' LIMIT 1"));
if($num==1){
echo "<div class='frends'>";
$num=0;}
else{
echo "<div class='frends2'>";
$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("games.php?id=$id&amp;",$k_page,$page); // Вывод страниц
echo "<div class='foot'>";
echo "&#171; <a href='chempionat.php?id=$id'>Назад</a><br/>";
echo "</div>";

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

?>
