science-ation/register_judges.inc.php
james 1b393c1bb0 Commit all work from the weekend:
- judges registration
 - small changes to participant registraiton
2004-12-19 23:16:46 +00:00

49 lines
1.3 KiB
PHP

<?
function personalStatus()
{
global $config;
$required_fields=array("firstname","lastname","address","city","postalcode","phone","email","dateofbirth");
$q=mysql_query("SELECT * FROM judges WHERE id='".$_SESSION['judges_id']."'");
while($r=mysql_fetch_object($q))
{
foreach ($required_fields AS $req)
{
if(!$r->$req)
{
return "incomplete";
}
}
}
//if it made it through without returning incomplete, then we must be complete
return "complete";
}
function expertiseStatus()
{
global $config;
//easiest check here is to check the number of divisions, then check the number of entries
//that they have in the judges_expertise table. If they are the same, then we're good to go
//if they are different, they forgot to fill one out (because it only gets inserted if a value)
//is choosen, and they are always ALL removed before each update
$q=mysql_query("SELECT COUNT(id) AS num FROM projectdivisions WHERE year='".$config['FAIRYEAR']."'");
$r=mysql_fetch_object($q);
$numdivisions=$r->num;
$q=mysql_query("SELECT COUNT(id) AS num FROM judges_expertise WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'");
$r=mysql_fetch_object($q);
$numjudgesexpertise=$r->num;
if($numdivisions == $numjudgesexpertise)
return "complete";
else
return "incomplete";
}
?>