DIENOS KOMANDA
if ($bx['team'] == '11' || $bx['team'] == '12') {
$team_name = $bx['city'];
} else {
$team_name = $bx['city'].' '.$bx['name'];
}
?>
$tre = explode("|", file_get_contents("../info/teams.txt"));
$untr = explode("*", $tre[$bx['team']]);
$treneris1 = $untr[0];
if (!empty($untr[1])) {
$antras = " |
$untr[1]";
$br = "
";
} else {
$antras = "";
}
if(empty($treneris1)) {
$treneris1 = "Nėra";
}
$pralaimejo = $gx['suzaide']-$bx['win'];
$proc = round($bx['win']*100/$gx['suzaide'], 1);
?>
Šiandien rungtynių:
Pergalės:
Pralaimėjimai:
Procentas:
Naudingiausias:
. ( EFF)
Treneris:
include("./hidden.php");
?>
include("./includes/app_top.php");
$command = $_REQUEST["command"];
$db = new DB(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$page = new Page();
$commands = array (
'index' => 'load_page(new Front(10), "stats", "index.html")',
'team' => 'load_page(new Team(), "team", "team.html")',
'results' => 'load_page(new Results(), "results", "results.html")',
'game' => 'load_page(new Game(), "game", "game.html")',
'standings' => 'load_page(new Standings(), "standings", "standings.html")',
'player' => 'load_page(new Player(), "player", "player.html")',
'teams' => 'load_page(new Tops(), "stats", "teams.html")',
'players' => 'load_page(new Tops(), "stats", "players.html")',
'stats' => 'load_page(new Tops(), "stats", "stats_box.html")',
'resets' => 'reset_db()',
'addgame' => 'add_game()',
'remove' => 'rem_game()',
);
isset($commands[$command]) ? eval($commands[$command].";") : eval($commands["index"].";");
if(!empty($page->template)) $page->display($page->template);
include "includes/app_bottom.php";
function load_page(&$class, $variable, $template)
{
global $page;
$page->assign($variable, $class);
$page->template = $template;
}
function reset_db()
{
$nba = new NBAM();
$teams_dbf = DBF_TEAMS;
$players_dbf = DBF_PLAYERS;
$appearance_dbf = DBF_APPEARANCE;
$birthtown_dbf = DBF_BIRTHTOWN;
$birthstate_dbf = DBF_BIRTHSTATE;
$data_dir = realpath(DIR_GAMESDATA);
$nba->importDBF($teams_dbf, $players_dbf, $appearance_dbf, $birthtown_dbf, $birthstate_dbf);
$nba->importGames($data_dir);
}
function add_game()
{
$cook = base64_decode($_COOKIE['NBA-SPORT']);
$nck = explode("*", $cook);
$nick = $nck[0];
$pass = $nck[1];
$passas = explode("|", file_get_contents("../dalyviai/$nick.txt"));
$dal = explode("|", file_get_contents("../info/teams.txt"));
if(!file_exists("../dalyviai/$nick.txt") or $passas[0] != $pass)
{
$error = "Tu neprisijungęs.";
}
for($a=0; $aTu neturi komandos.
";
}
if(!empty($error))
{
?>
|
}
else
{
global $page;
$step = (int)$_REQUEST["step"];
$banned[] = "0.0.0.0";
$ip = $_SERVER["REMOTE_ADDR"];
if(!in_array($ip, $banned))
{
if($step == 1)
{
$DATA_DIR = realpath(DIR_GAMESDATA);
$now = time();
$password = $_REQUEST["password"];
if($password == UPLOAD_PASSWORD)
{
if(is_uploaded_file($_FILES["home"]["tmp_name"]) && is_uploaded_file($_FILES["away"]["tmp_name"]))
{
mkdir($DATA_DIR."/".$now);
move_uploaded_file($_FILES["home"]["tmp_name"], $DATA_DIR."/$now/home.txt");
move_uploaded_file($_FILES["away"]["tmp_name"], $DATA_DIR."/$now/away.txt");
chmod($DATA_DIR."/$now/home.txt", 0777);
chmod($DATA_DIR."/$now/away.txt", 0777);
chmod($DATA_DIR."/$now", 0777);
$rasome = fopen("data/$now/ip.txt", "w+");
fwrite($rasome, "$ip");
fclose($rasome);
$nba = new NBAM();
$game_id = $nba->addGame($DATA_DIR."/".$now);
?>
">
|
return;
} else { ?>
|
}
} else { ?>
|
return;
}
} else {
$page->display("add_game.html");
}
} else {
echo "Banas";
}
}
}
function rem_game()
{
$id = (int)$_REQUEST["id"];
$pass = $_REQUEST["password"];
if($pass == "remov")
{
$nba = new NBAM();
$nba->removeGame($id);
}
}
?>