science-ation/schedule.inc.php
james dd230b2cdf Show registered teams on admin schedule
Move more stuff to common include
2010-06-16 16:15:17 +00:00

49 lines
1.6 KiB
PHP

<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2010 Youth Science Ontario <info@youthscienceontario.ca>
Copyright (C) 2010 James Grant <james@lightbox.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, version 2.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
$ROWHEIGHT=20;
$BORDERSIZE=2;
function getTeamEventStatus($teamid,$scheduleid) {
global $conference;
$q=mysql_query("SELECT * FROM schedule_registrations WHERE so_teams_id='$teamid' AND schedule_id='$scheduleid' AND conferences_id='{$conference['id']}'");
//we use registered/notregistered insetad of true/false becuase we might haevf other statuses down the line, like "waitinglist"
if(mysql_num_rows($q)) {
return "registered";
}
else
return "notregistered";
}
function getNumRegistrations($scheduleid) {
global $conference;
$q=mysql_query("SELECT COUNT(*) AS num FROM schedule_registrations WHERE schedule_id='$scheduleid' AND conferences_id='{$conference['id']}'");
$r=mysql_fetch_object($q);
return $r->num;
}
?>