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 authenticate(AT_PRIV_CERTIFICATE);
\r
18 require(AT_INCLUDE_PATH.'lib/themes.inc.php');
\r
20 if (isset($_POST['remove'], $_POST['certificate_id']))
\r
22 header('Location: certificate_delete.php?certificate_id='.$_POST['certificate_id']);
\r
25 else if (isset($_POST['edit'], $_POST['certificate_id']))
\r
27 header('Location: certificate_edit.php?certificate_id='.$_POST['certificate_id']);
\r
30 else if (!empty($_POST) && !isset($_POST['certificate_id'])) {
\r
31 $msg->addError('NO_ITEM_SELECTED');
\r
34 require(AT_INCLUDE_PATH.'header.inc.php');
\r
37 · <?php echo _AT("require_acrobat", "preview"); ?><br><br>
\r
38 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
39 <table summary="" class="data" rules="cols" align="center" style="width: 70%;">
\r
43 <th scope="col"> </th>
\r
44 <!--<th scope="col"><?php echo _AT('certificate_id'); ?></th>-->
\r
45 <th scope="col"><?php echo _AT('test_title'); ?></th>
\r
46 <th scope="col"><?php echo _AT('pass_score'); ?></th>
\r
47 <th scope="col"><?php echo _AT('created_date'); ?></th>
\r
53 <div class="row buttons">
\r
54 <input type="button" name="preview" value="<?php echo _AT('preview'); ?>" onClick="open_certificate_win('<?php echo dirname($_SERVER["PHP_SELF"])?>/open_certificate.php?test_id={hidden_value}&certificate_id={radio_value}', 'certificate_id', 'test_id')" />
\r
55 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" />
\r
56 <input type="submit" name="remove" value="<?php echo _AT('remove'); ?>" />
\r
61 <td colspan="5"></td>
\r
66 $include_javascript = true;
\r
68 require("common.inc.php");
\r
70 if (is_pass_score_defined_in_base_table())
\r
71 $sql = "SELECT c.*, t.title, t.passscore, t.passpercent from ".TABLE_PREFIX."tests t, ".TABLE_PREFIX."certificate c WHERE t.test_id = c.test_id";
\r
73 $sql = "SELECT c.*, t.title from ".TABLE_PREFIX."tests t, ".TABLE_PREFIX."certificate c WHERE t.test_id = c.test_id";
\r
75 $result = mysql_query($sql, $db) or die(mysql_error());
\r
77 if (mysql_num_rows($result) == 0)
\r
81 <td colspan="5"><?php echo _AT('none_found'); ?></td>
\r
87 while ($row = mysql_fetch_assoc($result))
\r
90 <tr onmousedown="document.form['m<?php echo $row['certificate_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['certificate_id']; ?>">
\r
91 <td width="10"><input type="radio" name="certificate_id" value="<?php echo $row['certificate_id']; ?>" id="m<?php echo $row['certificate_id']; ?>" <?php if ($row['certificate_id']==$_POST['certificate_id']) echo 'checked'; ?> /></td>
\r
92 <!--<td><label for="m<?php echo $row['certificate_id']; ?>"><?php echo $row['certificate_id']; ?></label></td>-->
\r
93 <td><label for="m<?php echo $row['certificate_id']; ?>"><?php echo $row['title']; ?></label></td>
\r
96 if ($row['passscore'] <> 0)
\r
97 echo $row['passscore'];
\r
98 elseif ($row['passpercent'] <> 0)
\r
99 echo $row['passpercent'] . "%";
\r
100 else echo _AT("na");
\r
102 <td><?php echo $row['created_date']; ?></td>
\r
103 <input type="hidden" name="test_id" value="<?php echo $row['test_id']; ?>">
\r
115 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>
\r