-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.php
149 lines (115 loc) · 3.15 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
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
<?php
/*
* @copyright (c) 2008 Nicolo John Davis
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
session_start();
if(!isset($_SESSION['isloggedin']))
{
echo "<meta http-equiv='Refresh' content='0; URL=login.php' />";
exit(0);
}
else
{
$username = $_SESSION['username'];
$userid = $_SESSION['userid'];
}
include('settings.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Keywords" content="programming, contest, coding, judge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Robots" content="index,follow" />
<link rel="stylesheet" href="images/Envision.css" type="text/css" />
<title>Programming Contest</title>
<!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.pack.js"></script><![endif]-->
<script type="text/javascript" src="jquery-1.3.1.js"></script>
<script type="text/javascript" src="flot/jquery.flot.js"></script>
<?php include('timer.php'); ?>
<script type="text/javascript">
<!--
function getTimeline()
{
$.post("gettimeline.php", {}, function(data){
$.plot($("#graph"), data,
{
lines: { show: true },
points: { show: true },
xaxis: { mode: "time" },
yaxis: { ticks: 10, min: 0, max: 150 },
grid: { backgroundColor: "#ffffff" },
legend: { backgroundOpacity: 0.5, backgroundColor: "#fffaff"}
}
);
}, "json");
}
$(document).ready(
function()
{
dispTime();
getLeader();
getLeaders();
getDetails();
getProblemStats();
getAnnouncements();
getTimeline();
setInterval("dispTime()", 1000);
setInterval("getLeaders()", getLeaderInterval);
setInterval("getDetails()", getLeaderInterval);
setInterval("getLeader()", getLeaderInterval);
setInterval("getProblemStats()", getLeaderInterval);
setInterval("getAnnouncements()", getLeaderInterval);
setInterval("getTimeline()", getLeaderInterval);
}
);
-->
</script>
</head>
<body class="menu1">
<!-- wrap starts here -->
<div id="wrap">
<!--header -->
<?php include('header.php'); ?>
<!-- menu -->
<?php include('menu.php'); ?>
<!-- content-wrap starts here -->
<div id="content-wrap">
<div id="main">
<?php
if($time < $startTime)
{
echo '<h2>The contest has not yet begun</h2>';
}
else
{
if($running)
echo '<h2>The contest is running</h2>';
else
echo '<h2>The contest has ended</h2>';
echo <<<EOHTML
<span id="leader"></span>
<span id="announcements"></span>
<h2>Contest timeline</h2>
<div id="graph" style="width:500px;height:250px;"></div>
<h2>Submission Statistics</h2>
<span id="problemstats"></span>
EOHTML;
}
?>
</div>
<div id="sidebar">
<?php include('sidebar.php'); ?>
</div>
<!-- content-wrap ends here -->
</div>
<!--footer starts here-->
<div id="footer">
<?php include('footer.php'); ?>
</div>
<!-- wrap ends here -->
</div>
</body>
</html>