From ebeadd6470390345af15a8c548061553440279bd Mon Sep 17 00:00:00 2001 From: james Date: Fri, 7 Jan 2005 04:45:17 +0000 Subject: [PATCH] Registraiton list Fix received forms to accept paid/not paid --- admin/registration.php | 1 + admin/registration_list.php | 126 +++++++++++++++++++++++++++ admin/registration_receivedforms.php | 86 +++++++++++------- 3 files changed, 183 insertions(+), 30 deletions(-) create mode 100644 admin/registration_list.php diff --git a/admin/registration.php b/admin/registration.php index 3cd66dc6..67666d21 100644 --- a/admin/registration.php +++ b/admin/registration.php @@ -4,6 +4,7 @@ echo "<< ".i18n("Back to Administration")."
"; echo "
"; echo "View/Input Received Forms
"; + echo "Registration List
"; diff --git a/admin/registration_list.php b/admin/registration_list.php new file mode 100644 index 00000000..3e15a64f --- /dev/null +++ b/admin/registration_list.php @@ -0,0 +1,126 @@ +<< ".i18n("Back to Administration").""; + echo "   "; + echo "<< ".i18n("Back to Registration").""; + echo "
"; + echo "
"; + echo i18n("Choose Status").":"; + echo "
"; + echo ""; + 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 ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + 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 ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $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 ""; + echo ""; + + echo ""; + } + echo "
StatusReg NumProject TitleAge CategoryDivisionSchool(s)Student(s)
$status_text$r->reg_num$r->title$r->category$r->division$schools$students
\n"; + echo "
"; + + send_footer(); +?> + + + + + + + + + + + + + + + + + + + + diff --git a/admin/registration_receivedforms.php b/admin/registration_receivedforms.php index b8e461c2..fb010966 100644 --- a/admin/registration_receivedforms.php +++ b/admin/registration_receivedforms.php @@ -18,16 +18,12 @@ $showformatbottom=true; $r=mysql_fetch_object($q); $reg_id=$r->id; $reg_num=$r->num; + $reg_status=$r->status; if($r->status=='new') { 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 { //make sure all of the statuses are correct @@ -62,10 +58,17 @@ echo mysql_Error(); $projectinfo=mysql_fetch_object($q); echo ""; echo ""; - - echo ""; - echo ""; - echo ""; + switch($reg_status) + { + case "paymentpending": $status_text="Payment Pending"; break; + case "complete": $status_text="Complete"; break; + case "open": $status_text="Open"; break; + } + echo ""; + + echo ""; + echo ""; + echo ""; $q=mysql_query("SELECT students.firstname, students.lastname, @@ -82,43 +85,60 @@ echo mysql_Error(); while($studentinfo=mysql_fetch_object($q)) { if($studnum==1) - echo ""; + echo ""; - echo ""; + echo ""; } echo "
".i18n("Registration Summary for %1",array($reg_num))."
".i18n("Registration Number").":$reg_num
".i18n("Project Title").":$projectinfo->title
".i18n("Category / Division").":$projectinfo->category / $projectinfo->division
".i18n("Registration Status")."$status_text
".i18n("Registration Number")."$reg_num
".i18n("Project Title")."$projectinfo->title
".i18n("Category / Division")."$projectinfo->category / $projectinfo->division
".i18n("School").":$studentinfo->school
".i18n("School")."$studentinfo->school
".i18n("Student %1",array($studnum)).":$studentinfo->firstname $studentinfo->lastname
".i18n("Student %1",array($studnum))."$studentinfo->firstname $studentinfo->lastname
\n"; - echo "
"; - echo ""; - echo ""; - echo ""; - echo "\n"; + echo ""; + echo "
"; - echo i18n("Is this the correct form to register?"); - echo "
"; + echo "
"; + + if($r->status!='complete') + { + echo ""; + echo ""; + echo ""; + echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "
"; + echo i18n("Is this the correct form to register?"); + echo "
"; + echo "
"; echo ""; echo ""; - echo ""; + echo ""; echo "
"; - echo "
 "; echo "
"; echo ""; echo ""; - echo ""; + echo ""; echo "
"; - echo "
"; - $showformatbottom=false; + echo "
"; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "
"; + + echo "
"; + $showformatbottom=false; + } + else + { + echo i18n("This form has already been received. Registration is complete"); + echo "
"; + echo "
"; + echo "
"; + } + } 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']) { //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! 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']) { echo notice(i18n("Registration of form %1 cancelled",array($registration_number))); @@ -147,7 +173,7 @@ echo mysql_Error(); if($showformatbottom) { - echo "

".i18n("Input New Received Form")."

"; + echo "

".i18n("Input Received Form")."

"; echo "
"; echo ""; echo i18n("Enter the registration number from the form: ")."
";