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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
<?php
////////////////////////////////////////////////////////////////////////////////
//BOCA Online Contest Administrator
// Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
//
// This program 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 3 of the License, or
// (at your option) any later version.
//
// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
// Last modified 05/aug/2012 by cassio@ime.usp.br
require 'header.php';
if(isset($_GET["order"]) && $_GET["order"] != "") {
$order = myhtmlspecialchars($_GET["order"]);
$_SESSION["runline"] = $order;
} else {
if(isset($_SESSION["runline"]))
$order = $_SESSION["runline"];
else
$order = '';
}
?>
<form name="form1" method="post" action="<?php echo $runphp; ?>">
<input type=hidden name="confirmation" value="noconfirm" />
<br>
<table width="100%" border=1>
<tr>
<td><b><a href="<?php echo $runphp; ?>?order=run">Run #</a></b></td>
<td><b><a href="<?php echo $runphp; ?>?order=site">Site</a></b></td>
<?php if($runphp == "run.php") { ?>
<td><b><a href="<?php echo $runphp; ?>?order=user">User</a></b></td>
<?php } ?>
<td><b>Time</b></td>
<td><b><a href="<?php echo $runphp; ?>?order=problem">Problem</a></b></td>
<td><b><a href="<?php echo $runphp; ?>?order=language">Language</a></b></td>
<!-- <td><b>Filename</b></td> -->
<td><b><a href="<?php echo $runphp; ?>?order=status">Status</a></b></td>
<td><b><a href="<?php echo $runphp; ?>?order=judge">Judge (Site)</a></b></td>
<td><b>AJ</b></td>
<td><b><a href="<?php echo $runphp; ?>?order=answer">Answer</a></b></td>
</tr>
<?php
if (($s=DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usersitenumber"])) == null)
ForceLoad("../index.php");
// forca aparecer as runs do proprio site
if (trim($s["sitejudging"])!="") $s["sitejudging"].=",".$_SESSION["usertable"]["usersitenumber"];
else $s["sitejudging"]=$_SESSION["usertable"]["usersitenumber"];
$run = DBAllRunsInSites($_SESSION["usertable"]["contestnumber"], $s["sitejudging"], $order);
if(isset($_POST)) {
$nrenew = 0;
$nreopen = 0;
for ($i=0; $i<count($run); $i++) {
if(isset($_POST["cbox_" . $run[$i]["number"] . "_" . $run[$i]["site"]]) &&
$_POST["cbox_" . $run[$i]["number"] . "_" . $run[$i]["site"]] != "") {
if(isset($_POST["auto"]) && $_POST["auto"]=="Re-run autojudge for selected runs") {
if (DBGiveUpRunAutojudging($_SESSION["usertable"]["contestnumber"],
$run[$i]["site"], $run[$i]["number"]))
$nrenew++;
}
if(isset($_POST["open"]) && $_POST["open"]=="Open selected runs for rejudging") {
DBGiveUpRunAutojudging($_SESSION["usertable"]["contestnumber"],
$run[$i]["site"], $run[$i]["number"]);
if (DBChiefRunGiveUp($run[$i]["number"], $run[$i]["site"],
$_SESSION["usertable"]["contestnumber"]))
$nreopen++;
}
}
}
if($nrenew > 0) {
MSGError($nrenew . " runs renewed for autojudging.");
ForceLoad($runphp);
}
if($nreopen > 0) {
MSGError($nreopen . " runs reopened.");
ForceLoad($runphp);
}
}
for($judged=0; $judged<2; $judged++) {
for ($i=0; $i<count($run); $i++) {
if($run[$i]["status"] == 'gone') continue;
if(($run[$i]['status'] != 'judged' && $judged==0) ||
($run[$i]['status'] == 'judged' && $judged==1)) {
#for ($i=0; $i<count($run); $i++) {
if($run[$i]["answer1"] != 0 && $run[$i]["answer2"] != 0 && ($run[$i]["status"] != "judged" && $run[$i]["status"] != 'deleted')) {
if($runphp == "runchief.php")
echo " <tr bgcolor=\"ff0000\">\n";
else echo "<tr>\n";
echo " <td nowrap bgcolor=\"ff0000\">";
}
else {
echo " <tr><td nowrap>";
}
echo "<input type=\"checkbox\" name=\"cbox_" . $run[$i]["number"] . "_" . $run[$i]["site"] . "\" />";
echo " <a href=\"" . $runeditphp . "?runnumber=".$run[$i]["number"]."&runsitenumber=".$run[$i]["site"] .
"\">" . $run[$i]["number"] . "</a></td>\n";
echo " <td nowrap>" . $run[$i]["site"] . "</td>\n";
if($runphp == "run.php") {
if ($run[$i]["user"] != "") {
$u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["site"], $run[$i]["user"]);
echo " <td nowrap>" . $u["username"] . "</td>\n";
}
}
echo " <td nowrap>" . dateconvminutes($run[$i]["timestamp"]) . "</td>\n";
echo " <td nowrap>" . $run[$i]["problem"] . "</td>\n";
echo " <td nowrap>" . $run[$i]["language"] . "</td>\n";
// echo " <td nowrap>" . $run[$i]["filename"] . "</td>\n";
if ($run[$i]["judge"] == $_SESSION["usertable"]["usernumber"] &&
$run[$i]["judgesite"] == $_SESSION["usertable"]["usersitenumber"] && $run[$i]["status"] == "judging")
$color="ff7777";
else if ($run[$i]["status"]== "judged+" && $run[$i]["judge"]=="") $color="ffff00";
else if ($run[$i]["status"]== "judged") $color="bbbbff";
else if ($run[$i]["status"] == "judging" || $run[$i]["status"]== "judged+") $color="77ff77";
else if ($run[$i]["status"] == "openrun") $color="ffff88";
else $color="ffffff";
echo " <td nowrap bgcolor=\"#$color\">" . $run[$i]["status"] . "</td>\n";
if ($run[$i]["judge"] != "") {
$u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["judgesite"], $run[$i]["judge"]);
echo " <td nowrap>" . $u["username"] . " (" . $run[$i]["judgesite"] . ")";
} else
echo " <td> ";
if ($run[$i]["judge1"] != "") {
$u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["judgesite1"], $run[$i]["judge1"]);
echo " [" . $u["username"] . " (" . $run[$i]["judgesite1"] . ")]";
}
if ($run[$i]["judge2"] != "") {
$u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["judgesite2"], $run[$i]["judge2"]);
echo " [" . $u["username"] . " (" . $run[$i]["judgesite2"] . ")]";
}
echo "</td>\n";
if ($run[$i]["autoend"] != "") {
$color="bbbbff";
if ($run[$i]["autoanswer"]=="") $color="ff7777";
}
else if ($run[$i]["autobegin"]=="") $color="ffff88";
else $color="77ff77";
echo "<td bgcolor=\"#$color\"> </td>\n";
if ($run[$i]["answer"] == "") {
echo " <td> </td>\n";
} else {
echo " <td>" . $run[$i]["answer"];
if($run[$i]['yes']=='t') {
echo " <img alt=\"".$run[$i]["colorname"]."\" width=\"10\" ".
"src=\"" . balloonurl($run[$i]["color"]) ."\" />";
}
echo "</td>\n";
}
echo " </tr>\n";
}
}
}
echo "</table>";
if (count($run) == 0) echo "<br><center><b><font color=\"#ff0000\">NO RUNS AVAILABLE</font></b></center>";
else {
?>
<br>
<script language="javascript">
function conf() {
if (confirm("Confirm?")) {
document.form1.confirmation.value='confirm';
}
}
</script>
<center>
<b>Click on the number of a run to edit it or select them with<br />the checkboxes and use the buttons to work on multiple runs:</b><br /><br />
<input type="submit" name="auto" value="Re-run autojudge for selected runs" onClick="conf()">
<input type="submit" name="open" value="Open selected runs for rejudging" onClick="conf()">
<br><br>
</center>
</form>
<?php
}
?>
</body>
</html>
|