View file stats.php

File size: 6.85Kb
<?php
#######################################################
#                            FOOTBALL MANAGER
#                  SPECIAL FOR HTTP://wap-FIFA.IN
######################################################
#                      E-Mail: vbv07@inbox.ru
#                              2009 (c)

require_once"../template/regglobals.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";

echo'<b><center>*Football MANAGER*</center></b><br>';

echo 'Выберите страну:<br>';
$array_c=array('russia' => 'Россия','ukraine' => 'Украина','italy' => 'Италия','england' => 'Англия','spain' => 'Испания','germany' => 'Германия');
$array_z=array('1' => 'Зона 1','2' => 'Зона 2','3' => 'Зона 3');
$array_s=array('1' => 'Турнирная таблица', '2' => 'Список бомбандиров', '3' => 'Список ассистентов');
$c=htmlspecialchars($_REQUEST['c']);
$z=htmlspecialchars($_REQUEST['z']);
echo '<form action="" method="post">
        <select name="z">';
foreach($array_z as $key=>$val)
 	echo '<option value="'.$key.'" '.($z==$key ? 'selected' : '').' >'.$val.'</option>';
echo '</select>
        <select name="c">';
foreach($array_c as $key=>$val)
 	echo '<option value="'.$key.'" '.($c==$key ? 'selected' : '').' >'.$val.'</option>';
echo '</select>
        <select name="s">';
foreach($array_s as $key=>$val)
 	echo '<option value="'.$key.'" '.($s==$key ? 'selected' : '').' >'.$val.'</option>';
echo '</select><br/>
<input type="submit" name="go" value="Выбрать" /><br/>
</form>';

if($c!="" && $z!="")
{
	if($s=='1')
	{
		echo '<hr><br><center>Турнирная таблица - '.$array_c[$c].'&nbsp;('.$array_z[$z].')</center><br>';
		echo '<table>
			<tr><th>№</th><th></th><th>Команда</th><th>И</th><th>МЗ</th><th>МП</th><th>В</th><th>Н</th><th>П</th><th>О</th></tr>';
  $file=file(BASEDIR.'manager/'.$c.'/tt.dat');
		for ($i=0;$i<count($file);$i++)
		{
		    $ex=explode("|",$file[$i]);
		    $j=$i+1;
			if($j==1 || $j==2 || $j==3)
				echo '<tr><th>'.$j.'</th><td><img src="'.BASEDIR.'manager'.$z.'/img/'.$ex[0].'.gif" alt=""></td><td><b>'.$ex[0].'</b></td><td><b>'.$ex[1].'</b>&nbsp;</td><td>&nbsp;<b>'.$ex[2].'</b>&nbsp;</td><td>&nbsp;<b>'.$ex[3].'</b>&nbsp;</td><td>&nbsp;<b>'.$ex[4].'</b>&nbsp;</td><td>&nbsp;<b>'.$ex[5].'</b>&nbsp;</td><td>&nbsp;<b>'.$ex[6].'</b>&nbsp;</td><td>&nbsp;<b>'.$ex[7].'</b>&nbsp;</td></tr>';
			else
			echo '<tr><th>'.$j.'</th><td><img src="'.BASEDIR.'manager'.$z.'/img/'.$ex[0].'.gif" alt=""></td><td>'.$ex[0].'</td><td>'.$ex[1].'&nbsp;</td><td>&nbsp;'.$ex[2].'&nbsp;</td><td>&nbsp;'.$ex[3].'&nbsp;</td><td>&nbsp;'.$ex[4].'&nbsp;</td><td>&nbsp;'.$ex[5].'&nbsp;</td><td>&nbsp;'.$ex[6].'&nbsp;</td><td>&nbsp;'.$ex[7].'&nbsp;</td></tr>';
		}
		echo '</table>';
		echo '<br>';
	}
	else
		if($s=='2')
		{
			echo '<hr><br><center>Список бомбандиров - '.$array_c[$c].'&nbsp;('.$array_z[$z].')</center><br>';
			echo '<table>
				<tr><th>№</th><th></th><th>Игрок</th><th>Команда</th><th>Мячи</th></tr>';
			$file=file(BASEDIR.'manager'.$z.'/'.$c.'/b.dat');
			for ($k=0;$k<count($file);$k++)
            {
             	$vvv=explode("|",$file[$k]);
	       		if (strlen($vvv[0])==1)
          			$file[$k]='00'.$vvv[0].'|'.$vvv[1].'|'.$vvv[2].'|';
               	if (strlen($vvv[0])==2)
                	$file[$k]='0'.$vvv[0].'|'.$vvv[1].'|'.$vvv[2].'|';
            }
           	for ($k=0;$k<count($file);$k++)
           	{
             	$vvv=explode("|",$file[$k]);
	       		if (strlen($vvv[1])==1)
                	$file[$k]=$vvv[0].'|00'.$vvv[1].'|'.$vvv[2].'|';
               	if (strlen($vvv[1])==2)
                	$file[$k]=$vvv[0].'|0'.$vvv[1].'|'.$vvv[2].'|';
            }
	    	rsort($file);
            for ($i=0;$i<20;$i++)
            {
             	$ex=explode("|",$file[$i]);
              	$j=$i+1;
             	$balls=preg_replace('/00+([1-9])/si','$1',$ex[0]);
             	$balls=preg_replace('/0+([1-9])/si','$1',$ex[0]);
			    $player=preg_replace('/00+([1-9])/si','$1',$ex[1]);
             	$player=preg_replace('/0+([1-9])/si','$1',$ex[1]);
				if($j==1 || $j==2 || $j==3)
					echo '<tr><th>'.$j.'</th><td><img src="'.BASEDIR.'manager'.$z.'/img/'.$ex[2].'.gif" alt=""></td><td><b>'.$player.'&nbsp;</b></td><td>&nbsp;<b>'.$ex[2].'</b>&nbsp;</td><td>&nbsp;<b>'.$balls.'</b>&nbsp;</td></tr>';
				else
            		echo '<tr><th>'.$j.'</th><td><img src="'.BASEDIR.'manager'.$z.'/img/'.$ex[2].'.gif" alt=""></td><td>'.$player.'&nbsp;</td><td>&nbsp;'.$ex[2].'&nbsp;</td><td>&nbsp;'.$balls.'&nbsp;</td></tr>';
            }
            echo '</table>';
			echo '<br>';
		}
		else
			if($s=='3')
			{
				echo '<hr><br><center>Список ассистентов - '.$array_c[$c].'&nbsp;('.$array_z[$z].')</center><br>';
				echo '<table>
					<tr><th>№</th><th></th><th>Игрок</th><th>Команда</th><th>Пасы</th></tr>';
       			$file=file(BASEDIR.'manager'.$z.'/'.$c.'/a.dat');
	    		for ($k=0;$k<count($file);$k++)
            	{
             		$vvv=explode("|",$file[$k]);
	       			if (strlen($vvv[0])==1)
                		$file[$k]='00'.$vvv[0].'|'.$vvv[1].'|'.$vvv[2].'|';
               		if (strlen($vvv[0])==2)
                		$file[$k]='0'.$vvv[0].'|'.$vvv[1].'|'.$vvv[2].'|';
            	}
           		for ($k=0;$k<count($file);$k++)
            	{
             		$vvv=explode("|",$file[$k]);
	       			if (strlen($vvv[1])==1)
                		$file[$k]=$vvv[0].'|00'.$vvv[1].'|'.$vvv[2].'|';
               		if (strlen($vvv[1])==2)
                		$file[$k]=$vvv[0].'|0'.$vvv[1].'|'.$vvv[2].'|';
            	}
	    		rsort($file);
	            for ($i=0;$i<20;$i++)
	            {
	             	$ex=explode("|",$file[$i]);
	              	$j=$i+1;
	             	$balls=preg_replace('/00+([1-9])/si','$1',$ex[0]);
	             	$balls=preg_replace('/0+([1-9])/si','$1',$ex[0]);
				    $player=preg_replace('/00+([1-9])/si','$1',$ex[1]);
	             	$player=preg_replace('/0+([1-9])/si','$1',$ex[1]);
					if($j==1 || $j==2 || $j==3)
						echo '<tr><th>'.$j.'</th><td><img src="'.BASEDIR.'manager'.$z.'/img/'.$ex[2].'.gif" alt=""></td><td><b>'.$player.'&nbsp;</b></td><td>&nbsp;<b>'.$ex[2].'</b>&nbsp;</td><td>&nbsp;<b>'.$balls.'</b>&nbsp;</td></tr>';
					else
	            		echo '<tr><th>'.$j.'</th><td><img src="'.BASEDIR.'manager'.$z.'/img/'.$ex[2].'.gif" alt=""></td><td>'.$player.'&nbsp;</td><td>&nbsp;'.$ex[2].'&nbsp;</td><td>&nbsp;'.$balls.'&nbsp;</td></tr>';
	            }
				echo '</table>';
				echo '<br>';
			}
}

echo '<hr>';
echo'<a href="'.BASEDIR.'/managers/"><< Назад</a><br>';
include'dat.dat';
include_once"../themes/$config_themes/foot.php";
?>