-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
52 lines (39 loc) · 1.18 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include($_SERVER['DOCUMENT_ROOT']."/util/php/include_classes.php");
$helper = new Helper();
$currCompetition = $helper->getCurrentCompetition();
if(isset($_COOKIE['deviceID'])){
$status = $helper->getCurrentStatusOfUser($_COOKIE['deviceID'],$currCompetition->id);
if(strpos($status ,"teamSelection") !== false){
unset($_COOKIE["matchData"]);
// empty value and expiration one hour before
$res = setcookie("matchData", '', time() - 3600);
if(strpos($status,"-")){
$arr = explode("-",$status);
$WAITING_FOR_CONFIG = true;
$WAITING_ON_TEAM = intval($arr[1]);
$match = new Match(intval($arr[2]),intval($currCompetition->id));
}
else{
$WAITING_FOR_CONFIG = false;
$WAITING_ON_TEAM = null;
}
require_once("teamSelection.php");
}
else{
$arr = explode("-",$status);
$match = new Match(intval($arr[1]),intval($currCompetition->id));
if($match->isConfigured()){
require_once("matchScouting.php");
}
else{
require_once("teamSelection.php");
}
}
}
else{
setcookie("deviceID",$helper->getRandomDeviceID(),3650,"/");
$WAITING_FOR_CONFIG = false;
require_once("teamSelection.php");
}
?>