AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / course_category / course_category_delete.php
1 <?php\r
2 /************************************************************************/\r
3 /* AContent                                                             */\r
4 /************************************************************************/\r
5 /* Copyright (c) 2010                                                   */\r
6 /* Inclusive Design Institute                                           */\r
7 /*                                                                      */\r
8 /* This program is free software. You can redistribute it and/or        */\r
9 /* modify it under the terms of the GNU General Public License          */\r
10 /* as published by the Free Software Foundation.                        */\r
11 /************************************************************************/\r
12 \r
13 define('TR_INCLUDE_PATH', '../include/');\r
14 \r
15 include(TR_INCLUDE_PATH.'vitals.inc.php');\r
16 include_once(TR_INCLUDE_PATH.'classes/DAO/CourseCategoriesDAO.class.php');\r
17 \r
18 $courseCategoriesDAO = new CourseCategoriesDAO();\r
19 \r
20 $ids = explode(',', $_REQUEST['id']);\r
21 \r
22 if (isset($_POST['submit_no'])) \r
23 {\r
24         $msg->addFeedback('CANCELLED');\r
25         header('Location: index.php');\r
26         exit;\r
27\r
28 else if (isset($_POST['submit_yes']))\r
29 {\r
30         foreach($ids as $id) \r
31         {\r
32                 $courseCategoriesDAO->Delete($id);\r
33         }\r
34 \r
35         $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
36         header('Location: index.php');\r
37         exit;\r
38 }\r
39 \r
40 require(TR_INCLUDE_PATH.'header.inc.php');\r
41 \r
42 unset($hidden_vars);\r
43 \r
44 foreach($ids as $id) \r
45 {\r
46         $row = $courseCategoriesDAO->get($id);\r
47         $names[] = $row['category_name'];\r
48 }\r
49 \r
50 $names_html = '<ul>'.html_get_list($names).'</ul>';\r
51 $hidden_vars['id'] = $_REQUEST['id'];\r
52 \r
53 $msg->addConfirm(array('DELETE_COURSE_CATEGORY', $names_html), $hidden_vars);\r
54 $msg->printConfirm();\r
55 \r
56 require(TR_INCLUDE_PATH.'footer.inc.php');\r
57 ?>\r