aboutsummaryrefslogtreecommitdiff
path: root/old/webcast
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2013-07-02 05:46:45 +0000
committercassio <cassiopc@gmail.com>2013-07-02 05:46:45 +0000
commitbe2491b093b1f0ca430bede679ecbb670041e483 (patch)
treefe2da63d1811cb93e4352a43a113ace37b9f6017 /old/webcast
parenta9aa438ea0558eb0044cf1e54a9190ddb41b65e5 (diff)
downloadboca-be2491b093b1f0ca430bede679ecbb670041e483.tar.gz
boca-be2491b093b1f0ca430bede679ecbb670041e483.zip
restructuring of boca's git
Diffstat (limited to 'old/webcast')
-rw-r--r--old/webcast/config.php25
-rw-r--r--old/webcast/contest/index.php61
l---------old/webcast/index.php1
-rw-r--r--old/webcast/runs/index.php41
-rw-r--r--old/webcast/time/index.php12
-rw-r--r--old/webcast/version/index.php10
6 files changed, 150 insertions, 0 deletions
diff --git a/old/webcast/config.php b/old/webcast/config.php
new file mode 100644
index 0000000..b16deb6
--- /dev/null
+++ b/old/webcast/config.php
@@ -0,0 +1,25 @@
+<?php
+$loc = $locr = "..";
+require_once("$locr/globals.php");
+require_once("$locr/db.php");
+if(!ValidSession()) {
+ InvalidSession("webcast/index.php");
+ ForceLoad("$loc/index.php");
+}
+if($_SESSION["usertable"]["usertype"] != "admin") {
+ IntrusionNotify("webcast/index.php");
+ ForceLoad("$loc/index.php");
+}
+
+$contest = $_SESSION["usertable"]["contestnumber"];
+$site = $_SESSION["usertable"]["usersitenumber"];
+
+if(($ct = DBSiteInfo($contest, $site)) == null)
+ ForceLoad("../index.php");
+
+if(isset($_GET['full']) && $_GET['full'] > 0)
+ $freezeTime = $ct['siteduration'];
+else
+ $freezeTime = $ct['sitelastmilescore'];
+
+?>
diff --git a/old/webcast/contest/index.php b/old/webcast/contest/index.php
new file mode 100644
index 0000000..3efc719
--- /dev/null
+++ b/old/webcast/contest/index.php
@@ -0,0 +1,61 @@
+<?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'];
+ if(isset($a['usershortname']))
+ $teamName = $a['usershortname'];
+ else
+ $teamName = $a['userfullname'];
+ if(isset($a['usershortinstitution']))
+ $teamUni = $a['usershortinstitution'];
+ else
+ $teamUni = $teamName;
+
+ echo
+ $teamID . '' .
+ $teamUni . '' .
+ $teamName . "\n";
+}
+
+echo '1' . '' . '1' . "\n";
+echo $numProblems . '' . 'Y' . "\n";
+
+?>
diff --git a/old/webcast/index.php b/old/webcast/index.php
new file mode 120000
index 0000000..4e9b47a
--- /dev/null
+++ b/old/webcast/index.php
@@ -0,0 +1 @@
+config.php \ No newline at end of file
diff --git a/old/webcast/runs/index.php b/old/webcast/runs/index.php
new file mode 100644
index 0000000..e28567e
--- /dev/null
+++ b/old/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/old/webcast/time/index.php b/old/webcast/time/index.php
new file mode 100644
index 0000000..061c81f
--- /dev/null
+++ b/old/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/old/webcast/version/index.php b/old/webcast/version/index.php
new file mode 100644
index 0000000..4d474a2
--- /dev/null
+++ b/old/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";
+
+?>