2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\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
16 define('AT_INCLUDE_PATH', '../../../include/');
\r
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
19 authenticate(AT_PRIV_TESTS);
\r
21 if (isset($_POST['edit'], $_POST['category'])) {
\r
22 header('Location: question_cats_manage.php?catid='.$_POST['category']);
\r
24 } else if (isset($_POST['delete'], $_POST['category'])) {
\r
25 header('Location: question_cats_delete.php?catid='.$_POST['category']);
\r
27 } else if (!empty($_POST)) {
\r
28 $msg->addError('NO_ITEM_SELECTED');
\r
31 require(AT_INCLUDE_PATH.'header.inc.php');
\r
33 $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions_categories WHERE course_id=$_SESSION[course_id] ORDER BY title";
\r
34 $result = mysql_query($sql, $db);
\r
36 if ($row = mysql_fetch_assoc($result)) {
\r
38 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
\r
39 <div class="input-form">
\r
40 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('question_categories'); ?></legend>
\r
43 <input type="radio" id="cat_<?php echo $row['category_id']; ?>" name="category" value="<?php echo $row['category_id']; ?>" /> <label for="cat_<?php echo $row['category_id']; ?>"><?php echo AT_print($row['title'], 'tests_questions_categories.title'); ?></label>
\r
46 } while ($row = mysql_fetch_assoc($result));
\r
49 <div class="row buttons">
\r
50 <input type="submit" value="<?php echo _AT('edit'); ?>" name="edit" />
\r
51 <input type="submit" value="<?php echo _AT('delete'); ?>" name="delete" />
\r
58 echo '<div class="input-form">';
\r
59 echo '<p> '._AT('cats_no_categories').'</p>';
\r
65 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>