2 define('AT_INCLUDE_PATH', '../../include/');
\r
3 require (AT_INCLUDE_PATH.'vitals.inc.php');
\r
4 authenticate(AT_PRIV_CERTIFY);
\r
6 if (isset($_POST['delete'], $_POST['certify_id']))
\r
10 header('Location: certify_delete.php?certify_id='.$_POST['certify_id']);
\r
14 else if (isset($_POST['edit'], $_POST['certify_id']))
\r
18 header('Location: certify_certificate.php?certify_id='.$_POST['certify_id']);
\r
21 else if (isset($_POST['tests'], $_POST['certify_id']))
\r
24 header('Location: certify_tests.php?certify_id='.$_POST['certify_id']);
\r
27 else if (isset($_POST['students'], $_POST['certify_id']))
\r
30 header('Location: certify_student_status.php?certify_id='.$_POST['certify_id']);
\r
33 else if (!empty($_POST) && !isset($_POST['certify_id'])) {
\r
34 $msg->addError('NO_ITEM_SELECTED');
\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
41 $certificates = array();
\r
43 while( $row = mysql_fetch_assoc($result) ) {
\r
44 $certificates[] = $row;
\r
47 // if there are no certificates, print meldingen under, else ikke
\r
48 //$msg->printInfos('CERTIFY_NO_CERTIFICATES');
\r
50 require (AT_INCLUDE_PATH.'header.inc.php');
\r
54 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
55 <table class="data" summary="" rules="cols">
\r
59 <th scope="col"> </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
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
77 <?php foreach ($certificates as $certificate) { ?>
\r
79 <td><input type="radio" name="certify_id" value="<?php echo $certificate['certify_id']; ?>" id="" /></td>
\r
81 <td><label for=""><?php echo $certificate['title']; ?></label></td>
\r
83 <td><?php echo $certificate['description']; ?></td>
\r
87 <?php if (count($certificates)==0) { ?>
\r
90 <td colspan="3"><?php echo _AT('none_found'); ?></td>
\r
100 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>