- Add a config option (default 'no') to ask the students for a pronunciation

key for their name.  The idea is that it's for those often mis-pronounced
  names at the award ceremony.
This commit is contained in:
dave 2007-01-31 07:35:08 +00:00
parent b6b93e1060
commit caeb7cbe78
3 changed files with 15 additions and 2 deletions

View File

@ -1 +1 @@
41
42

4
db/db.update.42.sql Normal file
View File

@ -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');

View File

@ -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 " <td>".i18n("First Name")."</td><td><input type=\"text\" name=\"firstname[$x]\" value=\"$studentinfo->firstname\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Last Name")."</td><td><input type=\"text\" name=\"lastname[$x]\" value=\"$studentinfo->lastname\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";
if($config['participant_student_pronunciation']=='yes') {
echo "<tr>\n";
echo " <td>".i18n("Name Pronunciation Key")."</td><td colspan><input type=\"text\" name=\"pronunciation[$x]\" value=\"{$studentinfo->pronunciation}\" /></td>\n";
echo " <td colspan=2><font size=-1>(for award ceremony, fill out this Pronunciation Key if your name is often mispronounced)</font></td>";
echo "</tr>\n";
}
if($config['participant_student_personal']=="yes")
{