remove old readme
[atutor.git] / docs / mods / _core / cats_categories / admin / course_categories.php
1 <?php
2 /****************************************************************************/
3 /* ATutor                                                                                                                                       */
4 /****************************************************************************/
5 /* Copyright (c) 2002-2010                                                  */
6 /* Inclusive Design Institute                                               */
7 /* http://atutor.ca                                                                                                                     */
8 /*                                                                                                                                                      */
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 /****************************************************************************/
13 // $Id$
14
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);
19
20 if (isset($_POST['delete'], $_POST['cat_id'])) {
21         header('Location: delete_category.php?cat_id='.$_POST['cat_id']);
22         exit;
23 } else if (isset($_POST['edit'], $_POST['cat_id'])) {
24         header('Location: edit_category.php?cat_id='.$_POST['cat_id']);
25         exit;
26 } else if (!empty($_POST)) {
27         $msg->addError('NO_ITEM_SELECTED');
28 }
29
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);
33 //not working? 
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);
37                         
38
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'); 
43
44 ?>