Add registration statistics to the registration_list

This commit is contained in:
james 2005-01-13 18:00:36 +00:00
parent a8167f4dae
commit 54098a8aab
2 changed files with 36 additions and 2 deletions

View File

@ -4,7 +4,7 @@
echo "<a href=\"index.php\">&lt;&lt; ".i18n("Back to Administration")."</a><br />";
echo "<br />";
echo "<a href=\"registration_receivedforms.php\">".i18n("Input Received Forms")."</a> <br />";
echo "<a href=\"registration_list.php\">".i18n("Registration List")."</a> <br />";
echo "<a href=\"registration_list.php\">".i18n("Registration List and Statistics")."</a> <br />";

View File

@ -2,7 +2,7 @@
require("../common.inc.php");
require("../register_participants.inc.php");
send_header("Participant Registration - List");
send_header("Participant Registration - List and Statistics");
echo "<a href=\"index.php\">&lt;&lt; ".i18n("Back to Administration")."</a>";
echo " &nbsp; ";
echo "<a href=\"registration.php\">&lt;&lt; ".i18n("Back to Registration")."</a>";
@ -40,6 +40,7 @@ else $wherestatus="";
left outer join projects on projects.registrations_id=registrations.id
WHERE
1
AND registrations.year='".$config['FAIRYEAR']."'
$wherestatus
ORDER BY
registrations.status DESC,
@ -57,9 +58,17 @@ else $wherestatus="";
echo "<th>".i18n("School(s)")."</th>";
echo "<th>".i18n("Student(s)")."</th>";
echo "</tr>";
$stats_totalprojects=0;
$stats_totalstudents=0;
$stats_divisions=array();
$stats_categories=array();
while($r=mysql_fetch_object($q))
{
$stats_totalprojects++;
$stats_divisions[$r->projectdivisions_id]++;
$stats_categories[$r->projectcategories_id]++;
switch($r->status)
{
case "new": $status_text="New"; break;
@ -81,6 +90,7 @@ else $wherestatus="";
$divq=mysql_query("SELECT division FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectdivisions_id."'");
$divr=mysql_fetch_object($divq);
echo "<td>".i18n("$catr->category")."</td>";
echo "<td>".i18n("$divr->division")."</td>";
@ -104,6 +114,7 @@ else $wherestatus="";
{
$students.="$studentinfo->firstname $studentinfo->lastname <br />";
$schools.="$studentinfo->school <br />";
$stats_totalstudents++;
}
echo "<td>$schools</td>";
echo "<td>$students</td>";
@ -113,6 +124,29 @@ else $wherestatus="";
echo "</table>\n";
echo "<br />";
echo "<table style=\"margin-left: 50px;\">";
echo "<tr><td colspan=\"2\"><h3>".i18n("Project / Student totals")."</h3></td></tr>";
echo "<tr><td><b>".i18n("Total Projects").":</td><td align=\"right\">$stats_totalprojects</td></tr>\n";
echo "<tr><td><b>".i18n("Total Students").":</td><td align=\"right\"> $stats_totalstudents</td></tr>\n";
echo "<tr><td colspan=\"2\"><hr /></td></tr>";
echo "<tr><td colspan=\"2\"><h3>".i18n("Projects per age category")."</h3></td></tr>";
$q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
while($r=mysql_fetch_object($q))
echo "<tr><td><b>".i18n($r->category).":</td><td align=\"right\">".($stats_categories[$r->id]?$stats_categories[$r->id]:"0")."</td></tr>\n";
echo "<tr><td colspan=\"2\"><hr /></td></tr>";
echo "<tr><td colspan=\"2\"><h3>".i18n("Projects per division")."</h3></td></tr>";
$q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
while($r=mysql_fetch_object($q))
echo "<tr><td><b>".i18n($r->division).":</td><td align=\"right\">".($stats_divisions[$r->id]?$stats_divisions[$r->id]:"0")."</td></tr>\n";
echo "</table>";
echo "<br />";
echo i18n("Note: statistics reflect the numbers of the current 'Status' selected at the top of the page");
echo "<br />";
echo "<br />";
send_footer();
?>