properly detect when a school is selected under certain circumstances

This commit is contained in:
james 2006-02-24 18:28:21 +00:00
parent 2a5da6597d
commit d9dc85c1d7

View File

@ -121,7 +121,7 @@ if($_POST['action']=="save")
{
//if they use schoolpassword or singlepassword, then we dont need to save teh schools_id because its already set when they inserted the record, and we dont allow them to change their school.
if(( $config['participant_registration_type']=="schoolpassword" || $config['participant_registration_type']=="invite") && !$_POST['schools_id'])
if(( $config['participant_registration_type']=="schoolpassword" || $config['participant_registration_type']=="invite") && !$_POST['schools_id'][$x])
{
$schoolquery="";
}
@ -381,7 +381,7 @@ if($config['participant_student_personal']=="yes")
echo "<tr>\n";
echo " <td>".i18n("School")."</td><td colspan=\"3\">";
if( $config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" || !$studentinfo->schools_id )
if( $config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" || ($studentinfo && !$studentinfo->schools_id) )
{
$schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school");
echo "<select name=\"schools_id[$x]\">\n";