aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.0/src/webcast
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-06 09:09:10 +0000
committercassiopc <cassiopc@gmail.com>2012-08-06 09:09:10 +0000
commit866658cded5b92ddb2681dead1ebaf111d712fcc (patch)
treecf7534c4726a142189e096ce82f8d73b2a398ecc /boca-1.5.0/src/webcast
downloadboca-866658cded5b92ddb2681dead1ebaf111d712fcc.tar.gz
boca-866658cded5b92ddb2681dead1ebaf111d712fcc.zip
init
Diffstat (limited to 'boca-1.5.0/src/webcast')
-rw-r--r--boca-1.5.0/src/webcast/config.php8
-rw-r--r--boca-1.5.0/src/webcast/contest/index.php54
-rw-r--r--boca-1.5.0/src/webcast/runs/index.php41
-rw-r--r--boca-1.5.0/src/webcast/time/index.php12
-rw-r--r--boca-1.5.0/src/webcast/version/index.php10
5 files changed, 125 insertions, 0 deletions
diff --git a/boca-1.5.0/src/webcast/config.php b/boca-1.5.0/src/webcast/config.php
new file mode 100644
index 0000000..843842b
--- /dev/null
+++ b/boca-1.5.0/src/webcast/config.php
@@ -0,0 +1,8 @@
+<?php
+
+$contest = 1;
+$site = 1;
+
+$freezeTime = 240;
+
+?>
diff --git a/boca-1.5.0/src/webcast/contest/index.php b/boca-1.5.0/src/webcast/contest/index.php
new file mode 100644
index 0000000..8d68f34
--- /dev/null
+++ b/boca-1.5.0/src/webcast/contest/index.php
@@ -0,0 +1,54 @@
+<?php
+
+require '../../db.php';
+require '../config.php';
+
+header('Content-type: text/plain; encoding=utf-8');
+
+$ct = DBContestInfo($contest);
+
+echo
+ $ct['contestname'] . "\n";
+
+echo
+ $ct['contestduration']/60 . '' .
+ $ct['contestlastmileanswer']/60 . '' .
+ $ct['contestlastmilescore']/60 . '' .
+ $ct['contestpenalty']/60 . "\n";
+
+$c = DBConnect();
+
+$r = DBExec($c,
+ 'SELECT problemnumber FROM problemtable' .
+ ' WHERE contestnumber = ' . $contest .
+ ' AND problemnumber > 0');
+
+$numProblems = DBnlines($r);
+
+$r = DBExec($c,
+ 'SELECT username, userfullname FROM usertable' .
+ ' WHERE contestnumber = ' . $contest .
+ ' AND userenabled = \'t\' AND usersitenumber = ' . $site .
+ ' AND usertype = \'team\'');
+
+$numTeams = DBnlines($r);
+
+echo
+ $numTeams . '' .
+ $numProblems . "\n";
+
+for ($i = 0; $i < $numTeams; $i++) {
+ $a = DBRow($r, $i);
+ $teamID = $a['username'];
+ $pieces = explode('</b>', $a['userfullname']);
+ $teamName = trim($pieces[1]);
+ $pieces = explode('<b>', $pieces[0]);
+ $teamUni = trim($pieces[1]);
+
+ echo
+ $teamID . '' .
+ $teamUni . '' .
+ $teamName . "\n";
+}
+
+?>
diff --git a/boca-1.5.0/src/webcast/runs/index.php b/boca-1.5.0/src/webcast/runs/index.php
new file mode 100644
index 0000000..e28567e
--- /dev/null
+++ b/boca-1.5.0/src/webcast/runs/index.php
@@ -0,0 +1,41 @@
+<?php
+
+require '../../db.php';
+require '../config.php';
+
+header('Content-type: text/plain; encoding=utf-8');
+
+$s = DBSiteInfo($contest, $site);
+
+$run = DBAllRunsInSites($contest, $site, 'run');
+
+$numRuns = count($run);
+
+for ($i = 0; $i < $numRuns; $i++) {
+ $u = DBUserInfo($contest, $site, $run[$i]['user']);
+
+ $runID = $run[$i]['number'];
+ $runTime = dateconvminutes($run[$i]['timestamp']);
+ $runTeam = $u['username'];
+ $runProblem = $run[$i]['problem'];
+
+ if ($runTime > $freezeTime) {
+ continue;
+ }
+
+ echo
+ $runID . '' .
+ $runTime . '' .
+ $runTeam . '' .
+ $runProblem . '';
+
+ if ($run[$i]['yes']=='t') {
+ echo 'Y' . "\n";
+ } else if ($run[$i]['answer'] == 'Not answered yet') {
+ echo '?' . "\n";
+ } else {
+ echo 'N' . "\n";
+ };
+}
+
+?>
diff --git a/boca-1.5.0/src/webcast/time/index.php b/boca-1.5.0/src/webcast/time/index.php
new file mode 100644
index 0000000..061c81f
--- /dev/null
+++ b/boca-1.5.0/src/webcast/time/index.php
@@ -0,0 +1,12 @@
+<?php
+
+require '../../db.php';
+require '../config.php';
+
+header('Content-type: text/plain; encoding=utf-8');
+
+$s = DBSiteInfo($contest, $site);
+
+echo $s['currenttime'];
+
+?>
diff --git a/boca-1.5.0/src/webcast/version/index.php b/boca-1.5.0/src/webcast/version/index.php
new file mode 100644
index 0000000..4d474a2
--- /dev/null
+++ b/boca-1.5.0/src/webcast/version/index.php
@@ -0,0 +1,10 @@
+<?php
+
+require '../../db.php';
+require '../config.php';
+
+header('Content-type: text/plain; encoding=utf-8');
+
+echo '1.0' . "\n";
+
+?>