forked from science-ation/science-ation
Add sex dropdown list
This commit is contained in:
parent
675e9e41f2
commit
14597ed325
@ -47,10 +47,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,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,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['sex'][$x]))."', ".
|
||||
"'".mysql_escape_string(stripslashes($_POST['email'][$x]))."', ".
|
||||
"'".mysql_escape_string(stripslashes($_POST['address'][$x]))."', ".
|
||||
"'".mysql_escape_string(stripslashes($_POST['city'][$x]))."', ".
|
||||
@ -78,6 +79,7 @@ echo mysql_error();
|
||||
mysql_query("UPDATE students SET ".
|
||||
"firstname='".mysql_escape_string(stripslashes($_POST['firstname'][$x]))."', ".
|
||||
"lastname='".mysql_escape_string(stripslashes($_POST['lastname'][$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]))."', ".
|
||||
"city='".mysql_escape_string(stripslashes($_POST['city'][$x]))."', ".
|
||||
@ -189,6 +191,21 @@ else if($newstatus=="complete")
|
||||
echo " <td>".i18n("First Name")."</td><td><input type=\"text\" name=\"firstname[$x]\" value=\"$studentinfo->firstname\" /></td>\n";
|
||||
echo " <td>".i18n("Last Name")."</td><td><input type=\"text\" name=\"lastname[$x]\" value=\"$studentinfo->lastname\" /></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td>".i18n("Sex")."</td><td>";
|
||||
echo "<select name=\"sex[$x]\">";
|
||||
echo "<option value=\"\">".i18n("Select")."</option>\n";
|
||||
if($studentinfo->sex=="male") $sel="selected=\"selected\""; else $sel="";
|
||||
echo "<option $sel value=\"male\">".i18n("Male")."</option>\n";
|
||||
if($studentinfo->sex=="female") $sel="selected=\"selected\""; else $sel="";
|
||||
echo "<option $sel value=\"female\">".i18n("Female")."</option>\n";
|
||||
echo "</select>";
|
||||
|
||||
echo "</td>\n";
|
||||
echo " <td></td><td></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td>".i18n("Email Address")."</td><td><input type=\"text\" name=\"email[$x]\" value=\"$studentinfo->email\" /></td>\n";
|
||||
echo " <td>".i18n("City")."</td><td><input type=\"text\" name=\"city[$x]\" value=\"$studentinfo->city\" /></td>\n";
|
||||
@ -230,7 +247,7 @@ else if($newstatus=="complete")
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td>".i18n("Medical Alert Info")."</td><td colspan=\"3\">";
|
||||
echo "<input name=\"medicalalert\" type=\"text\" size=\"50\" value=\"$studentinfo->medicalalert\" />";
|
||||
echo "<input name=\"medicalalert[$x]\" type=\"text\" size=\"50\" value=\"$studentinfo->medicalalert\" />";
|
||||
echo "</td>";
|
||||
echo "</tr>\n";
|
||||
|
||||
@ -238,7 +255,7 @@ else if($newstatus=="complete")
|
||||
{
|
||||
echo "<tr>\n";
|
||||
echo "<td>".i18n("Special Food Requirements")."</td><td colspan=\"3\">";
|
||||
echo "<input name=\"foodreq\" type=\"text\" size=\"50\" value=\"$studentinfo->foodreq\" />";
|
||||
echo "<input name=\"foodreq[$x]\" type=\"text\" size=\"50\" value=\"$studentinfo->foodreq\" />";
|
||||
echo "</td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user