From dc326ccf86bd750d391024ed5d1154e49b2fd1cc Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 24 Jan 2010 06:47:12 +0000 Subject: [PATCH] fix indentation in student_editor --- admin/student_editor.php | 375 +++++++++++++++++++-------------------- 1 file changed, 186 insertions(+), 189 deletions(-) diff --git a/admin/student_editor.php b/admin/student_editor.php index e74fdf6..b93581c 100644 --- a/admin/student_editor.php +++ b/admin/student_editor.php @@ -24,7 +24,7 @@ "; + echo i18n("Number of students that worked on the project: "); + echo ""; + echo ""; -$numtoshow = intval($_GET['numstudents']); -if($numtoshow == 0) $numtoshow=$numfound; + echo "
"; + for($x=1;$x<=$numtoshow;$x++) { + $studentinfo=mysql_fetch_object($q); + echo "

".i18n("Student %1 Details",array($x))."

"; + //if we have a valid student, set their ID, so we can UPDATE when we submit + //if there is no record for this student, then set the ID to 0, so we will INSERT when we submit + if($studentinfo->id) $id=$studentinfo->id; else $id=0; + //true should work here, it just has to be set to _something_ for it to work. + echo ""; - echo ""; - echo i18n("Number of students that worked on the project: "); - echo ""; + echo ""; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; - $sel = ($numtoshow==$x) ? 'selected="selected"' : ''; - echo "\n"; - } - echo ""; - echo ""; + if($config['participant_student_personal']=="yes") { + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; - echo ""; -for($x=1;$x<=$numtoshow;$x++) { - $studentinfo=mysql_fetch_object($q); - echo "

".i18n("Student %1 Details",array($x))."

"; - //if we have a valid student, set their ID, so we can UPDATE when we submit - //if there is no record for this student, then set the ID to 0, so we will INSERT when we submit - if($studentinfo->id) $id=$studentinfo->id; else $id=0; + echo "\n"; + echo " \n"; - //true should work here, it just has to be set to _something_ for it to work. - echo ""; + if($config['participant_student_personal']=="yes") + { + echo " \n"; + } + else + { + echo ""; + } - //save the ID, or 0 if it doesnt exist - echo ""; - echo "
".i18n("First Name")."firstname\" />".REQUIREDFIELD."".i18n("Last Name")."lastname\" />".REQUIREDFIELD."
".i18n("Gender").""; + echo "".REQUIREDFIELD; + } + echo "
".i18n("Email Address")."email\" />".REQUIREDFIELD."".i18n("City")."city\" />".REQUIREDFIELD."
"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; + echo "\n"; -if($config['participant_student_personal']=="yes") -{ - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; + if($config['participant_student_personal']=="yes") + { + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; - echo "\n"; - echo " \n"; + echo "\n"; + echo " \n"; + } + else + echo ""; - echo " "; - echo ""; - - if($config['participant_student_tshirt']=="yes") - { - echo "\n"; - echo " \n"; + echo REQUIREDFIELD.""; echo ""; - } -if($config['participant_student_personal']=="yes") -{ - echo "\n"; - echo ""; - echo "\n"; -} - - if($config['participant_student_foodreq']=="yes") - { - echo "\n"; - echo ""; - echo "\n"; - } - - echo "\n"; - echo " \n"; + echo " \n"; + echo ""; } - echo "".REQUIREDFIELD; + + if($config['participant_student_personal']=="yes") + { + echo "\n"; + echo ""; + echo "\n"; + } + + if($config['participant_student_foodreq']=="yes") + { + echo "\n"; + echo ""; + echo "\n"; + } + + echo "\n"; + echo " \n"; + echo "\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + + + + + echo "
".i18n("First Name")."firstname\" />".REQUIREDFIELD."".i18n("Last Name")."lastname\" />".REQUIREDFIELD."
".i18n("Gender").""; - echo "".REQUIREDFIELD; -} - echo "
".i18n("Address")."address\" />".REQUIREDFIELD."".i18n($config['provincestate']).""; + emit_province_selector("province[$x]",$studentinfo->province); + echo REQUIREDFIELD."
".i18n($config['postalzip'])."postalcode\" />".REQUIREDFIELD."".i18n("Phone")."phone\" />".REQUIREDFIELD."
".i18n("Email Address")."email\" />".REQUIREDFIELD."
".i18n("Date of Birth")."\n"; + list($year,$month,$day)=split("-",$studentinfo->dateofbirth); + echo "\n"; -} -else -{ - echo ""; -} - - echo "\n"; - -if($config['participant_student_personal']=="yes") -{ - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; - - echo "\n"; - echo " \n"; -} -else - echo ""; + echo "
"; + emit_day_selector("day[$x]",$day); + echo "\n"; + emit_month_selector("month[$x]",$month); + echo "\n"; -if($config['participant_student_personal']=="yes") -{ - echo " ".i18n("City")."city\" />".REQUIREDFIELD."
".i18n("Address")."address\" />".REQUIREDFIELD."".i18n($config['provincestate']).""; - emit_province_selector("province[$x]",$studentinfo->province); - echo REQUIREDFIELD."
".i18n($config['postalzip'])."postalcode\" />".REQUIREDFIELD."".i18n("Phone")."phone\" />".REQUIREDFIELD."
".i18n("Date of Birth")."\n"; - list($year,$month,$day)=split("-",$studentinfo->dateofbirth); - echo "
"; - emit_day_selector("day[$x]",$day); - echo "\n"; - emit_month_selector("month[$x]",$month); - echo "\n"; - - //the year selector should be based on the min/max grades possible - //assume min age of 3 for grade=0 (kindergarden) - //assume max age of 18 for grade=12 - $minyearselect=$config['FAIRYEAR'] - 6 - $config['maxgrade']; - $maxyearselect=$config['FAIRYEAR'] - 3 - $config['mingrade']; + //the year selector should be based on the min/max grades possible + //assume min age of 3 for grade=0 (kindergarden) + //assume max age of 18 for grade=12 + $minyearselect=$config['FAIRYEAR'] - 6 - $config['maxgrade']; + $maxyearselect=$config['FAIRYEAR'] - 3 - $config['mingrade']; emit_year_selector("year[$x]",$year,$minyearselect,$maxyearselect); - echo "".REQUIREDFIELD."
\n"; - echo "
".REQUIREDFIELD."
\n"; + echo "
".i18n("Grade")."\n"; + echo " ".i18n("Grade")."\n"; echo "\n"; - echo REQUIREDFIELD."
".i18n("T-Shirt Size").""; - echo " "; - echo "
".i18n("Medical Alert Info").""; - echo "medicalalert\" />"; - echo "
".i18n("Special Food Requirements").""; - echo "foodreq\" />"; - echo "
".i18n("School").""; - if( $config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" || ($studentinfo && !$studentinfo->schools_id) ) - { - $schoolq=mysql_query("SELECT id,school,city FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by city,school"); - echo "
".i18n("T-Shirt Size").""; + echo " "; + echo "
".i18n("Medical Alert Info").""; + echo "medicalalert\" />"; + echo "
".i18n("Special Food Requirements").""; + echo "foodreq\" />"; + echo "
".i18n("School").""; + if( $config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" || ($studentinfo && !$studentinfo->schools_id) ) + { + $schoolq=mysql_query("SELECT id,school,city FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by city,school"); + echo "".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 "
".i18n("Teacher Name")."teachername\" />".i18n("Teacher Email")."teacheremail\" />
"; + + if($numfound>$config['minstudentsperproject'] && $studentinfo->id) + { + /* Create a hidden with same id as the button and some extra, so we can find it inside + * the button even with: this.id"+_studebts_id" */ + echo "id}_students_id\" name=\"students_remove[]\" value=\"{$studentinfo->id}\" />"; + + /* Define the button */ + echo "
"; + + echo "

"; + } + + echo "
"; + echo "
"; } - 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 "\n"; - echo "\n"; - - echo "\n"; - echo " ".i18n("Teacher Name")."teachername\" />\n"; - echo " ".i18n("Teacher Email")."teacheremail\" />\n"; - echo "\n"; - - - - - echo ""; - - if($numfound>$config['minstudentsperproject'] && $studentinfo->id) - { - /* Create a hidden with same id as the button and some extra, so we can find it inside - * the button even with: this.id"+_studebts_id" */ - echo "id}_students_id\" name=\"students_remove[]\" value=\"{$studentinfo->id}\" />"; - - /* Define the button */ - echo "
"; - - echo "

"; - } - echo "
"; + echo i18n("WARNING! If you make a change to the grade that would affect the project number, you must update the project number manually, it will NOT be automatically updated"); + echo "
"; + echo "\n"; + echo ""; echo "
"; - } -echo "
"; -echo i18n("WARNING! If you make a change to the grade that would affect the project number, you must update the project number manually, it will NOT be automatically updated"); -echo "
"; - echo "\n"; - echo ""; - echo "
"; }