From e091cb2e51634699a513373d8fefad15e178f7c6 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 3 Dec 2004 04:28:18 +0000 Subject: [PATCH] Add emit month/day/year functions to common Make students page show the number of forms for the number of students --- common.inc.php | 56 +++++++++++++++++++++++++++ register_participants.inc.php | 2 +- register_participants.php | 2 +- register_participants_main.php | 4 +- register_participants_students.php | 61 +++++++++++++++++++++++++++++- 5 files changed, 120 insertions(+), 5 deletions(-) diff --git a/common.inc.php b/common.inc.php index b1dbb75..46da522 100644 --- a/common.inc.php +++ b/common.inc.php @@ -217,4 +217,60 @@ function send_footer() } +function emit_month_selector($name,$selected="") +{ + echo "\n"; + +} + + +function emit_day_selector($name,$selected="") +{ + echo "\n"; + +} + +function emit_year_selector($name,$selected="",$min=0,$max=0) +{ + $curyear=date("Y"); + echo "\n"; +} + + + + + ?> diff --git a/register_participants.inc.php b/register_participants.inc.php index 245deeb..a2853b8 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -2,7 +2,7 @@ function studentStatus() { global $config; - $required_fields=array("name","address","city","postalcode","phone","email","grade","age"); + $required_fields=array("firstname","lastname","address","city","postalcode","phone","email","grade","age"); $q=mysql_query("SELECT * FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); diff --git a/register_participants.php b/register_participants.php index 6803f7c..810ffab 100644 --- a/register_participants.php +++ b/register_participants.php @@ -27,7 +27,7 @@ else if($_POST['action']=="continue") { - $q=mysql_query("SELECT registrations.id AS regid, registrations.num AS regnum, students.id AS studentid, students.name FROM registrations,students ". + $q=mysql_query("SELECT registrations.id AS regid, registrations.num AS regnum, students.id AS studentid, students.firstname FROM registrations,students ". "WHERE students.email='".$_SESSION['email']."' ". "AND registrations.num='".$_POST['regnum']."' ". "AND students.registrations_id=registrations.id ". diff --git a/register_participants_main.php b/register_participants_main.php index 9bc284d..6567bf9 100644 --- a/register_participants_main.php +++ b/register_participants_main.php @@ -14,7 +14,7 @@ exit; } - $q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.name FROM registrations,students ". + $q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.firstname FROM registrations,students ". "WHERE students.email='".$_SESSION['email']."' ". "AND registrations.num='".$_SESSION['registration_number']."' ". "AND registrations.id='".$_SESSION['registration_id']."' ". @@ -33,7 +33,7 @@ echo mysql_error(); $r=mysql_fetch_object($q); send_header("Participant Registration - Summary"); - echo i18n("Hello %1",array($r->name)); + echo i18n("Hello %1",array($r->firstname)); echo "
"; echo "
"; echo i18n("Please use the checklist below to complete your registration. Click on an item in the table to edit that information. When you have entered all information, the Status field will change to Complete"); diff --git a/register_participants_students.php b/register_participants_students.php index 4388b33..c3d9c80 100644 --- a/register_participants_students.php +++ b/register_participants_students.php @@ -13,7 +13,7 @@ exit; } - $q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.name FROM registrations,students ". + $q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.firstname FROM registrations,students ". "WHERE students.email='".$_SESSION['email']."' ". "AND registrations.num='".$_SESSION['registration_number']."' ". "AND registrations.id='".$_SESSION['registration_id']."' ". @@ -72,7 +72,66 @@ echo mysql_error(); $studentinfo=mysql_fetch_object($q); echo "

".i18n("Student %1 Details",array($x))."

"; echo ""; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + + echo "\n"; + echo " \n"; + echo " "; + echo ""; +/* + + + + + + + + + +
".i18n("First Name")."firstname\">".i18n("Last Name")."lastname\">
".i18n("Address")."address\">".i18n("City")."city\">
".i18n("Postal Code")."postalcode\">".i18n("Phone")."phone\">
".i18n("Date of Birth")."\n"; + list($year,$month,$day)=split("-",$studentinfo->dateofbirth); + echo "
"; + emit_day_selector("day$x",$day); + echo "\n"; + emit_month_selector("month$x",$month); + echo "\n"; + emit_year_selector("year$x",$year,date("Y")-19,date("Y")-10); + echo "
\n"; + echo "
".i18n("Grade")."\n"; + + echo "\n"; + echo "
+
+ + + + echo "".i18n("Name").": name\">"; + */ + echo ""; echo "
"; echo "
";