- Add an option to the award ceremony script to show the pronunciation key (if

the students entered it)
- Add an option to the award ceremony script to filter the awards by age
  category (the GVRSF needs one script for juniors, and another for
  intermediate/senior :)
This commit is contained in:
dave 2008-02-29 07:10:08 +00:00
parent 3a1b4cca15
commit 2d052c056f
2 changed files with 34 additions and 0 deletions

View File

@ -18,6 +18,18 @@
if($_GET['show_unawarded_prizes']=="on") $show_unawarded_prizes="yes"; if($_GET['show_unawarded_prizes']=="on") $show_unawarded_prizes="yes";
else $show_unawarded_prizes="no"; else $show_unawarded_prizes="no";
$show_pronunciation= ($_GET['show_pronunciation'] == 'on') ? TRUE : FALSE;
if(is_array($_GET['show_category'])) {
$show_category = array();
foreach($_GET['show_category'] as $id=>$val) {
$show_category[] = "projects.projectcategories_id='$id'";
}
$and_categories = join(' OR ', $show_category);
} else {
$and_categories = '1';
}
$type=$_GET['type']; $type=$_GET['type'];
if(!$type) $type="pdf"; if(!$type) $type="pdf";
@ -72,6 +84,7 @@
winners.projects_id, winners.projects_id,
projects.projectnumber, projects.projectnumber,
projects.title, projects.title,
projects.projectcategories_id,
projects.registrations_id AS reg_id projects.registrations_id AS reg_id
FROM FROM
award_prizes award_prizes
@ -81,6 +94,7 @@
award_awards_id='$r->id' award_awards_id='$r->id'
AND award_prizes.year='$foryear' AND award_prizes.year='$foryear'
AND award_prizes.excludefromac='0' AND award_prizes.excludefromac='0'
AND ($and_categories)
ORDER BY ORDER BY
`order`"); `order`");
echo mysql_error(); echo mysql_error();
@ -142,6 +156,7 @@
$sq=mysql_query("SELECT students.firstname, $sq=mysql_query("SELECT students.firstname,
students.lastname, students.lastname,
students.pronunciation,
students.schools_id, students.schools_id,
schools.school schools.school
FROM FROM
@ -154,17 +169,25 @@
$students=" Students: "; $students=" Students: ";
$studnum=0; $studnum=0;
$pronounce = "";
while($studentinfo=mysql_fetch_object($sq)) while($studentinfo=mysql_fetch_object($sq))
{ {
if($studnum>0) $students.=", "; if($studnum>0) $students.=", ";
$students.="$studentinfo->firstname $studentinfo->lastname"; $students.="$studentinfo->firstname $studentinfo->lastname";
if($studnum>0) $pronounce .= ", ";
$pronounce .= "\"{$studentinfo->pronunciation}\"";
$studnum++; $studnum++;
//we will assume that they are coming from the same school, so lets just grab the last students school //we will assume that they are coming from the same school, so lets just grab the last students school
//and use it. //and use it.
$school=$studentinfo->school; $school=$studentinfo->school;
} }
$rep->addText($students); $rep->addText($students);
if(trim($pronounce) != '' && $show_pronunciation == TRUE)
$rep->addText("Pronunciation: $pronounce");
$rep->addText(" School: $school"); $rep->addText(" School: $school");
} }
else else

View File

@ -68,6 +68,17 @@
echo "<td><input name=\"show_unawarded_awards\" type=\"checkbox\" ".($config['reports_show_unawarded_awards'] == 'yes' ? "checked" : "")."/></td></tr>"; echo "<td><input name=\"show_unawarded_awards\" type=\"checkbox\" ".($config['reports_show_unawarded_awards'] == 'yes' ? "checked" : "")."/></td></tr>";
echo "<tr><td colspan=3><b>".i18n("Show prizes without winners").":</b></td>"; echo "<tr><td colspan=3><b>".i18n("Show prizes without winners").":</b></td>";
echo "<td><input name=\"show_unawarded_prizes\" type=\"checkbox\" ".($config['reports_show_unawarded_prizes'] == 'yes' ? "checked" : "")."/></td></tr>"; echo "<td><input name=\"show_unawarded_prizes\" type=\"checkbox\" ".($config['reports_show_unawarded_prizes'] == 'yes' ? "checked" : "")."/></td></tr>";
echo "<tr><td colspan=3><b>".i18n("Show student name pronunciation").":</b></td>";
echo "<td><input name=\"show_pronunciation\" type=\"checkbox\" /></td></tr>";
echo "<tr><td colspan=\"3\"><b>".i18n("Include the following age categories").":</b></td>";
echo "<td>";
$q=mysql_query("SELECT * FROM projectcategories WHERE year='{$config['FAIRYEAR']}' ORDER BY id");
while($r=mysql_fetch_object($q)) {
echo "<input name=\"show_category[{$r->id}]\" type=\"checkbox\" checked=\"checked\" />";
echo "".i18n($r->category)."<br />";
}
echo "</table>"; echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Generate Script")."\" />"; echo "<input type=\"submit\" value=\"".i18n("Generate Script")."\" />";