resolve minor award ceremony script issues 398, 373, 397, 371

This commit is contained in:
justin 2010-04-14 14:26:11 +00:00
parent 8b4dfb23c5
commit a890fa299d

View File

@ -26,6 +26,10 @@
foreach($_GET['show_category'] as $id=>$val) {
$show_category[] = "projects.projectcategories_id='$id'";
}
if($show_unawarded_prizes=="yes")
{
$show_category[] = "projects.projectcategories_id IS NULL";
}
$and_categories = join(' OR ', $show_category);
} else {
$and_categories = '1';
@ -76,7 +80,6 @@ if(!$scriptformat) $scriptformat="default";
echo mysql_error();
// echo "<pre>";
if(!mysql_num_rows($q)) {
$rep->output();
exit;
@ -111,7 +114,12 @@ if(!$scriptformat) $scriptformat="default";
echo mysql_error();
$r->winners = array();
$r->awarded_count = 0;
while($w = mysql_fetch_object($pq)) {
if($w->projects_id)
{
$r->awarded_count++;
}
if($r->type == 'Divisional' && $group_by_prize==true) {
/* Search awards for an award name that matches this prize */
$found = false;
@ -144,7 +152,7 @@ if(!$scriptformat) $scriptformat="default";
}
}
if($show_unawarded_awards=="no" && count($r->winners) == 0) {
if($show_unawarded_awards=="no" && $r->awarded_count == 0) {
/* No winners */
continue;
}
@ -181,6 +189,11 @@ if(!$scriptformat) $scriptformat="default";
if($scriptformat=="formatted") $rep->nextline();
if($r->awarded_count == 0)
{
$rep->addText("Not awarded");
}
$prevprizeid=-1;
foreach($r->winners as $pr) {
@ -232,12 +245,14 @@ if(!$scriptformat) $scriptformat="default";
$students=" Students: ";
$studnum=0;
$pronounce = "";
$rawpronounce = "";
while($studentinfo=mysql_fetch_object($sq)) {
if($studnum>0) $students.=", ";
$students.="$studentinfo->firstname $studentinfo->lastname";
if($studnum>0) $pronounce .= ", ";
$pronounce .= "\"{$studentinfo->pronunciation}\"";
$rawpronounce .= "{$studentinfo->pronunciation}";
$student_winner[$studnum] = "$studentinfo->firstname $studentinfo->lastname";
$student_win_pronunc[$studnum] = "$studentinfo->pronunciation";
@ -247,8 +262,8 @@ if(!$scriptformat) $scriptformat="default";
if($scriptformat=="default") {
$rep->addText($students);
if(trim($pronounce) != '' && $show_pronunciation == TRUE)
$rep->addText("Pronunciation: $pronounce");
if(trim($rawpronounce) != "" && $show_pronunciation == TRUE)
$rep->addText(" Pronunciation: $pronounce");
$rep->addText(" School: {$student_school[0]}");
}
if($scriptformat=="formatted") {