diff --git a/admin/reports_acscript.php b/admin/reports_acscript.php index aea1309..d728102 100644 --- a/admin/reports_acscript.php +++ b/admin/reports_acscript.php @@ -38,20 +38,17 @@ $scriptformat=$_GET['scriptformat']; if(!$scriptformat) $scriptformat="default"; - if($type=="pdf") - { - + if($type=="pdf") { $rep=new lpdf( i18n($config['fairname']), i18n("Awards Ceremony Script"), $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif" ); $rep->newPage(); - if($scriptformat=="default") $rep->setFontSize(11); + if($scriptformat=="default") $rep->setFontSize(12); if($scriptformat=="formatted") $rep->setFontSize(14); } - else if($type=="csv") - { + else if($type=="csv") { $rep=new lcsv(i18n("Awards Ceremony Script")); } $q=mysql_query("SELECT @@ -78,11 +75,11 @@ if(!$scriptformat) $scriptformat="default"; echo mysql_error(); - if(mysql_num_rows($q)) - { - while($r=mysql_fetch_object($q)) - { - if($scriptformat=="formatted") $rep->newPage(); + if(mysql_num_rows($q)) { + while($r=mysql_fetch_object($q)) { + if($scriptformat=="formatted") + $rep->newPage(); + $pq=mysql_query("SELECT award_prizes.prize, award_prizes.number, @@ -104,29 +101,26 @@ if(!$scriptformat) $scriptformat="default"; AND award_prizes.excludefromac='0' AND ($and_categories) ORDER BY - `order`,projects.projectnumber"); + `order`, + projects.projectnumber"); echo mysql_error(); - if($show_unawarded_awards=="no") - { + if($show_unawarded_awards=="no") { $skipAward=true; - while($pr=mysql_fetch_object($pq)) - { - if($pr->projectnumber) - { + while($pr=mysql_fetch_object($pq)) { + if($pr->projectnumber) { $skipAward=false; break; } } - if($skipAward) - { + if($skipAward) { continue; } mysql_data_seek($pq, 0); } - if($scriptformat=="default") $rep->heading("$r->name ($r->type)"); - if($scriptformat=="formatted") - { + if($scriptformat=="default") + $rep->heading("$r->name ($r->type)"); + if($scriptformat=="formatted") { $rep->setFontBold(); $rep->addText("$r->name ($r->type)"); $rep->setFontNormal(); @@ -143,16 +137,12 @@ if(!$scriptformat) $scriptformat="default"; if($scriptformat=="formatted") $rep->nextline(); $prevprizeid=-1; - while($pr=mysql_fetch_object($pq)) - { - if($pr->projectnumber || $show_unawarded_prizes=="yes") - { - if($prevprizeid!=$pr->id) - { + while($pr=mysql_fetch_object($pq)) { + if($pr->projectnumber || $show_unawarded_prizes=="yes") { + if($prevprizeid!=$pr->id) { $prizetext=$pr->prize; - if($pr->cash || $pr->scholarship) - { + if($pr->cash || $pr->scholarship) { $prizetext.=" ("; if($pr->cash && $pr->scholarship) $prizetext.="\$$pr->cash cash / \$$pr->scholarship scholarship"; @@ -163,9 +153,9 @@ if(!$scriptformat) $scriptformat="default"; $prizetext.= ")"; } - if($scriptformat=="default") $rep->addText($prizetext); - if($scriptformat=="formatted") - { + if($scriptformat=="default") + $rep->addText($prizetext); + if($scriptformat=="formatted") { $rep->setFontBold(); $rep->addText($prizetext); $rep->setFontNormal(); @@ -175,9 +165,9 @@ if(!$scriptformat) $scriptformat="default"; $prevprizeid=$pr->id; } - if($pr->projectnumber) - { - if($scriptformat=="default") $rep->addText( " ($pr->projectnumber) $pr->title"); + if($pr->projectnumber) { + if($scriptformat=="default") + $rep->addText( " ($pr->projectnumber) $pr->title"); $sq=mysql_query("SELECT students.firstname, students.lastname, @@ -195,8 +185,7 @@ if(!$scriptformat) $scriptformat="default"; $students=" Students: "; $studnum=0; $pronounce = ""; - while($studentinfo=mysql_fetch_object($sq)) - { + while($studentinfo=mysql_fetch_object($sq)) { if($studnum>0) $students.=", "; $students.="$studentinfo->firstname $studentinfo->lastname"; @@ -212,35 +201,35 @@ if(!$scriptformat) $scriptformat="default"; $school=$studentinfo->school; } - if($scriptformat=="default") - { + if($scriptformat=="default") { $rep->addText($students); if(trim($pronounce) != '' && $show_pronunciation == TRUE) $rep->addText("Pronunciation: $pronounce"); $rep->addText(" School: $school"); } - if($scriptformat=="formatted") - { + if($scriptformat=="formatted") { $rep->addTextX("$pr->projectnumber",0.5); $rep->addTextX("$student_winner[0]",1.4); - if($show_pronunciation == TRUE) $rep->addTextX("($student_win_pronunc[0])",4.0); - if($type=="pdf") $rep->nextline(); - if($studnum==2) - { + $rep->addTextX("$school",5.5); + if($show_pronunciation == TRUE && $student_win_pronunc[0]) + $rep->addTextX("({$student_win_pronunc[0]})",4.0); + if($type=="pdf") + $rep->nextline(); + if($studnum==2) { $rep->addTextX("$student_winner[1]",1.4); - if($show_pronunciation == TRUE) $rep->addTextX("($student_win_pronunc[1])",4.0); - if($type=="pdf") $rep->nextline(); + if($show_pronunciation == TRUE && $student_win_pronunc[1]) + $rep->addTextX("({$student_win_pronunc[1]})",4.0); + if($type=="pdf") + $rep->nextline(); } if(($studnum==1) && ($type == "csv")) $rep->addTextX(""); if(($studnum==1) && ($type == "csv")) $rep->addTextX(""); $rep->addTextX("$pr->title",1.4); - $rep->addTextX("$school",5.5); if($type=="pdf") $rep->nextline(); $rep->nextline(); } } - else - { + else { $rep->addText(" Prize not awarded"); } } diff --git a/admin/reports_ceremony.php b/admin/reports_ceremony.php index 29f1e03..21f5319 100644 --- a/admin/reports_ceremony.php +++ b/admin/reports_ceremony.php @@ -56,6 +56,8 @@ "; + echo "\n"; + echo "