<?php

define('_IN_JOHNCMS', 1);
$headmod = 'manager';
$textl='O`yin'; require_once("../incfiles/core.php");
require_once("manfunc.php"); require_once("../incfiles/head.php");
if($act=="p" || $act=="b"){
if(!$id)$id=$club_id;
if($act=="p")$te="Tugagan";
if($act=="b")$te="Bo`lajak";
$qt=mysql_query("select name from fman_clubs where id=$id;");
$tdata=mysql_fetch_array($qt);
echo"<h2 align='center'>$te o`yinlar $tdata[name]</h2>";
if($act=="p"){$q=mysql_query("select * from fman_matches where end=1 and (id1=$id or id2=$id) order by time desc limit $start,$kmess;");

$total=mysql_result(mysql_query("select count(*) from fman_matches where end=1 and (id1=$id or id2=$id);"),0);}
if($act=="b"){$q=mysql_query("select * from fman_matches where end=0 and (id1=$id or id2=$id) order by time asc limit $start,$kmess;");
$total=mysql_result(mysql_query("select count(*) from fman_matches where end=0 and (id1=$id or id2=$id);"),0);}
if($q){
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('matches.php?act='.$act.'&amp;id='.$id.'&amp;', $start, $total, $kmess) . '</div>';}
while($a=mysql_fetch_array($q)){
$t=turn($a[turn],$a[tur],$a[land]);
if($a[id1]==$id)$team=$a[kom1];
if($a[id2]==$id)$team=$a[kom2];
match($a,$id,$t);}}
echo '<div class="bmenu">Hammasi: ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('matches.php?act='.$act.'&amp;id='.$id.'&amp;', $start, $total, $kmess) . '</div>' .
'<form action="matches.php?act='.$act.'&amp;id='.$id.'" method="post"><p>' .
'<input type="text" name="page" size="2"/>' .
'<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' .
'</p></form>';}
echo"<div class='phdr'><a href='club.php?id=$id'>$tdata[name]</a><br/>
<a href='index.php'>Futbol Menejer</a></div>";}
if($act!="b" && $act!="p"){
$tur=$_GET[tur];
$q=mysql_query("select * from fman_matches where turn='champ' and tur=$tur and land='$act' order by kom1 asc;");
echo"<h2 align='center'>".turn('champ',$tur,$act)."</h2>";
if($q){
while($a=mysql_fetch_array($q)){
match($a,$club_id,0);}}
echo"<div class='phdr'><a href='table.php?act=champ&amp;land=$act'>".turn("champ",0,$act)."</a><br/>
<a href='index.php'>Futbol Menejer</a></div>";}
require_once("../incfiles/end.php"); ?>
