Registraiton list

Fix received forms to accept paid/not paid
This commit is contained in:
james 2005-01-07 04:45:17 +00:00
parent 479fcbd7ab
commit ebeadd6470
3 changed files with 183 additions and 30 deletions

View File

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

126
admin/registration_list.php Normal file
View File

@ -0,0 +1,126 @@
<?
require("../common.inc.php");
require("../register_participants.inc.php");
send_header("Participant Registration - List");
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>";
echo "<br />";
echo "<br />";
echo i18n("Choose Status").":";
echo "<form name=\"statuschangerform\" method=\"get\" action=\"registration_list.php\">";
echo "<select name=\"showstatus\" onchange=\"document.forms.statuschangerform.submit()\">";
if($_GET['showstatus']=="") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"\">Any Status</option>\n";
if($_GET['showstatus']=="new") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"new\">New</option>\n";
if($_GET['showstatus']=="open") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"open\">Open</option>\n";
if($_GET['showstatus']=="paymentpending") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"paymentpending\">Payment Pending</option>\n";
if($_GET['showstatus']=="complete") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"complete\">Complete</option>\n";
echo "</select>";
echo "</form>";
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 "<table class=\"summarytable\">";
echo "<tr>";
echo "<th>Status</th>";
echo "<th>Reg Num</th>";
echo "<th>Project Title</th>";
echo "<th>Age Category</th>";
echo "<th>Division</th>";
echo "<th>School(s)</th>";
echo "<th>Student(s)</th>";
echo "</tr>";
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 "<tr>";
echo "<td>$status_text</td>";
echo "<td>$r->reg_num</td>";
echo "<td>$r->title</td>";
echo "<td>$r->category</td>";
echo "<td>$r->division</td>";
$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 <br />";
$schools.="$studentinfo->school <br />";
}
echo "<td>$schools</td>";
echo "<td>$students</td>";
echo "</tr>";
}
echo "</table>\n";
echo "<br />";
send_footer();
?>

View File

@ -18,16 +18,12 @@ $showformatbottom=true;
$r=mysql_fetch_object($q); $r=mysql_fetch_object($q);
$reg_id=$r->id; $reg_id=$r->id;
$reg_num=$r->num; $reg_num=$r->num;
$reg_status=$r->status;
if($r->status=='new') if($r->status=='new')
{ {
echo error(i18n("Invalid Registration Status (%1 is New). Cannot receive an empty form.",array($_POST['registration_number']))); echo error(i18n("Invalid Registration Status (%1 is New). Cannot receive an empty form.",array($_POST['registration_number'])));
} }
else if($r->status=='closed')
{
echo notice(i18n("Registration number (%1) has already been received.",array($_POST['registration_number'],$r->status)));
}
else else
{ {
//make sure all of the statuses are correct //make sure all of the statuses are correct
@ -62,10 +58,17 @@ echo mysql_Error();
$projectinfo=mysql_fetch_object($q); $projectinfo=mysql_fetch_object($q);
echo "<table class=\"summarytable\">"; echo "<table class=\"summarytable\">";
echo "<tr><th colspan=\"2\">".i18n("Registration Summary for %1",array($reg_num))."</th></tr>"; echo "<tr><th colspan=\"2\">".i18n("Registration Summary for %1",array($reg_num))."</th></tr>";
switch($reg_status)
echo "<tr><td><b>".i18n("Registration Number").":</b></td><td>$reg_num</td></tr>"; {
echo "<tr><td><b>".i18n("Project Title").":</b></td><td>$projectinfo->title</td></tr>"; case "paymentpending": $status_text="Payment Pending"; break;
echo "<tr><td><b>".i18n("Category / Division").":</b></td><td>$projectinfo->category / $projectinfo->division</td></tr>"; case "complete": $status_text="Complete"; break;
case "open": $status_text="Open"; break;
}
echo "<tr><td><b>".i18n("Registration Status")."</b></td><td>$status_text</td></tr>";
echo "<tr><td><b>".i18n("Registration Number")."</b></td><td>$reg_num</td></tr>";
echo "<tr><td><b>".i18n("Project Title")."</b></td><td>$projectinfo->title</td></tr>";
echo "<tr><td><b>".i18n("Category / Division")."</b></td><td>$projectinfo->category / $projectinfo->division</td></tr>";
$q=mysql_query("SELECT students.firstname, $q=mysql_query("SELECT students.firstname,
students.lastname, students.lastname,
@ -82,43 +85,60 @@ echo mysql_Error();
while($studentinfo=mysql_fetch_object($q)) while($studentinfo=mysql_fetch_object($q))
{ {
if($studnum==1) if($studnum==1)
echo "<tr><td><b>".i18n("School").":</b></td><td>$studentinfo->school </td></tr>"; echo "<tr><td><b>".i18n("School")."</b></td><td>$studentinfo->school </td></tr>";
echo "<tr><td><b>".i18n("Student %1",array($studnum)).":</b></td><td>$studentinfo->firstname $studentinfo->lastname </td></tr>"; echo "<tr><td><b>".i18n("Student %1",array($studnum))."</b></td><td>$studentinfo->firstname $studentinfo->lastname </td></tr>";
} }
echo "</table>\n"; echo "</table>\n";
echo "<br />"; echo "<br />";
echo "<table style=\"margin-left: 30px;\">";
echo "<tr><td colspan=\"3\">"; if($r->status!='complete')
echo i18n("Is this the correct form to register?"); {
echo "</td></tr>"; echo "<table style=\"margin-left: 30px;\">";
echo "<tr>"; echo "<tr><td colspan=\"3\">";
echo "<td>"; echo i18n("Is this the correct form to register?");
echo "</td></tr>";
echo "<tr>";
echo "<td>";
echo "<form method=\"post\" action=\"registration_receivedforms.php\">"; echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />"; echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedno\" />"; echo "<input type=\"hidden\" name=\"action\" value=\"receivedno\" />";
echo "<input type=submit value=\"No\" />"; echo "<input type=submit value=\"".i18n("No, this is the wrong form")."\" style=\"width: 400px;\"/>";
echo "</form>"; echo "</form>";
echo "</td>\n";
echo "<td width=\"50\">&nbsp;</td>";
echo "<td>";
echo "<form method=\"post\" action=\"registration_receivedforms.php\">"; echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />"; echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedyes\" />"; echo "<input type=\"hidden\" name=\"action\" value=\"receivedyes\" />";
echo "<input type=submit value=\"Yes\" />"; echo "<input type=submit value=\"".i18n("Yes, right form with registration fee")."\" style=\"width: 400px;\"/>";
echo "</form>"; echo "</form>";
echo "</td>\n";
echo "</tr>";
echo "</table>";
$showformatbottom=false; echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedyesnocash\" />";
echo "<input type=submit value=\"".i18n("Yes, right form without registration fee")."\" style=\"width: 400px;\"/>";
echo "</form>";
echo "<br />";
echo "</td>\n";
echo "</tr>";
echo "</table>";
$showformatbottom=false;
}
else
{
echo i18n("This form has already been received. Registration is complete");
echo "<br />";
echo "<br />";
echo "<hr />";
}
} }
else else
{ {
echo error(i18n("All Registration sections are not complete. Cannot register")); echo error(i18n("All registration sections are not complete. Cannot register incomplete form"));
} }
} }
} }
@ -133,11 +153,17 @@ echo mysql_Error();
else if($_POST['action']=="receivedyes" && $_POST['registration_number']) else if($_POST['action']=="receivedyes" && $_POST['registration_number'])
{ {
//actually set it to 'closed' //actually set it to 'closed'
mysql_query("UPDATE registrations SET status='closed' WHERE num='".$_POST['registration_number']."'"); mysql_query("UPDATE registrations SET status='complete' WHERE num='".$_POST['registration_number']."'");
//FIXME: assign the project number here as well! //FIXME: assign the project number here as well!
echo happy(i18n("Registration of form %1 successfully completed",array($registration_number))); echo happy(i18n("Registration of form %1 successfully completed",array($registration_number)));
} }
else if($_POST['action']=="receivedyesnocash" && $_POST['registration_number'])
{
//actually set it to 'closed'
mysql_query("UPDATE registrations SET status='paymentpending' WHERE num='".$_POST['registration_number']."'");
echo happy(i18n("Registration of form %1 marked as payment pending",array($registration_number)));
}
else if($_POST['action']=="receivedno" && $_POST['registration_number']) else if($_POST['action']=="receivedno" && $_POST['registration_number'])
{ {
echo notice(i18n("Registration of form %1 cancelled",array($registration_number))); echo notice(i18n("Registration of form %1 cancelled",array($registration_number)));
@ -147,7 +173,7 @@ echo mysql_Error();
if($showformatbottom) if($showformatbottom)
{ {
echo "<h3>".i18n("Input New Received Form")."</h3>"; echo "<h3>".i18n("Input Received Form")."</h3>";
echo "<form method=\"post\" action=\"registration_receivedforms.php\">"; echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"received\" />"; echo "<input type=\"hidden\" name=\"action\" value=\"received\" />";
echo i18n("Enter the registration number from the form: ")."<br />"; echo i18n("Enter the registration number from the form: ")."<br />";