Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         Form
6
 * @author          WebsiteBaker Project
7
 * @copyright       WebsiteBaker Org. e.V.
8
 * @link            http://websitebaker.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.3
11
 * @requirements    PHP 5.3.6 and higher
12
 * @version         $Id: delete_submission.php 2 2017-07-02 15:14:29Z Manuela $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/trunk/modules/form/delete_submission.php $
14
 * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
15
 * @description     
16
 */
17

    
18
if ( !defined( 'WB_PATH' ) ){ require( dirname(dirname((__DIR__))).'/config.php' ); }
19

    
20
// Include WB admin wrapper script
21
$update_when_modified = true; // Tells script to update when this page was last updated
22
require(WB_PATH.'/modules/admin.php');
23

    
24
// Get id
25
$submission_id = intval($admin->checkIDKEY('submission_id', false, 'GET'));
26
if (!$submission_id) {
27
//    $admin->clearIDKEY();
28
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
29
}
30

    
31
// Delete row
32
    $sql  = 'DELETE FROM `'.TABLE_PREFIX.'mod_form_submissions` '
33
          . 'WHERE `submission_id` = '.$database->escapeString($submission_id);
34
    $database->query($sql);
35
//    $admin->clearIDKEY();
36

    
37
// Check if there is a db error, otherwise say successful
38
if($database->is_error()) {
39
    $admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
40
} else {
41
    $admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
42
}
43

    
44
// Print admin footer
45
$admin->print_footer();
(8-8/28)