Mercurial > hg > fapweb
diff attendees.inc.php @ 0:8019b357cc03
Initial import.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 04 Dec 2012 19:07:18 +0200 |
parents | |
children | 76c3b89d7b11 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/attendees.inc.php Tue Dec 04 19:07:18 2012 +0200 @@ -0,0 +1,41 @@ +<? +if (stChkSetting("allowRegister")) +{ +?> +<div class="reglink"> +To register, use <a href="register">this form</a>. +</div> +<? +} + +//echo "<h1>Current attendees</h1>\n"; +$maxAttendees = stGetSetting("maxAttendees", 20); +$numAttendees = 0; +if (($res = $db->query("SELECT COUNT(*) FROM attendees")) !== FALSE) + $numAttendees = $res->fetchColumn(); + +echo "<p>Total of <b>".$numAttendees. + "</b> people registered to attend (<b>". + $maxAttendees."</b> max).</p>\n"; + +?> +<table class="attendees"> + <tr> + <th class="name">Name</th> + <th class="groups">Group(s)</th> + <th class="regtime">Registered</th> + <th class="oneliner">Oneliner</th> + </tr> +<? +$index = $numAttendees; +$row = 0; +if (($res = stExecSQL("SELECT * FROM attendees ORDER BY regtime DESC")) !== FALSE) +{ + foreach ($res as $item) + { + stPrintAttendee($item, $row++, FALSE, ($index > $maxAttendees) ? " overbooked" : ""); + $index--; + } +} +?> +</table>