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