require("../common.inc.php");
require("../register_participants.inc.php");
send_header("Participant Registration - List");
echo "<< ".i18n("Back to Administration")."";
echo " ";
echo "<< ".i18n("Back to Registration")."";
echo "
";
echo "
";
echo i18n("Choose Status").":";
echo "
";
if($_GET['showstatus']) $wherestatus="AND status='".$_GET['showstatus']."' ";
else $wherestatus="";
$q=mysql_query("SELECT registrations.id AS reg_id,
registrations.num AS reg_num,
registrations.status,
projects.title,
projectcategories.category,
projectdivisions.division
FROM
registrations
left outer join projects on projects.registrations_id=registrations.id
left outer join projectcategories on projects.projectcategories_id=projectcategories.id
left outer join projectdivisions on projects.projectdivisions_id=projectdivisions.id
WHERE
1
$wherestatus
ORDER BY
registrations.status DESC,
projects.title
");
echo mysql_error();
echo "";
echo "";
echo "Status | ";
echo "Reg Num | ";
echo "Project Title | ";
echo "Age Category | ";
echo "Division | ";
echo "School(s) | ";
echo "Student(s) | ";
echo "
";
while($r=mysql_fetch_object($q))
{
switch($r->status)
{
case "new": $status_text="New"; break;
case "open": $status_text="Open"; break;
case "paymentpending": $status_text="Payment Pending"; break;
case "complete": $status_text="Complete"; break;
}
echo "";
echo "$status_text | ";
echo "$r->reg_num | ";
echo "$r->title | ";
echo "$r->category | ";
echo "$r->division | ";
$sq=mysql_query("SELECT students.firstname,
students.lastname,
schools.school
FROM
students,schools
WHERE
students.registrations_id='$r->reg_id'
AND
students.schools_id=schools.id
");
echo mysql_error();
$studnum=1;
$schools="";
$students="";
while($studentinfo=mysql_fetch_object($sq))
{
$students.="$studentinfo->firstname $studentinfo->lastname
";
$schools.="$studentinfo->school
";
}
echo "$schools | ";
echo "$students | ";
echo "
";
}
echo "
\n";
echo "
";
send_footer();
?>