battles/tournir.php

80 lines
2.2 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
session_start();
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 'on');
if (@$_SESSION['uid'] == null) header("Location: index.php");
include './config.php';
include "functions.php";
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = \''.$_SESSION['uid'].'\' LIMIT 1;'));
if ($user['battle'] != 0) { header('location: fbattle.php'); echo "jljkljkl"; die(); }
?>
<HTML>
<HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-type>
</head>
<body style="background-image:url('/i/tournament/tournament2.jpg');background-repeat:no-repeat;background-position:center top;">
<div style='color:#8F0000; font-weight:bold; font-size:16px; text-align:center; float:left;'>Турнирная</div>
<div style="float: right; padding-right: 6px;">
<input type="button" onclick="window.location='main.php?setch=1'" value="Вернуться">
</div><br>
<?php
include './classturnir.php';
$Tournir = new TTournament();
if (count($_POST)>0){
if ($_POST['newtournament']){
//
$Tournir->CreateTournament("Еженедельные турниры");
}
if ($_POST['preptournament']){
$Tournir->PrepearTournir();
}
if ($_POST['addzayvka'])
$Tournir->AddUserInTournament((int)$_POST['idtur']);
if ($_POST['dellzayvka'])
$Tournir->DellUserInTournament((int)$_POST['idtur']);
if ($_POST['expenemy'])
$Tournir->expectationenemy((int)$_POST['expenemy']);
}
//$Tournir->CreateHTML(7);
//echo $dateTime=mktime(20, 20, 0, 03, 31, 2010);
//$Tournir->PrepearTournir();
$dateD=mysql_fetch_row(mysql_query("select datetime from turnament where old=0 limit 1"));
if (mktime()>=($dateD[0]+10)){
$Tournir->UpdateTournir();
}
$Tournir->showAllTurnament();
if (mktime()>=($dateD[0]+10)){
$Tournir->StartTournir();
}
$Tournir->ShowTournirFinaliats();
?>
<form method="post">
<?php
if ($user['align']==2.99){
?>
<table>
<tr>
<td>Добавление нового турнира</td>
<td><input type="submit" name="newtournament" value="Добавить"></td>
<td>Приготовить турнир и запустить</td>
<td><input type="submit" name="preptournament" value="Добавить"></td>
</tr>
</table>
<?php
}
?>
</form>
<META HTTP-EQUIV="REFRESH" CONTENT="10">
</body>
</html>