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
15 define('AT_INCLUDE_PATH', '../../../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 require(AT_INCLUDE_PATH.'../mods/_core/themes/lib/themes.inc.php');
\r
18 admin_authenticate(AT_ADMIN_PRIV_CATEGORIES);
\r
20 if (isset($_POST['delete'], $_POST['cat_id'])) {
\r
21 header('Location: delete_category.php?cat_id='.$_POST['cat_id']);
\r
23 } else if (isset($_POST['edit'], $_POST['cat_id'])) {
\r
24 header('Location: edit_category.php?cat_id='.$_POST['cat_id']);
\r
26 } else if (!empty($_POST)) {
\r
27 $msg->addError('NO_ITEM_SELECTED');
\r
30 require(AT_INCLUDE_PATH.'header.inc.php');
\r
33 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
34 <table summary="" class="data" rules="cols" align="center" style="width: 95%;">
\r
38 <th scope="col"> </th>
\r
39 <th scope="col"><?php echo _AT('name'); ?></th>
\r
40 <th scope="col"><?php echo _AT('parent'); ?></th>
\r
41 <?php if (defined('AT_ENABLE_CATEGORY_THEMES') && AT_ENABLE_CATEGORY_THEMES) : ?>
\r
42 <th scope="col"><?php echo _AT('theme'); ?></th>
\r
49 <div class="row buttons">
\r
50 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
\r
57 $sql = "SELECT * FROM ".TABLE_PREFIX."course_cats ORDER BY cat_name";
\r
58 $result = mysql_query($sql, $db);
\r
59 if ($row = mysql_fetch_assoc($result)): ?>
\r
62 $parent_cat_name = '';
\r
63 if ($row['cat_parent']) {
\r
64 $sql_cat = "SELECT cat_name FROM ".TABLE_PREFIX."course_cats WHERE cat_id=".$row['cat_parent'];
\r
65 $result_cat = mysql_query($sql_cat, $db);
\r
66 $row_cat = mysql_fetch_assoc($result_cat);
\r
67 $parent_cat_name = $row_cat['cat_name'];
\r
70 <tr onmousedown="document.form['m<?php echo $row['cat_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['cat_id']; ?>">
\r
71 <td width="10"><input type="radio" name="cat_id" value="<?php echo $row['cat_id']; ?>" id="m<?php echo $row['cat_id']; ?>" /></td>
\r
72 <td><label for="m<?php echo $row['cat_id']; ?>"><?php echo AT_print($row['cat_name'], 'course_cats.cat_name'); ?></label></td>
\r
73 <td><?php echo AT_print($parent_cat_name, 'course_cats.cat_name'); ?></td>
\r
74 <?php if (defined('AT_ENABLE_CATEGORY_THEMES') && AT_ENABLE_CATEGORY_THEMES) : ?>
\r
75 <td><?php echo AT_print(get_theme_name($row['theme']), 'themes.title'); ?></td>
\r
79 <?php } while ($row = mysql_fetch_assoc($result)); ?>
\r
82 <td colspan="3"><?php echo _AT('none_found'); ?></td>
\r
91 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>