forked from yubowenok/ucpccc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
81 lines (66 loc) · 1.85 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
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
<?php
include("config.php");
include("common.php");
?>
<html>
<head>
<?php print "<title>$g_pagetitle</title>\n"; ?>
</head>
<body>
<div align="center">
<h1><?=$g_pagetitle?></h1>
<h2><i>Online Training Arena</i></h2>
<p><img src="images/icpc_logo.png"></p>
</div>
<?php navigation("index"); ?>
<hr>
<div align="center">
<?php
// just make sure the submitfile and judgefile are there
if (!file_exists($g_submitfile))
{
$fp = fopen($g_submitfile, "w");
fclose($fp);
chmod($g_submitfile, 0660);
}
if (!file_exists($g_judgefile))
{
$fp = fopen($g_judgefile, "w");
fclose($fp);
chmod($g_judgefile, 0660);
}
$contest = new Contest($g_configfile, $g_problempath);
if ($contest->okay)
{
print "<p>Contest of $contest->cdate<br>\n";
print "<i>$contest->ctime</i></p>\n";
print "<table border=\"0\" width=\"320\">\n";
print "<tr><th>$contest->cname</th></tr>\n";
foreach ($contest->pletters as $letter)
{
$link = $contest->problemlonglink($letter);
print "<tr><td>$link</td></tr>\n";
}
print "</table>\n";
print "<p><i>For your questions, comments, and issues,<br>\n";
print "please contact your host today at</i><br>\n";
print "<a href=\"mailto:$contest->chost\">$contest->chost</a></p>\n";
// unlock (or relock) the problem set if necessary
if ($contest->tnow > $contest->tstart)
{
if (file_exists($g_problempath . ".htaccess"))
rename($g_problempath . ".htaccess", $g_problempath . ".lock");
}
else
{
if (file_exists($g_problempath . ".lock"))
rename($g_problempath . ".lock", $g_problempath . ".htaccess");
}
}
?>
<p>Current date and time:<br>
<i><?php print date("r")?></i></p>
</div>
<?php footer(); ?>
</body>
</html>