-
Notifications
You must be signed in to change notification settings - Fork 6
/
cancel_add.php
31 lines (27 loc) · 1.15 KB
/
cancel_add.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
<?php
/**
* @package cancel_add.php
* @author John Doe <[email protected]>
* @since 2011-06-09
* @version 2011-06-09
*/
/*
6/9/11 initial release
*/
error_reporting(E_ALL);
require_once './incs/functions.inc.php';
//snap (basename(__FILE__), __LINE__);
extract ($_POST);
if (strval(intval($ticket_id)) == $_POST['ticket_id']) { // sanity check
$query = "DELETE FROM `$GLOBALS[mysql_prefix]action` WHERE `ticket_id` = '{$ticket_id}';"; // possibly none
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
$query = "DELETE FROM `$GLOBALS[mysql_prefix]patient` WHERE `ticket_id` = '{$ticket_id}';";
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
$query = "DELETE FROM `$GLOBALS[mysql_prefix]ticket` WHERE `id` = '{$ticket_id}' AND `status` = '{$GLOBALS['STATUS_RESERVED']}' LIMIT 1;";
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
}
else {
snap (basename(__FILE__), implode (";", $_POST));
}
//snap (__LINE__, $query);
?>