2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../../include/');
14 require(TR_INCLUDE_PATH.'vitals.inc.php');
15 require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
16 require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
20 Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
22 $coursesDAO = new CoursesDAO();
23 $course_info = $coursesDAO->get($_course_id);
25 if (isset($_POST['submit_no'])) {
26 $msg->addFeedback('CANCELLED');
27 header('Location: '.TR_BASE_HREF.'home/course/index.php?_course_id='.$_course_id);
29 } else if (isset($_POST['step']) && ($_POST['step'] == 2) && isset($_POST['submit_yes'])) {
30 $coursesDAO->Delete($_course_id);
32 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
33 header('Location: '.TR_BASE_HREF.'home/index.php');
37 require(TR_INCLUDE_PATH.'header.inc.php');
39 if (!isset($_POST['step'])) {
40 $hidden_vars['step'] = 1;
41 $hidden_vars['_course_id'] = $_course_id;
42 $msg->addConfirm(array('DELETE_COURSE_1', $course_info['title']), $hidden_vars);
44 } else if ($_POST['step'] == 1) {
45 $hidden_vars['step'] = 2;
46 $hidden_vars['_course_id'] = $_course_id;
47 $msg->addConfirm(array('DELETE_COURSE_2', $course_info['title']), $hidden_vars);
51 require(TR_INCLUDE_PATH.'footer.inc.php');