diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 87523dd..d81cc07 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -41 +42 diff --git a/db/db.update.42.sql b/db/db.update.42.sql new file mode 100644 index 0000000..4128c29 --- /dev/null +++ b/db/db.update.42.sql @@ -0,0 +1,4 @@ +ALTER TABLE `students` ADD `pronunciation` VARCHAR( 64 ) NOT NULL AFTER `lastname`; + +INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year` ) VALUES ( 'participant_student_pronunciation', 'no', 'Participant Registration', 'yesno', '', '1020', 'Ask the student for a pronunciation key for their name (for award ceremonies)', '-1'); + diff --git a/register_participants_students.php b/register_participants_students.php index 592a309..1ba48c1 100644 --- a/register_participants_students.php +++ b/register_participants_students.php @@ -93,10 +93,11 @@ if($_POST['action']=="save") } //INSERT new record $dob=$_POST['year'][$x]."-".$_POST['month'][$x]."-".$_POST['day'][$x]; - mysql_query("INSERT INTO students (registrations_id,firstname,lastname,sex,email,address,city,province,postalcode,phone,dateofbirth,grade,schools_id,tshirt,medicalalert,foodreq,teachername,teacheremail,year) VALUES (". + mysql_query("INSERT INTO students (registrations_id,firstname,lastname,pronunciation,sex,email,address,city,province,postalcode,phone,dateofbirth,grade,schools_id,tshirt,medicalalert,foodreq,teachername,teacheremail,year) VALUES (". "'".$_SESSION['registration_id']."', ". "'".mysql_escape_string(stripslashes($_POST['firstname'][$x]))."', ". "'".mysql_escape_string(stripslashes($_POST['lastname'][$x]))."', ". + "'".mysql_escape_string(stripslashes($_POST['pronunciation'][$x]))."', ". "'".mysql_escape_string(stripslashes($_POST['sex'][$x]))."', ". "'".mysql_escape_string(stripslashes($_POST['email'][$x]))."', ". "'".mysql_escape_string(stripslashes($_POST['address'][$x]))."', ". @@ -136,6 +137,7 @@ if($_POST['action']=="save") mysql_query("UPDATE students SET ". "firstname='".mysql_escape_string(stripslashes($_POST['firstname'][$x]))."', ". "lastname='".mysql_escape_string(stripslashes($_POST['lastname'][$x]))."', ". + "pronunciation='".mysql_escape_string(stripslashes($_POST['pronunciation'][$x]))."', ". "sex='".mysql_escape_string(stripslashes($_POST['sex'][$x]))."', ". "email='".mysql_escape_string(stripslashes($_POST['email'][$x]))."', ". "address='".mysql_escape_string(stripslashes($_POST['address'][$x]))."', ". @@ -263,6 +265,13 @@ else if($newstatus=="complete") echo " ".i18n("First Name")."firstname\" />".REQUIREDFIELD."\n"; echo " ".i18n("Last Name")."lastname\" />".REQUIREDFIELD."\n"; echo "\n"; +if($config['participant_student_pronunciation']=='yes') { + echo "\n"; + echo " ".i18n("Name Pronunciation Key")."pronunciation}\" />\n"; + echo " (for award ceremony, fill out this Pronunciation Key if your name is often mispronounced)"; + echo "\n"; +} + if($config['participant_student_personal']=="yes") {