This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index2.php
161 lines (127 loc) · 6.33 KB
/
index2.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php /* begin license *
*
* Tabbie, Debating Tabbing Software
* Copyright Contributors
*
* This file is part of Tabbie
*
* Tabbie is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tabbie is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tabbie; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* end license */
$ntu_controller = "index";
$moduletype = "";
require("ntu_bridge.php");
require("view/header.php");
require("view/mainmenu.php");
require_once("includes/backend.php");
$round = get_num_rounds();
$next_round = $round + 1;
$state=$p_state="";
if (get_num_rounds() == 0 && !has_temp_draw()) {
$state = "before_tournament";
$p_state = "The tournament has not started yet - i.e., there has not been a draw for the first round yet.";
} elseif (get_num_rounds() == get_num_completed_rounds() && !has_temp_draw() && !has_temp_result()) {
$state = "before_draw";
$p_state = "All results for round $round have been inputted and finalized, and the draw for round $next_round has not been made.";
} elseif (get_num_rounds() == get_num_completed_rounds() && has_temp_draw() && !has_temp_result()) {
$state = "during_draw";
$p_state = "You are manually adjusting the adjudicators for round $next_round.";
} elseif (get_num_rounds() > get_num_completed_rounds() && !has_temp_draw() && !has_temp_result()) {
$state = "during_round";
$p_state = "The draw for round $round has been created, but inputting results for this round has not started yet.";
} elseif (get_num_rounds() > get_num_completed_rounds() && !has_temp_draw() && has_temp_result()) {
$state = "during_results";
$p_state = "You are inputting the results for round $round.";
} else {
$state="unknown";
$p_state="Tabbie's database is in an odd state. This may mean that temporary draw or results tables are present that should have been deleted<br />";
$p_state .= "get_num_rounds(): ".get_num_rounds()."<br />";
$p_state .= "get_num_completed_rounds(): ".get_num_completed_rounds()."<br />";
$p_state .= "has_temp_draw(): ".has_temp_draw()."<br />";
$p_state .= "has_temp_result(): ".has_temp_result()."<br />";
}
?>
<h2>Overview</h2>
<p>
<?= $p_state ?>
</p>
<?php if ($state == "before_tournament") { ?>
<h3>Before the tournament & during registration</h3>
<ul>
<li><a href="input.php?moduletype=venue">Input venue (room) names and locations</a></li>
<li><a href="input.php?moduletype=univ">Input participating universities or institutions</a></li>
<li><a href="input.php?moduletype=adjud">Input participating adjudicators</a></li>
<li><a href="input.php?moduletype=team">Input participating teams</a></li>
<li><a href="input.php?moduletype=motion">Input motions for the regular rounds</a></li>
<li><a href="backup.php">Make a backup (and save it on another computer)</a></li>
</ul>
<h3>Before the first regular round</h3>
<ul>
<?php } if (in_array($state, array("before_draw", "during_draw", "during_round"))) { ?>
<h3>Before each regular round</h3>
<ul>
<?php } if ($state == "before_draw") { ?>
<li><a href="input.php?moduletype=venue">Update venues according to availability</a></li>
<li><a href="input.php?moduletype=team">Update team status according to presence</a></li>
<li><a href="input.php?moduletype=adjud">Update adjudicator status according to presence</a></li>
<?php } if ($state == "before_tournament" || $state == "before_draw") { ?>
<li><a href="input.php?moduletype=adjud_params">Adapt the parameters for adjudicator allocation</a></li>
<li><a href="draw.php?moduletype=currentdraw&action=draw">Request the automated draw</a></li>
<?php } if ($state == "during_draw") { ?>
<li><a href="draw.php?moduletype=manualdraw">Manually adjust adjudicators and rooms</a></li>
<li><a href="draw.php?moduletype=manualdraw&action=finalise">Finalize the draw</a></li>
<?php } if ($state == "during_round") { ?>
<li><a href="rest.php?result_type=pdf&function=adjudicator_sheets&param=<?= $round ?>">Print the adjudicator sheets with room-specific info</a> (and have them distributed)</li>
<li>Display the draw</li>
<ul>
<li><a href="draw.php">In the browser (static)</a></li>
<li><a href="draw_scrolling_display.php?roundno=<?= $round ?>">In the browser (scrolling)</a></li>
<li><a href="rest.php?result_type=csv&function=adjudicator_sheets&param=<?= $round ?>">Export .csv</a></li>
</ul>
<li><a href="motion.php?roundno=<?= $round ?>">Display the motion</a></li>
<li><a href="backup.php">Make a backup (and save it on another computer)</a></li>
<?php } if (in_array($state, array("before_draw", "before_tournament", "during_draw", "during_round"))) { ?>
</ul>
<?php } if (in_array($state, array("during_round", "during_results", "before_draw"))) { ?>
<h3>After each regular round</h3>
<ul>
<?php } if ($state == "during_round") { ?>
<li><a href="result.php?moduletype=currentround&action=create">Start Inputting results</a></li>
<?php } if ($state == "during_results") { ?>
<li><a href="result.php?moduletype=currentround">Continue Inputting results</a></li>
<li><a href="result.php?moduletype=currentround&action=finalize">Finalize results</a></li>
<?php } if ($state == "before_draw") { ?>
<li><a href="backup.php">Make a backup (and save it on another computer)</a></li>
<?php } if (in_array($state, array("during_round", "during_results", "before_draw"))) { ?>
</ul>
<?php } if ($state == "before_draw") { ?>
<h3>Before the break</h3>
<ul>
<li><a href="standing.php?moduletype=teamstanding">Determine the breaking teams</a></li>
<li>Automatically create the fold (not implemented yet)</li>
</ul>
<h3>Before the grand final</h3>
<ul>
<li><a href="standing.php?moduletype=speakerstanding">Determine the best speakers</a></li>
</ul>
<h3>After the tournament</h3>
<ul>
<li><a href="team_print.php">Present the results as a website</a></li>
</ul>
<?php } ?>
</p>
<?php
require('view/footer.php');
?>