forked from Umbc-HvZ-Web-Committee/Website-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheadCount.php
More file actions
20 lines (18 loc) · 757 Bytes
/
headCount.php
File metadata and controls
20 lines (18 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
require_once('includes/util.php');
load_config('config.txt');
my_quick_con($config);
$curGame = getNextLongGame();
$curGame = $curGame['gameID'];
$ret = mysql_oneline("SELECT COUNT(*) AS cnt FROM long_players WHERE state<0 AND gameID='$curGame'");
$zombies = $ret['cnt'];
$ret = mysql_oneline("SELECT COUNT(*) AS cnt FROM long_players WHERE state>0 AND gameID='$curGame'");
$humans = $ret['cnt'];
$ret = mysql_oneline("SELECT COUNT(*) AS cnt FROM long_players WHERE state=2 AND gameID='$curGame'");
$hiddenOZ = $ret['cnt'];
echo "$humans human".($humans==1?"":"s")." and $zombies zombie".($zombies==1?"":"s");
if($hiddenOZ){
echo ", counting the ".($hiddenOZ==1?"":"$hiddenOZ ")."OZ".($hiddenOZ==1?"":"s")." as both human and zombie";
}
echo ".";
?>