Only allow the participants to change their school if the registration type is 'open' or 'singlepassword'. if it is 'schoolpassword' or 'invite' we already know what school they are from.

This commit is contained in:
james 2006-01-20 19:48:37 +00:00
parent 725a4c91d7
commit a7bcc3c5b3

View File

@ -329,16 +329,25 @@ else if($newstatus=="complete")
echo "<tr>\n";
echo " <td>".i18n("School")."</td><td colspan=\"3\">";
$schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school");
echo "<select name=\"schools_id[$x]\">\n";
echo "<option value=\"\">".i18n("Choose School")."</option>\n";
while($r=mysql_fetch_object($schoolq))
if($config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" )
{
if($studentinfo->schools_id==$r->id) $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"$r->id\">".htmlspecialchars($r->school)."</option>\n";
$schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school");
echo "<select name=\"schools_id[$x]\">\n";
echo "<option value=\"\">".i18n("Choose School")."</option>\n";
while($r=mysql_fetch_object($schoolq))
{
if($studentinfo->schools_id==$r->id) $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"$r->id\">".htmlspecialchars($r->school)."</option>\n";
}
echo "</select>".REQUIREDFIELD;
}
else
{
$schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' AND id='$studentinfo->schools_id'");
$r=mysql_fetch_object($schoolq);
echo $r->school;
}
echo "</select>".REQUIREDFIELD;
echo "</td>\n";
echo "</tr>\n";