changed git call from https to git readonly
[atutor.git] / mods / certify / index_instructor.php
1 <?php\r
2 define('AT_INCLUDE_PATH', '../../include/');\r
3 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
4 authenticate(AT_PRIV_CERTIFY);\r
5 \r
6 if (isset($_POST['delete'], $_POST['certify_id'])) \r
7 {\r
8     // DELETE\r
9 \r
10         header('Location: certify_delete.php?certify_id='.$_POST['certify_id']);\r
11         exit;\r
12 \r
13\r
14 else if (isset($_POST['edit'], $_POST['certify_id'])) \r
15 {\r
16     // EDIT\r
17 \r
18         header('Location: certify_certificate.php?certify_id='.$_POST['certify_id']);\r
19         exit;\r
20\r
21 else if (isset($_POST['tests'], $_POST['certify_id'])) \r
22 {\r
23     // TESTS\r
24         header('Location: certify_tests.php?certify_id='.$_POST['certify_id']);\r
25         exit;\r
26\r
27 else if (isset($_POST['students'], $_POST['certify_id'])) \r
28 {\r
29     // STUDENTS\r
30         header('Location: certify_student_status.php?certify_id='.$_POST['certify_id']);\r
31         exit;\r
32\r
33 else if (!empty($_POST) && !isset($_POST['certify_id'])) {\r
34         $msg->addError('NO_ITEM_SELECTED');\r
35 }\r
36 \r
37 // Fetch all tests for course\r
38 $sql =  "SELECT certify_id, title, description FROM ".TABLE_PREFIX."certify WHERE course_id=".$_SESSION['course_id'];\r
39 $result = mysql_query($sql, $db) or die(mysql_error());\r
40 \r
41 $certificates = array();\r
42 \r
43 while( $row = mysql_fetch_assoc($result) ) {\r
44     $certificates[] = $row;\r
45 }\r
46 \r
47 // if there are no certificates, print meldingen under, else ikke\r
48 //$msg->printInfos('CERTIFY_NO_CERTIFICATES'); \r
49 \r
50 require (AT_INCLUDE_PATH.'header.inc.php');\r
51 \r
52 ?>\r
53 \r
54 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">\r
55 <table class="data" summary="" rules="cols">\r
56 \r
57 <thead>\r
58 <tr>\r
59         <th scope="col">&nbsp;</th>\r
60         <th scope="col"><?php echo _AT('certify_title'); ?></a></th>\r
61         <th scope="col"><?php echo _AT('certify_description'); ?></a></th>\r
62 </tr>\r
63 </thead>\r
64 \r
65 <tfoot>\r
66 <tr>\r
67         <td colspan="3">\r
68                 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> \r
69                 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />\r
70                 <input type="submit" name="tests" value="<?php echo _AT('certify_edit_tests'); ?>" />\r
71                 <input type="submit" name="students" value="<?php echo _AT('certify_student_status'); ?>" />\r
72         </td>\r
73 </tr>\r
74 </tfoot>\r
75 \r
76 <tbody>\r
77         <?php foreach ($certificates as $certificate) { ?>\r
78                 <tr>\r
79                         <td><input type="radio" name="certify_id" value="<?php echo $certificate['certify_id']; ?>" id="" /></td>\r
80                         \r
81                         <td><label for=""><?php echo $certificate['title']; ?></label></td>                     \r
82                         \r
83                         <td><?php echo $certificate['description']; ?></td>\r
84                 </tr>\r
85         \r
86         <?php } ?>\r
87         <?php if (count($certificates)==0) { ?>\r
88 \r
89                 <tr>\r
90                         <td colspan="3"><?php echo _AT('none_found'); ?></td>\r
91                 </tr>\r
92         \r
93         <?php } ?>\r
94 \r
95 </tbody>\r
96 </table>\r
97 </form>\r
98 \r
99 \r
100 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>