-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_info.php
61 lines (44 loc) · 1.55 KB
/
delete_info.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
include_once("includes/inc.global.php");
$cUser->MustBeLevel(1);
$p->site_section = EVENTS;
$p->page_title = "Choose Info Page to Delete";
include("includes/inc.forms.php");
include_once("classes/class.info.php");
if ($_REQUEST["id"] && $_REQUEST["confirm"]==1) {
$q = 'delete from cdm_pages where id='.$cDB->EscTxt($_REQUEST["id"]).'';
$success = $cDB->Query($q);
if ($success)
$output = "Page deleted.";
else
$output = "There was a problem deleting the page.";
$p->DisplayPage($output);
die;
}
$pgs = cInfo::LoadPages();
if ($pgs) {
foreach($pgs as $pg) {
$p_array[$pg["id"]] = stripslashes($pg["title"]);
}
$form->addElement("select", "id", "Which Info Page?", $p_array);
$form->addElement("static", null, null, null);
$form->addElement('submit', 'btnSubmit', 'Delete');
}
else {
$form->addElement("static", null, "There are no current Info Pages.", null);
}
if ($form->validate()) { // Form is validated so processes the data
$form->freeze();
$form->process("process_data", false);
} else { // Display the form
$p->DisplayPage($form->toHtml());
}
function process_data ($values) {
global $cUser,$p,$cDB;
if ($_REQUEST["confirm"]!=1) {
$output .= 'Really Delete this page (ID#'.$_REQUEST["id"].')? <a href=delete_info.php?id='.$_REQUEST["id"].'&confirm=1>Yes</a> | <a href=javascript:history.back(1)>No (go back)</a>';
}
$p->DisplayPage($output);
//header("location:http://".HTTP_BASE."/do_info_edit.php?id=".$values["news_id"]);
//exit;
}