2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************************/
15 define('AT_INCLUDE_PATH', '../../../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 require(AT_INCLUDE_PATH.'../mods/_core/themes/lib/themes.inc.php');
18 admin_authenticate(AT_ADMIN_PRIV_CATEGORIES);
20 if (isset($_POST['delete'], $_POST['cat_id'])) {
21 header('Location: delete_category.php?cat_id='.$_POST['cat_id']);
23 } else if (isset($_POST['edit'], $_POST['cat_id'])) {
24 header('Location: edit_category.php?cat_id='.$_POST['cat_id']);
26 } else if (!empty($_POST)) {
27 $msg->addError('NO_ITEM_SELECTED');
30 require(AT_INCLUDE_PATH.'header.inc.php');
31 $sql = "SELECT * FROM ".TABLE_PREFIX."course_cats ORDER BY cat_name";
32 $result = mysql_query($sql, $db);
34 $sql_cat = "SELECT cat_name FROM ".TABLE_PREFIX."course_cats WHERE cat_id=".$row['cat_parent'];
35 $result_cat = mysql_query($sql_cat, $db);
36 $row_cat = mysql_fetch_assoc($result_cat);
39 $savant->assign('row_cat', $row_cat);
40 $savant->assign('result', $result);
41 $savant->display('admin/courses/course_categories.tmpl.php');
42 require(AT_INCLUDE_PATH.'footer.inc.php');