-
Notifications
You must be signed in to change notification settings - Fork 2
/
PledgeDelete.php
80 lines (69 loc) · 2.17 KB
/
PledgeDelete.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/*******************************************************************************
*
* filename : PledgeDelete.php
* last change : 2004-6-12
* website : http://www.infocentral.org
* copyright : Copyright 2001, 2002, 2003 Deane Barker, Chris Gebhardt, Michael Wilt
*
* InfoCentral is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
******************************************************************************/
//Include the function library
require "Include/Config.php";
require "Include/Functions.php";
//Set the page title
$sPageTitle = gettext("Confirm Delete");
//Get the PledgeID out of the querystring
$iPledgeID = FilterInput($_GET["PledgeID"],'int');
$linkBack = FilterInput($_GET["linkBack"]);
// Security: User must have Add or Edit Records permission to use this form in those manners
// Clean error handling: (such as somebody typing an incorrect URL ?PersonID= manually)
if (strlen($iPledgeID) > 0)
{
if (!$_SESSION['bEditRecords'])
{
Redirect("Menu.php");
exit;
}
$sSQL = "SELECT '' FROM pledge_plg WHERE plg_plgID = " . $iPledgeID;
if (mysql_num_rows(RunQuery($sSQL)) == 0)
{
Redirect("Menu.php");
exit;
}
}
elseif (!$_SESSION['bAddRecords'])
{
Redirect("Menu.php");
exit;
}
//Is this the second pass?
if (isset($_POST["Delete"]))
{
$sSQL = "DELETE FROM `pledge_plg` WHERE `plg_plgID` = '" . $iPledgeID . "' LIMIT 1;";
//Execute the SQL
RunQuery($sSQL);
if ($linkBack <> "") {
Redirect ($linkBack);
}
} else if (isset ($_POST["Cancel"])) {
Redirect ($linkBack);
}
require "Include/Header.php";
?>
<form method="post" action="PledgeDelete.php?<?php echo "PledgeID=" . $iPledgeID . "&linkBack=" . $linkBack; ?>" name="PledgeDelete">
<table cellpadding="3" align="center">
<tr>
<td align="center">
<input type="submit" class="icButton" value="<?php echo gettext("Delete"); ?>" name="Delete">
<input type="submit" class="icButton" value="<?php echo gettext("Cancel"); ?>" name="Cancel">
</td>
</tr>
</table>
<?php
require "Include/Footer.php";
?>