forked from science-ation/science-ation
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
This commit is contained in:
parent
691cd9152f
commit
2caf3a6678
@ -1,11 +1,14 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
function studentStatus()
|
function studentStatus($reg_id="")
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$required_fields=array("firstname","lastname","address","city","postalcode","phone","email","grade","dateofbirth","schools_id","tshirt");
|
$required_fields=array("firstname","lastname","address","city","postalcode","phone","email","grade","dateofbirth","schools_id","tshirt");
|
||||||
|
|
||||||
$q=mysql_query("SELECT * FROM students 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 students WHERE registrations_id='$rid' AND year='".$config['FAIRYEAR']."'");
|
||||||
|
|
||||||
//if we dont have the minimum, return incomplete
|
//if we dont have the minimum, return incomplete
|
||||||
if(mysql_num_rows($q)<$config['minstudentsperproject'])
|
if(mysql_num_rows($q)<$config['minstudentsperproject'])
|
||||||
@ -26,17 +29,20 @@ function studentStatus()
|
|||||||
return "complete";
|
return "complete";
|
||||||
}
|
}
|
||||||
|
|
||||||
function emergencycontactStatus()
|
function emergencycontactStatus($reg_id="")
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$required_fields=array("firstname","lastname","relation","phone1");
|
$required_fields=array("firstname","lastname","relation","phone1");
|
||||||
|
|
||||||
$sq=mysql_query("SELECT id FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
|
if($reg_id) $rid=$reg_id;
|
||||||
|
else $rid=$_SESSION['registration_id'];
|
||||||
|
|
||||||
|
$sq=mysql_query("SELECT id FROM students WHERE registrations_id='$rid' AND year='".$config['FAIRYEAR']."'");
|
||||||
$numstudents=mysql_num_rows($sq);
|
$numstudents=mysql_num_rows($sq);
|
||||||
|
|
||||||
while($sr=mysql_fetch_object($sq))
|
while($sr=mysql_fetch_object($sq))
|
||||||
{
|
{
|
||||||
$q=mysql_query("SELECT * FROM emergencycontact WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."' AND students_id='$sr->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);
|
$r=mysql_fetch_object($q);
|
||||||
|
|
||||||
@ -53,12 +59,15 @@ function emergencycontactStatus()
|
|||||||
return "complete";
|
return "complete";
|
||||||
}
|
}
|
||||||
|
|
||||||
function projectStatus()
|
function projectStatus($reg_id="")
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$required_fields=array("title","projectcategories_id","projectdivisions_id","summary","language","req_table","req_electricity");
|
$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 we dont have a project entry yet, return empty
|
||||||
if(!mysql_num_rows($q))
|
if(!mysql_num_rows($q))
|
||||||
@ -80,19 +89,21 @@ function projectStatus()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function mentorStatus()
|
function mentorStatus($reg_id="")
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$required_fields=array("firstname","lastname","phone","email","organization","description");
|
$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
|
//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);
|
$r=mysql_fetch_object($q);
|
||||||
if($r->nummentors==null)
|
if($r->nummentors==null)
|
||||||
return "incomplete";
|
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 we dont have the minimum, return incomplete
|
||||||
if(mysql_num_rows($q)<$config['minmentorserproject'])
|
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
|
//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))
|
while($r=mysql_fetch_object($q))
|
||||||
{
|
{
|
||||||
$safetyanswers[$r->safetyquestions_id]=$r->answer;
|
$safetyanswers[$r->safetyquestions_id]=$r->answer;
|
||||||
|
@ -126,6 +126,15 @@ echo "</td></tr>";
|
|||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
|
||||||
echo "<br /><br />";
|
echo "<br /><br />";
|
||||||
|
echo "<h3>".i18n("Registration Instructions")."</h3>";
|
||||||
|
|
||||||
|
//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 "<br /><br />";
|
||||||
|
|
||||||
|
|
||||||
echo "<a href=\"register_participants.php?action=logout\">".i18n("Logout")."</a>";
|
echo "<a href=\"register_participants.php?action=logout\">".i18n("Logout")."</a>";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user