2 /****************************************************************************/
\r
4 /****************************************************************************/
\r
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton */
\r
6 /* Adaptive Technology Resource Centre / University of Toronto */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************************/
\r
13 // $Id: index_instructor.php 7208 2008-02-20 16:07:24Z cindy $
\r
15 define('AT_INCLUDE_PATH', '../../include/');
\r
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 require(AT_INCLUDE_PATH.'lib/test_result_functions.inc.php');
\r
18 require("common.inc.php");
\r
20 if ($_REQUEST["certificate_id"] == 0)
\r
22 $msg->printErrors('NO_ITEM_SELECTED');
\r
26 if ($_REQUEST["result_id"] > 0) $tokens = initialize_tokens($_REQUEST['result_id']);
\r
28 $sql = "select * from ".TABLE_PREFIX."certificate_text where certificate_id=".$_REQUEST["certificate_id"];
\r
29 $result = mysql_query($sql, $db) or die(mysql_error());
\r
31 $url=AT_BASE_HREF . "mods/certificate/default_certificate.pdf";
\r
33 $fdf = "%FDF-1.2\n%¡¦¡§&&Mac178;\n";
\r
34 $fdf .= "1 0 obj \n<< /FDF << /Fields [\n";
\r
36 while ($row = mysql_fetch_assoc($result))
\r
38 $key = $row["field_name"];
\r
39 if ($_REQUEST["result_id"] > 0)
\r
40 $value = replace_tokens($row["field_value"], $tokens);
\r
42 $value = $row["field_value"];
\r
44 $fdf .= "<< /T ($key) /V ($value) >> \n";
\r
47 $fdf .= "]\n/F ($url) >>";
\r
48 $fdf .= ">>\nendobj\ntrailer\n<<\n";
\r
49 $fdf .= "/Root 1 0 R \n\n>>\n";
\r
52 header('Content-type: application/vnd.fdf');
\r