Copyright (C) 2005 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> 'committee_main.php', 'Administration' => 'admin/index.php', 'Participant Registration' => 'admin/registration.php') ); echo "
"; $showformatbottom=true; if($_POST['action']=="received" && $_POST['registration_number']) { $q=mysql_query("SELECT * FROM registrations WHERE num='".$_POST['registration_number']."' AND conferences_id='".$conference['id']."'"); if(mysql_num_rows($q)==1) { $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 { //make sure all of the statuses are correct $statusstudent=studentsStatus($reg_id); $statusemergencycontact=emergencycontactStatus($reg_id); $statusproject=projectStatus($reg_id); if($config['participant_mentor']=="yes") $statusmentor=mentorStatus($reg_id); else $statusmentor="complete"; $statussafety=safetyStatus($reg_id); $statusnamecheck=namecheckStatus($reg_id); if( $statusstudent == "complete" && $statusemergencycontact == "complete" && $statusproject == "complete" && $statusmentor == "complete" && $statussafety == "complete" && $statusnamecheck == "complete" ) { $q=mysql_query("SELECT projects.title, projectcategories.category, projectdivisions.division FROM projects,projectcategories,projectdivisions WHERE projects.registrations_id='$reg_id' AND projects.projectcategories_id=projectcategories.id AND projects.projectdivisions_id=projectdivisions.id "); echo mysql_Error(); $projectinfo=mysql_fetch_object($q); 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 users.firstname, users.lastname, schools.school FROM users,schools WHERE users.registrations_id='$reg_id' AND users.schools_id=schools.id "); $studnum=1; while($studentinfo=mysql_fetch_object($q)) { echo ""; echo ""; $studnum++; } list($regfee,$regfeedata) = computeRegistrationFee($reg_id); echo ""; echo "
".i18n("Registration Summary for %1",array($reg_num))."
".i18n("Registration Status")."$status_text
".i18n("Registration Number")."$reg_num
".i18n("Project Title")."$projectinfo->title
".i18n("Category / Division")."$projectinfo->category / $projectinfo->division
".i18n("School %1",array($studnum))."$studentinfo->school
".i18n("Student %1",array($studnum))."$studentinfo->firstname $studentinfo->lastname
".i18n("Registration Fee")."".sprintf("$%.02f", $regfee)."
\n"; echo "
"; if($r->status!='complete') { echo ""; echo ""; echo ""; echo "\n"; echo ""; echo "
"; echo i18n("Is this the correct form to register?"); echo "
"; echo "
"; echo ""; echo ""; echo ""; echo "
"; if($config['regfee']>0) { echo "
"; echo ""; echo ""; echo ""; echo "
"; echo "
"; echo ""; echo ""; echo ""; echo "
"; } else { echo "
"; echo ""; echo ""; echo ""; echo "
"; } echo "
"; echo "
"; $showformatbottom=false; } else { echo i18n("This form has already been received. Registration is complete"); echo "
"; echo "".i18n("Click here to unregister this project").""; echo "
"; echo "
"; } } else { echo error(i18n("All registration sections are not complete. Cannot register incomplete form")); $reg=getRegistration($reg_id); echo ""; echo "Registration Number: {$reg['registration_number']}
\n"; foreach($reg['status'] AS $k=>$v) { echo "\n"; } echo "
$k".outputStatus($v)."
\n"; echo "

\n"; } } } else { echo error(i18n("Invalid Registration Number (%1)",array($_POST['registration_number']))); } } else if(($_POST['action']=="receivedyes" || $_POST['action']=="receivedyesnocash") && $_POST['registration_number']) { $regnum = intval($_POST['registration_number']); $checkNumQuery=mysql_query("SELECT projectnumber FROM projects, registrations WHERE projects.registrations_id = registrations.id AND num='$regnum' AND registrations.conferences_id='{$conference['id']}'"); $checkNumResults=mysql_fetch_object($checkNumQuery); $projectnum=$checkNumResults->projectnumber; $q=mysql_query("SELECT id FROM registrations WHERE num='$regnum' AND conferences_id='{$conference['id']}'"); $r=mysql_fetch_object($q); $reg_id = $r->id; if($projectnum == null) { list($projectnumber,$ps,$pns,$pss) = generateProjectNumber($reg_id); mysql_query("UPDATE projects SET projectnumber='$projectnumber', projectsort='$ps',projectnumber_seq='$pns',projectsort_seq='$pss' WHERE registrations_id='$reg_id' AND conferences_id='{$conference['id']}'"); echo happy(i18n("Assigned Project Number: %1",array($projectnumber))); } else $projectnumber=$projectnum; //get all students with this registration number $recipients=getEmailRecipientsForRegistration($reg_id); if($_POST['action']=="receivedyes") { //actually set it to 'complete' mysql_query("UPDATE registrations SET status='complete' WHERE num='$regnum' AND conferences_id='{$conference['id']}'"); foreach($recipients AS $recip) { $subsub=array(); $subbod=array( "EMAIL"=>$recip['email'], "FIRSTNAME"=>$recip['firstname'], "LASTNAME"=>$recip['lastname'], "USERNAME"=>$recip['username'], "NAME"=>$recip['firstname']." ".$recip['lastname'], "REGNUM"=>$regnum, "PROJECTNUMBER"=>$projectnumber, ); $res=email_send("register_participants_received",$recip['email'],$subsub,$subbod); } echo happy(i18n("Registration of form %1 successfully completed",array($regnum))); } else if($_POST['action']=="receivedyesnocash") { //actually set it to 'paymentpending' mysql_query("UPDATE registrations SET status='paymentpending' WHERE num='$regnum' AND conferences_id='{$conference['id']}'"); foreach($recipients AS $recip) { $subsub=array(); $subbod=array( "EMAIL"=>$recip['email'], "FIRSTNAME"=>$recip['firstname'], "LASTNAME"=>$recip['lastname'], "USERNAME"=>$recip['username'], "NAME"=>$recip['firstname']." ".$recip['lastname'], "REGNUM"=>$regnum, "PROJECTNUMBER"=>$projectnumber, ); email_send("register_participants_paymentpending",$recip['email'],$subsub,$subbod); } echo happy(i18n("Registration of form %1 marked as payment pending",array($regnum))); } } else if($_POST['action']=="receivedno" && $_POST['registration_number']) { echo notice(i18n("Registration of form %1 cancelled",array($_POST['registration_number']))); } else if($_GET['action']=="unregister" && $_GET['registration_number']) { $reg_num=intval(trim($_GET['registration_number'])); $q=mysql_query("SELECT registrations.id AS reg_id, projects.id AS proj_id FROM projects,registrations WHERE projects.registrations_id=registrations.id AND registrations.conferences_id='{$conference['id']}' AND registrations.num='$reg_num'"); $r=mysql_fetch_object($q); mysql_query("UPDATE projects SET projectnumber=null, projectsort=null, projectnumber_seq=0, projectsort_seq=0 WHERE id='$r->proj_id' AND conferences_id='{$conference['id']}'"); mysql_query("UPDATE registrations SET status='open' WHERE id='$r->reg_id' AND conferences_id='{$conference['id']}'"); echo happy(i18n("Successfully unregistered project")); } if($showformatbottom) { echo "
"; echo ""; echo i18n("Enter the registration number from the signature form: ")."
"; echo ""; echo ""; echo "
"; ?>