From 056d4d23bb210865461fb62adbc428f7dfb6cd00 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 3 Mar 2011 21:55:05 +0000 Subject: [PATCH] Updates to old participant pages to work with new user system --- participant.inc.php | 2 +- register_participants_emergencycontact.php | 30 +++++++----------- register_participants_main.php | 2 +- register_participants_namecheck.php | 12 +++----- register_participants_safety.php | 36 +++++----------------- 5 files changed, 25 insertions(+), 57 deletions(-) diff --git a/participant.inc.php b/participant.inc.php index e24fcbe..d57dc2e 100644 --- a/participant.inc.php +++ b/participant.inc.php @@ -219,6 +219,7 @@ function safetyStatus($reg_id="") //grab all of their answers $q=mysql_query("SELECT * FROM safety WHERE registrations_id='$rid'"); + $safetyanswers=array(); while($r=mysql_fetch_object($q)) { $safetyanswers[$r->safetyquestions_id]=$r->answer; } @@ -231,7 +232,6 @@ function safetyStatus($reg_id="") } } return "complete"; - } function spawardStatus($reg_id="") diff --git a/register_participants_emergencycontact.php b/register_participants_emergencycontact.php index 90bed9a..237d8d5 100644 --- a/register_participants_emergencycontact.php +++ b/register_participants_emergencycontact.php @@ -23,15 +23,11 @@ ?> << ".i18n("Back to Participant Registration Summary")."
"; echo "
"; -$studentstatus=studentStatus(); -if($studentstatus!="complete") -{ - echo error(i18n("Please complete the Student Information Page first")); +$studentstatus=studentIndividualStatus($u['id']); +if($studentstatus!="complete") { + echo error(i18n("Please complete the Student Information Page first")); send_footer(); exit; } //output the current status -$newstatus=emergencycontactStatus(); -if($newstatus!="complete") -{ +$newstatus=emergencycontactStatus($u['registrations_id']); +if($newstatus!="complete") { echo error(i18n("Emergency Contact Information Incomplete")); } -else if($newstatus=="complete") -{ +else if($newstatus=="complete") { echo happy(i18n("Emergency Contact Information Complete")); } -$user = user_load($_SESSION['users_id']); -$registrations_id = $user['registrations_id']; +$registrations_id = $u['registrations_id']; $sq=mysql_query("SELECT id,firstname,lastname FROM users WHERE registrations_id='$registrations_id' AND conferences_id='".$conference['id']."'"); $numstudents=mysql_num_rows($sq); diff --git a/register_participants_main.php b/register_participants_main.php index 61994d1..55757c7 100644 --- a/register_participants_main.php +++ b/register_participants_main.php @@ -71,7 +71,7 @@ echo "
"; //participant information echo "
"; - echo ""; + echo ""; echo i18n("Student Information"); echo ""; echo ""; diff --git a/register_participants_namecheck.php b/register_participants_namecheck.php index 0ac2bb2..07e1669 100644 --- a/register_participants_namecheck.php +++ b/register_participants_namecheck.php @@ -25,14 +25,14 @@ firstname} {$s->lastname}"; } - - //send the header send_header("Participant Registration - Check Your Name"); @@ -61,15 +59,15 @@ if(!array_key_exists('registrations_id', $u) || $u['registrations_id'] == null){ $pu = ($_POST['punc'] == 'yes') ? true : false; if($sp && $ca && $pu) { - $q=mysql_query("UPDATE users SET namecheck_complete='yes' WHERE registrations_id='{$_SESSION['registration_id']}'"); + $q=mysql_query("UPDATE users SET namecheck_complete='yes' WHERE registrations_id='{$u['registrations_id']}'"); } else if($s->namecheck_complete!='no') { - $q=mysql_query("UPDATE users SET namecheck_complete='no' WHERE registrations_id='{$_SESSION['registration_id']}'"); + $q=mysql_query("UPDATE users SET namecheck_complete='no' WHERE registrations_id='{$u['registrations_id']}'"); } } } //output the current status -$newstatus=namecheckStatus($_SESSION['registration_id']); +$newstatus=namecheckStatus($u['registrations_id']); if($newstatus!="complete") { echo error(i18n("Name Check Incomplete. Please check your name and check all the boxes below")); } diff --git a/register_participants_safety.php b/register_participants_safety.php index 2562d4d..9de1d3d 100644 --- a/register_participants_safety.php +++ b/register_participants_safety.php @@ -24,34 +24,12 @@ << ".i18n("Back to Participant Registration Summary")."
"; echo "
"; @@ -65,12 +43,12 @@ echo mysql_error(); } else { //first we will delete all their old answer, its easier to delete and re-insert in this case then it would be to find the corresponding answers and update them - mysql_query("DELETE FROM safety WHERE registrations_id='".$_SESSION['registration_id']."' AND conferences_id='".$conference['id']."'"); + mysql_query("DELETE FROM safety WHERE registrations_id='".$u['registrations_id']."' AND conferences_id='".$conference['id']."'"); if(is_array($_POST['safety'])) { $safetyids=array_keys($_POST['safety']); foreach($safetyids AS $key=>$val) { mysql_query("INSERT INTO safety (registrations_id,safetyquestions_id,conferences_id,answer) VALUES (". - "'".$_SESSION['registration_id']."', ". + "'".$u['registrations_id']."', ". "'$val', ". "'".$conference['id']."', ". "'".mysql_escape_string(stripslashes($_POST['safety'][$val]))."')"); @@ -81,7 +59,7 @@ echo mysql_error(); } //output the current status -$newstatus=safetyStatus(); +$newstatus=safetyStatus($u['registrations_id']); if($newstatus!="complete") { echo error(i18n("Safety Information Incomplete. You must agree to / answer all required safety questions!")); } @@ -89,7 +67,7 @@ else if($newstatus=="complete") { echo happy(i18n("Safety Information Complete")); } - $q=mysql_query("SELECT * FROM safety WHERE registrations_id='".$_SESSION['registration_id']."'"); + $q=mysql_query("SELECT * FROM safety WHERE registrations_id='".$u['registrations_id']."'"); while($r=mysql_fetch_object($q)) { $safetyanswers[$r->safetyquestions_id]=$r->answer; }