-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.php
60 lines (55 loc) · 1.96 KB
/
delete.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
<?php
// Link to the class files
require_once 'FileNotesRepo.php';
require_once 'Notes.php';
$notesRepo = new \abhijeet\NFS\FileNotesRepo();
?>
<!-- Logic for the delete page -->
<?php if ( $_SERVER['REQUEST_METHOD'] == "POST" && !empty( $_POST['id'] ) ) : ?>
<?php $notesRepo->deleteNotes( $_POST['id'] ); ?>
<!-- Delete page -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Delete note </title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<h1> Delete confirmation </h1>
<h2> Note successfully deleted </h2>
<p><a href="index.php"><input class="btn btn-primary" type="button" value="Go home" /></a></p>
</div>
</body>
</html>
<?php else : ?>
<!-- Delete error page -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Delete note </title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<h1> Something went wrong!!! </h1>
<h1> No notes found for deletion!!! </h1>
<a href="index.php"><input class="btn btn-primary" type="button" value="Go home" /></a>
</div>
</body>
</html>
<?php endif; ?>