From 0ebd709a13c0dea926c8cc324c2552f772e31df9 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 18 Sep 2006 19:33:48 +0000 Subject: [PATCH] Add the option to collect teacher signatures on the signature page --- config/signaturepage.php | 13 +++++++++++- db/db.code.version.txt | 2 +- db/db.update.24.sql | 2 ++ register_participants_signature.php | 33 +++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 db/db.update.24.sql diff --git a/config/signaturepage.php b/config/signaturepage.php index b65e30f..69069e6 100644 --- a/config/signaturepage.php +++ b/config/signaturepage.php @@ -31,10 +31,11 @@ { if($_POST['useexhibitordeclaration']) $useex="1"; else $useex="0"; if($_POST['useparentdeclaration']) $usepg="1"; else $usepg="0"; + if($_POST['useteacherdeclaration']) $usete="1"; else $usete="0"; mysql_query("UPDATE signaturepage SET `use`='$useex', `text`='".mysql_escape_string(stripslashes($_POST['exhibitordeclaration']))."' WHERE name='exhibitordeclaration'"); - echo mysql_error(); mysql_query("UPDATE signaturepage SET `use`='$usepg', `text`='".mysql_escape_string(stripslashes($_POST['parentdeclaration']))."' WHERE name='parentdeclaration'"); + mysql_query("UPDATE signaturepage SET `use`='$usete', `text`='".mysql_escape_string(stripslashes($_POST['teacherdeclaration']))."' WHERE name='teacherdeclaration'"); echo happy(i18n("Signature page text successfully saved")); } @@ -50,6 +51,7 @@ echo "
"; echo ""; echo "
"; echo "
"; + $q=mysql_query("SELECT * FROM signaturepage WHERE name='parentdeclaration'"); $r=mysql_fetch_object($q); if($r->use) $ch="checked=\"checked\""; else $ch=""; @@ -58,6 +60,15 @@ echo "
"; echo ""; echo "
"; echo "
"; + +$q=mysql_query("SELECT * FROM signaturepage WHERE name='teacherdeclaration'"); +$r=mysql_fetch_object($q); +if($r->use) $ch="checked=\"checked\""; else $ch=""; +echo "".i18n("Use the teacher declaration and obtain teacher's signature"); +echo "
"; +echo ""; +echo "
"; +echo "
"; echo ""; echo ""; diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 4099407..a45fd52 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -23 +24 diff --git a/db/db.update.24.sql b/db/db.update.24.sql new file mode 100644 index 0000000..d9530c9 --- /dev/null +++ b/db/db.update.24.sql @@ -0,0 +1,2 @@ +INSERT INTO `signaturepage` (`id`, `name`, `use`, `text`) VALUES (3, 'teacherdeclaration', 0, 'The following section is to be read and signed by the teacher.\r\n\r\nI certify that:\r\n - The preparation of this project is mainly the student(s)\' own work.\r\n - The student(s) have read the rules and regulations and agree to abide by them.\r\n - I agree that the decision of the judges will be final.'); + diff --git a/register_participants_signature.php b/register_participants_signature.php index 01e47de..cfda36f 100644 --- a/register_participants_signature.php +++ b/register_participants_signature.php @@ -179,8 +179,41 @@ $pdf->newPage(); $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(); + } + /* header("Content-type: application/pdf");