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. */ ?> SetCreator(PDF_CREATOR); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle(i18n("Participant Signature Page (".$_SESSION['registration_number'].")")); $pdf->SetSubject(""); $pdf->SetKeywords(""); $pdf->SetHeaderData("logo-200.png", 15, i18n($config['fairname']), i18n("Participant Signature Page (".$_SESSION['registration_number'].")")); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set image scale factor $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->AliasNbPages(); $pdf->AddPage(); //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; $pagetext="

".i18n("Registration Summary")."

"; $pagetext.="Registration Number: ".$_SESSION['registration_number']."
". "Project Title: $projectinfo->title
"; if(count($studentinfoarray)>1) $plural="s"; else $plural=""; $pagetext.="Exhibitor$plural: "; foreach($studentinfoarray AS $studentinfo) { $pagetext.="$studentinfo->firstname $studentinfo->lastname, "; } $pagetext=substr($pagetext,0,-2); $pagetext.="
"; $pdf->WriteHTML($pagetext); $pagetext=""; $q=mysql_query("SELECT * FROM signaturepage WHERE name='exhibitordeclaration'"); $r=mysql_fetch_object($q); if($r->use) { $pagetext="

".i18n("Exhibitor Declaration")."

"; $pagetext.=nl2br($r->text); $pdf->WriteHTML($pagetext); foreach($studentinfoarray AS $studentinfo) { $pdf->Ln(10); //signature line $pdf->Line(20,$pdf->GetY(),120,$pdf->GetY()); $pdf->Line(140,$pdf->GetY(),180,$pdf->GetY()); //show their name $pdf->Ln(5); $pdf->Text(30,$pdf->GetY(),i18n("%1 %2 (signature)",array($studentinfo->firstname,$studentinfo->lastname))); $pdf->Text(150,$pdf->GetY(),i18n("Date")); } $pdf->WriteHTML("
"); } $q=mysql_query("SELECT * FROM signaturepage WHERE name='parentdeclaration'"); $r=mysql_fetch_object($q); if($r->use) { $pagetext="

".i18n("Parent/Guardian Declaration")."

"; $pagetext.=nl2br($r->text); $pdf->WriteHTML($pagetext); foreach($studentinfoarray AS $studentinfo) { $pdf->Ln(10); //signature line $pdf->Line(20,$pdf->GetY(),120,$pdf->GetY()); $pdf->Line(140,$pdf->GetY(),180,$pdf->GetY()); //show their name $pdf->Ln(5); $pdf->Text(30,$pdf->GetY(),i18n("Parent/Guardian of %1 %2 (signature)",array($studentinfo->firstname,$studentinfo->lastname))); $pdf->Text(150,$pdf->GetY(),i18n("Date")); } $pdf->WriteHTML("
"); } $q=mysql_query("SELECT * FROM signaturepage WHERE name='teacherdeclaration'"); $r=mysql_fetch_object($q); if($r->use) { //now for the teacher signature $pagetext="

".i18n("Teacher Declaration")."

"; $pagetext.=nl2br($r->text); $pdf->WriteHTML($pagetext); //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->Ln(10); //signature line $pdf->Line(20,$pdf->GetY(),120,$pdf->GetY()); $pdf->Line(140,$pdf->GetY(),180,$pdf->GetY()); //show their name $pdf->Ln(5); $pdf->Text(30,$pdf->GetY(),i18n("Teacher Signature",array($studentinfo->firstname,$studentinfo->lastname))); $pdf->Text(150,$pdf->GetY(),i18n("Date")); } $q=mysql_query("SELECT * FROM signaturepage WHERE name='postamble'"); $r=mysql_fetch_object($q); if($r->use) { //now for the teacher signature $pagetext="

".i18n("Additional Information")."

"; $pagetext.=nl2br($r->text); $pdf->WriteHTML($pagetext); } $pdf->Output(); exit; ?>