Handle > 2 students on a project. Print schools for all students in the formatted report.

This commit is contained in:
dave 2010-04-10 03:45:03 +00:00
parent 81461c0601
commit 8c83a9a755

View File

@ -194,37 +194,29 @@ if(!$scriptformat) $scriptformat="default";
$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";
$student_school[$studnum] = $studentinfo->school;
$studnum++; $studnum++;
//we will assume that they are coming from the same school, so lets just grab the last students school
//and use it.
$school=$studentinfo->school;
} }
if($scriptformat=="default") { if($scriptformat=="default") {
$rep->addText($students); $rep->addText($students);
if(trim($pronounce) != '' && $show_pronunciation == TRUE) if(trim($pronounce) != '' && $show_pronunciation == TRUE)
$rep->addText("Pronunciation: $pronounce"); $rep->addText("Pronunciation: $pronounce");
$rep->addText(" School: $school"); $rep->addText(" School: {$student_school[0]}");
} }
if($scriptformat=="formatted") { if($scriptformat=="formatted") {
$rep->addTextX("$pr->projectnumber",0.5); $rep->addTextX("$pr->projectnumber",0.5);
$rep->addTextX("$student_winner[0]",1.4); for($x=0; $x<$studnum; $x++) {
$rep->addTextX("$school",5.5); $rep->addTextX($student_winner[$x],1.4);
if($show_pronunciation == TRUE && $student_win_pronunc[0]) $rep->addTextX($student_school[$x],5.5);
$rep->addTextX("({$student_win_pronunc[0]})",4.0); if($show_pronunciation == TRUE && $student_win_pronunc[$x])
if($type=="pdf") $rep->addTextX("({$student_win_pronunc[$x]})",4.0);
$rep->nextline();
if($studnum==2) {
$rep->addTextX("$student_winner[1]",1.4);
if($show_pronunciation == TRUE && $student_win_pronunc[1])
$rep->addTextX("({$student_win_pronunc[1]})",4.0);
if($type=="pdf") if($type=="pdf")
$rep->nextline(); $rep->nextline();
} }
if(($studnum==1) && ($type == "csv")) $rep->addTextX(""); if(($studnum==1) && ($type == "csv")) $rep->addTextX("");
if(($studnum==1) && ($type == "csv")) $rep->addTextX(""); if(($studnum==1) && ($type == "csv")) $rep->addTextX("");
$rep->addTextX("$pr->title",1.4); $rep->addText($pr->title,'left', 1.4);
if($type=="pdf") $rep->nextline(); if($type=="pdf") $rep->nextline();
$rep->nextline(); $rep->nextline();
} }