-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreturn.php
82 lines (73 loc) · 2.39 KB
/
return.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="bootstrap.css">
<title>Library Database</title>
</head>
<?php
//include DatabaseHelper.php file
require_once('databasehelper.php');
//instantiate DatabaseHelper class
$database = new DatabaseHelper();
//Grab variables from POST request
$email = '';
if(isset($_POST['email']))
$email = trim($_POST['email']);
$item_id = 0;
if(isset($_POST['item_id']))
$item_id = trim($_POST['item_id']);
$language = 0;
if(isset($_POST['lang_id']))
$language = trim($_POST['lang_id']);
?>
<body>
<div class='container-fluid'>
<!-- NAVBAR -->
<header>
<div class='row justify-content-center align-items-center'>
<div class='col-md-6 col-sm-0'>
</div>
<div class='col-md-2 col-sm-3'>
<a href='index.php'>
Browse
</a>
</div>
<div class='col-md-2 col-sm-4'>
<a href='mybookslogin.php'>
MyBooks
</a>
</div>
<div class='col-md-2 col-sm-3'>
<a href='register.php'>
Register
</a>
</div>
</div>
</header>
<main>
<!-- PAGE TITLE -->
<div class = 'row justify-content-center title'>
<div class='col-12'>
<h1>[ Library Database ]</h1>
</div>
</div>
<div class = 'row justify-content-center line'>
<div class='col-8'>
<hr>
</div>
</div>
<p style="text-align:center;max-width:50%;margin-left:auto;margin-right:auto;">
<!-- USER NOTIFICATION -->
<?php
if ($database->QtyIncrement($item_id, $language) == 1 && $database->Return($item_id, $language, $email) == 1)
echo 'The book you selected has been returned successfully! Return to the <a href="index.php">homepage</a> to borrow another one.<br><br>';
else
echo 'You seem to have already returned that book.<br>Return to the <a href="index.php">homepage</a><br><br>';
?>
</p>
</main>
<footer><br><br><br><br></footer>
</body>
</html>