aboutsummaryrefslogtreecommitdiff
path: root/old/webcast/contest/index.php
blob: 3efc719f1a595f5e5872b69a89d97cb54160920c (plain)
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
<?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";

?>