From 2caf3a6678742495b2f2c01be60b01527df7d278 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 7 Jan 2005 04:46:52 +0000 Subject: [PATCH] change all status checker functions to accept a registration id as an optional parameter all a spot for 'instructions text' on the main participant registration page --- register_participants.inc.php | 38 +++++++++++++++++++++++----------- register_participants_main.php | 9 ++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/register_participants.inc.php b/register_participants.inc.php index 3b49f3f..6e64918 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -1,11 +1,14 @@ id'"); + $q=mysql_query("SELECT * FROM emergencycontact WHERE registrations_id='$rid' AND year='".$config['FAIRYEAR']."' AND students_id='$sr->id'"); $r=mysql_fetch_object($q); @@ -53,12 +59,15 @@ function emergencycontactStatus() return "complete"; } -function projectStatus() +function projectStatus($reg_id="") { global $config; $required_fields=array("title","projectcategories_id","projectdivisions_id","summary","language","req_table","req_electricity"); - $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); + if($reg_id) $rid=$reg_id; + else $rid=$_SESSION['registration_id']; + + $q=mysql_query("SELECT * FROM projects WHERE registrations_id='$rid' AND year='".$config['FAIRYEAR']."'"); //if we dont have a project entry yet, return empty if(!mysql_num_rows($q)) @@ -80,19 +89,21 @@ function projectStatus() } -function mentorStatus() +function mentorStatus($reg_id="") { global $config; $required_fields=array("firstname","lastname","phone","email","organization","description"); + if($reg_id) $rid=$reg_id; + else $rid=$_SESSION['registration_id']; //first check the registrations table to see if 'nummentors' is set, or if its null - $q=mysql_query("SELECT nummentors FROM registrations WHERE id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); + $q=mysql_query("SELECT nummentors FROM registrations WHERE id='$rid' AND year='".$config['FAIRYEAR']."'"); $r=mysql_fetch_object($q); if($r->nummentors==null) return "incomplete"; - $q=mysql_query("SELECT * FROM mentors WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); + $q=mysql_query("SELECT * FROM mentors WHERE registrations_id='$rid' AND year='".$config['FAIRYEAR']."'"); //if we dont have the minimum, return incomplete if(mysql_num_rows($q)<$config['minmentorserproject']) @@ -114,10 +125,13 @@ function mentorStatus() } -function safetyStatus() +function safetyStatus($reg_id="") { + if($reg_id) $rid=$reg_id; + else $rid=$_SESSION['registration_id']; + //grab all of their answers - $q=mysql_query("SELECT * FROM safety WHERE registrations_id='".$_SESSION['registration_id']."'"); + $q=mysql_query("SELECT * FROM safety WHERE registrations_id='$rid'"); while($r=mysql_fetch_object($q)) { $safetyanswers[$r->safetyquestions_id]=$r->answer; diff --git a/register_participants_main.php b/register_participants_main.php index e5c817e..c0ae7e4 100644 --- a/register_participants_main.php +++ b/register_participants_main.php @@ -124,9 +124,18 @@ echo ""; echo ""; + + echo "

"; + echo "

".i18n("Registration Instructions")."

"; + + //now get the text of special instructions for the bottom of this page: + $q=mysql_query("SELECT * FROM pagetext WHERE textname='register_participants_main_instructions'"); + $r=mysql_fetch_object($q); + echo nl2br(i18n($r->text)); echo "

"; + echo "".i18n("Logout")."";