Project

General

Profile

« Previous | Next » 

Revision 317

Added by stefan about 18 years ago

Changed all line endings to Unix stlye

View differences:

delete_submission.php
27 27
The Website Baker Project would like to thank Rudolph Lartey <www.carbonect.com>
28 28
for his contributions to this module - adding extra submission types
29 29
*/
30

  
31
require('../../config.php');

32

  
33
// Get id

34
if(!isset($_GET['submission_id']) OR !is_numeric($_GET['submission_id'])) {

35
	header("Location: ".ADMIN_URL."/pages/index.php");

30

  
31
require('../../config.php');
32

  
33
// Get id
34
if(!isset($_GET['submission_id']) OR !is_numeric($_GET['submission_id'])) {
35
	header("Location: ".ADMIN_URL."/pages/index.php");
36 36
	exit(0);
37
} else {

38
	$submission_id = $_GET['submission_id'];

39
}

40

  
41
// Include WB admin wrapper script

42
$update_when_modified = true; // Tells script to update when this page was last updated

43
require(WB_PATH.'/modules/admin.php');

44

  
45
// Delete row

46
$database->query("DELETE FROM ".TABLE_PREFIX."mod_form_submissions WHERE submission_id = '$submission_id'");

47

  
48
// Check if there is a db error, otherwise say successful

49
if($database->is_error()) {

50
	$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id);

51
} else {

52
	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);

53
}

54

  
55
// Print admin footer

56
$admin->print_footer();

57

  
37
} else {
38
	$submission_id = $_GET['submission_id'];
39
}
40

  
41
// Include WB admin wrapper script
42
$update_when_modified = true; // Tells script to update when this page was last updated
43
require(WB_PATH.'/modules/admin.php');
44

  
45
// Delete row
46
$database->query("DELETE FROM ".TABLE_PREFIX."mod_form_submissions WHERE submission_id = '$submission_id'");
47

  
48
// Check if there is a db error, otherwise say successful
49
if($database->is_error()) {
50
	$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
51
} else {
52
	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
53
}
54

  
55
// Print admin footer
56
$admin->print_footer();
57

  
58 58
?>

Also available in: Unified diff