Copyright (C) 2005 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> newPage(); $height['sigspace']=0.40; $pdf->setFontSize(11); /* //The title of the fair $yloc=10.25; $height['title']=0.25; $height['subtitle']=0.22; $height['topbox']=0.8; $height['exhibitortitle']=0.2; $height['exhibitorbox']=1.3; $height['exhibitorsigtext']=0.13; $height['parenttitle']=0.2; $height['parentbox']=2.80; $height['parentsigtext']=0.13; */ //grab the project info $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); $projectinfo=mysql_fetch_object($q); $q=mysql_query("SELECT * FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); while($si=mysql_fetch_object($q)) $studentinfoarray[]=$si; $topboxtext="Registration Number: ".$_SESSION['registration_number']."\n". "Project Title: $projectinfo->title\n"; if(count($studentinfoarray)>1) $plural="s"; else $plural=""; $topboxtext.="Exhibitor$plural: "; foreach($studentinfoarray AS $studentinfo) { $topboxtext.="$studentinfo->firstname $studentinfo->lastname, "; } //strip off the last comma $pdf->heading(i18n("Registration Summary")); $topboxtext=substr($topboxtext,0,-2); //add the newline // $topboxtext.="\n"; $pdf->addText($topboxtext); $pdf->hr(); $q=mysql_query("SELECT * FROM signaturepage WHERE name='exhibitordeclaration'"); $r=mysql_fetch_object($q); if($r->use) { $pdf->heading(i18n("Exhibitor Declaration")); $studentbox=$r->text; /* $studentbox="The following section is to be read and signed by the exhibitor$plural.\n\n". ($plural?"We":"I")." certify that:\n". " - The preparation of this project is mainly ".($plural?"our":"my")." own work\n". " - ".($plural?"We":"I")." have read the rules and regulations and agree to abide by them\n". " - ".($plural?"We":"I")." agree that the decision of the judges will be final\n"; */ $pdf->addText($studentbox); foreach($studentinfoarray AS $studentinfo) { $pdf->vspace($height['sigspace']); //signature line $pdf->hline(1,4.5); //date line $pdf->hline(5,7); //go to next line $pdf->nextLine(); //show their name $pdf->addTextX(i18n("%1 %2 (signature)",array($studentinfo->firstname,$studentinfo->lastname)),1.25); //show the Date text $pdf->addTextX(i18n("Date"),5.25); //go to next line $pdf->nextLine(); } $pdf->hr(); } $q=mysql_query("SELECT * FROM signaturepage WHERE name='parentdeclaration'"); $r=mysql_fetch_object($q); if($r->use) { //now for the parent/guardian signatures $pdf->heading(i18n("Parent/Guardian Declaration")); $parentbox=$r->text; $pdf->addText($parentbox); foreach($studentinfoarray AS $studentinfo) { $pdf->vspace($height['sigspace']); //signature line $pdf->hline(1,4.5); //date line $pdf->hline(5,7); $pdf->nextLine(); //show their name $pdf->addTextX(i18n("Parent/Guardian of %1 %2 (signature)",array($studentinfo->firstname,$studentinfo->lastname)),1.25); //show the Date text $pdf->addTextX(i18n("Date"),5.25); $pdf->nextLine(); } $pdf->hr(); } $q=mysql_query("SELECT * FROM signaturepage WHERE name='teacherdeclaration'"); $r=mysql_fetch_object($q); if($r->use) { //now for the teacher signature $pdf->heading(i18n("Teacher Declaration")); $teacherbox=$r->text; $pdf->addText($teacherbox); //we only need 1 teacher signature line, we can assume (maybe incorrectly) that both students //have the same teacher.. if they are not the same, then they can get the best teacher to sign //it doesnt matter. $pdf->vspace($height['sigspace']); //signature line $pdf->hline(1,4.5); //date line $pdf->hline(5,7); $pdf->nextLine(); //show their name $pdf->addTextX(i18n("Teacher Signature"),1.25); //show the Date text $pdf->addTextX(i18n("Date"),5.25); $pdf->nextLine(); $pdf->hr(); } $q=mysql_query("SELECT * FROM signaturepage WHERE name='postamble'"); $r=mysql_fetch_object($q); if($r->use) { //now for the teacher signature $pdf->heading(i18n("Additional Information")); $box=$r->text; $pdf->addText($box); } /* header("Content-type: application/pdf"); header("Content-disposition: inline; filename=sfiab_sig_".$_SESSION['registration_id'].".pdf"); header("Content-length: ".strlen($pdfdata)); */ echo $pdf->output(); ?>