-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNoteDelete.php
84 lines (68 loc) · 2.15 KB
/
NoteDelete.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
81
82
83
84
<?php
/*******************************************************************************
*
* filename : NoteDelete.php
* last change : 2003-01-07
* website : http://www.infocentral.org
* copyright : Copyright 2001, 2002 Deane Barker
*
* 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";
// Security: User must have Notes permission
// Otherwise, re-direct them to the main menu.
if (!$_SESSION['bNotes'])
{
Redirect("Menu.php");
exit;
}
//Set the page title
$sPageTitle = gettext("Note Delete Confirmation");
//Get the NoteID from the querystring
$iNoteID = FilterInput($_GET["NoteID"],'int');
//Get the data on this note
$sSQL = "SELECT * FROM note_nte WHERE nte_ID = " . $iNoteID;
$rsNote = RunQuery($sSQL);
extract(mysql_fetch_array($rsNote));
//If deleting a note for a person, set the PersonView page as the redirect
if ($nte_per_ID > 0)
{
$sReroute = "PersonView.php?PersonID=" . $nte_per_ID;
}
//If deleting a note for a family, set the FamilyView page as the redirect
elseif ($nte_fam_ID > 0)
{
$sReroute = "FamilyView.php?FamilyID=" . $nte_fam_ID;
}
//Do we have confirmation?
if (isset($_GET["Confirmed"]))
{
//Delete the specified Person record
$sSQL = "DELETE FROM note_nte WHERE nte_ID = " . $iNoteID;
RunQuery($sSQL);
//Send back to the page they came from
Redirect($sReroute);
}
require "Include/Header.php";
?>
<p>
<?php echo gettext("Please confirm deletion of this note:"); ?>
</p>
<p class="ShadedBox">
<?php echo $nte_Text; ?>
</p>
<p>
<a href="NoteDelete.php?Confirmed=Yes&NoteID=<?php echo $iNoteID ?>"><?php echo gettext("Yes, delete this record"); ?></a> <?php echo gettext("(this action cannot be undone)"); ?>
</p>
<p>
<a href="<?php echo $sReroute ?>"><?php echo gettext("No, cancel this deletion"); ?></a>
</p>
<?php
require "Include/Footer.php";
?>