-
Notifications
You must be signed in to change notification settings - Fork 4
/
delete_event.php
45 lines (41 loc) · 1.37 KB
/
delete_event.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace gameme;
use gameme\PHPGamification\DAO;
global $_base_path;
$_user_location = 'admin';
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
if (isset($_POST['submit_no'])) {
$msg->addFeedback('CANCELLED');
if($_SESSION['is_admin'] >0){
header("Location: ".AT_BASE_HREF."mods/gameme/index_instructor.php");
}else{
header("Location: ".AT_BASE_HREF."mods/gameme/index_admin.php");
}
exit;
} else if (isset($_POST['submit_yes'])) {
if($_SESSION['course_id'] > 0){
$course_id = $_SESSION['course_id'];
}else{
$course_id=0;
}
$sql = "DELETE FROM %sgm_events WHERE id=%d AND course_id = %d LIMIT 1";
queryDB($sql, array(TABLE_PREFIX, $_POST['event_id'], $course_id));
$msg->addFeedback('GM_EVENT_REMOVED');
if($_SESSION['is_admin'] >0){
header("Location: ".AT_BASE_HREF."mods/gameme/index_instructor.php");
}else{
header("Location: ".AT_BASE_HREF."mods/gameme/index_admin.php");
}
exit;
}
require (AT_INCLUDE_PATH.'header.inc.php');
unset($hidden_vars);
$hidden_vars['event_id'] = intval($_GET['id']);
if($_SESSION['is_admin']){
$msg->addConfirm(array('GM_DELETE_EVENT'), $hidden_vars);
} else {
$msg->addConfirm(array('GM_DELETE_EVENT_ADMIN'), $hidden_vars);
}
$msg->printConfirm();
require (AT_INCLUDE_PATH.'footer.inc.php'); ?>