diff --git a/index.php b/index.php
index e46d41d..14e3531 100644
--- a/index.php
+++ b/index.php
@@ -1,260 +1,277 @@
-
-
-
+
+ Neues Buch hinzufügen
+
+ |
+
+ Neue Exemplare hinzufügen
+
+ |
+
+ Ausleiher hinzufügen
+
+ |
+
+ Buch verleihen
+
+ |
+
+ Buch einsammeln
+
+ |
- Neues Buch hinzufügen
-
+ Verliehene Bücher
+
+ | Vorname |
+ Nachname |
+ Klasse/Funktion |
+ Buch |
+ Exemplar |
+ Ausleihdatum |
+ Rückgabe fällig |
+
+
+ | = htmlspecialchars($loan['firstName']) ?> |
+ = htmlspecialchars($loan['lastName']) ?> |
+ = htmlspecialchars($loan['borrowerRole']) ?> |
+ = htmlspecialchars($loan['bookTitle']) ?> |
+ #= htmlspecialchars($loan['copyID']) ?> |
+ = date_create($loan['borrowedDate'])->format("d.m.Y") ?> |
+ = date_create($loan['dueDate'])->format("d.m.Y") ?> |
+
+
+
|
- Neue Exemplare hinzufügen
-
+ Versäumte Rückgaben
+
+ | Vorname |
+ Nachname |
+ Klasse/Funktion |
+ Buch |
+ Exemplar |
+ Ausleihdatum |
+ Rückgabe fällig |
+
+
+ | = htmlspecialchars($lateLoan['firstName']) ?> |
+ = htmlspecialchars($lateLoan['lastName']) ?> |
+ = htmlspecialchars($lateLoan['borrowerRole']) ?> |
+ = htmlspecialchars($lateLoan['bookTitle']) ?> |
+ #= htmlspecialchars($lateLoan['copyID']) ?> |
+ = date_create($lateLoan['borrowedDate'])->format("d.m.Y") ?> |
+ = date_create($lateLoan['dueDate'])->format("d.m.Y") ?> |
+
+
+
|
-
- Ausleiher hinzufügen
-
- |
-
- Buch verleihen
-
- |
-
- Buch einsammeln
-
- |
-
-
- Verliehene Bücher
-
- | Vorname | Nachname | Klasse/Funktion | Buch | Exemplar | Ausleihdatum | Rückgabe fällig |
-
-
- | = htmlspecialchars($loan['firstName'])?> |
- = htmlspecialchars($loan['lastName'])?> |
- = htmlspecialchars($loan['borrowerRole'])?> |
- = htmlspecialchars($loan['bookTitle'])?> |
- #= htmlspecialchars($loan['copyID'])?> |
- = date_create($loan['borrowedDate'])->format("d.m.Y")?> |
- = date_create($loan['dueDate'])->format("d.m.Y")?> |
-
-
-
- |
-
- Versäumte Rückgaben
-
- | Vorname | Nachname | Klasse/Funktion | Buch | Exemplar | Ausleihdatum | Rückgabe fällig |
-
-
- | = htmlspecialchars($lateLoan['firstName'])?> |
- = htmlspecialchars($lateLoan['lastName'])?> |
- = htmlspecialchars($lateLoan['borrowerRole'])?> |
- = htmlspecialchars($lateLoan['bookTitle'])?> |
- #= htmlspecialchars($lateLoan['copyID'])?> |
- = date_create($lateLoan['borrowedDate'])->format("d.m.Y")?> |
- = date_create($lateLoan['dueDate'])->format("d.m.Y")?> |
-
-
-
- |
-
-
-
- Datenbank durchsuchen
-
- |
-
-
-
+
+
+ Datenbank durchsuchen
+
+ |
+
+
+ Please fill in all fields.
";
}
}
-
+
//Copy Submission
- if($_POST['submissionType'] == "copy"){
+ if ($_POST['submissionType'] == "copy") {
$bookID = $_POST['book'] ?? '';
$amount = $_POST['amount'] ?? '';
$copyCondition = $_POST['condition'] ?? '';
@@ -45,80 +45,80 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
//Borrower Submission
- if($_POST['submissionType'] == "borrower"){
+ if ($_POST['submissionType'] == "borrower") {
$firstname = $_POST['firstname'] ?? '';
$lastname = $_POST['lastname'] ?? '';
$role = $_POST['role'] ?? '';
- if($firstname && $lastname && $role){
+ if ($firstname && $lastname && $role) {
addBorrower($pdo, $firstname, $lastname, $role);
- }else{
+ } else {
echo "Please fill in all fields.
";
}
}
- if($_POST['submissionType'] == "loan"){
+ if ($_POST['submissionType'] == "loan") {
$copyID = $_POST['copyID'] ?? '';
$borrowerID = $_POST['borrowerID'] ?? '';
$borrowedDate = $_POST['borrowedDate'] ?? '';
$dueDate = $_POST['dueDate'];
- if($copyID && $borrowerID && $borrowedDate && $dueDate){
+ if ($copyID && $borrowerID && $borrowedDate && $dueDate) {
addLoan($pdo, $copyID, $borrowerID, $borrowedDate, $dueDate);
- }else{
+ } else {
echo "Please fill in all fields.
";
}
}
- if($_POST['submissionType'] == "return"){
+ if ($_POST['submissionType'] == "return") {
$copyIDLoanID = explode("-", $_POST['copyID-loanID'], 2);
$copyID = $copyIDLoanID[0];
$loanID = $copyIDLoanID[1];
$returnedDate = $_POST['returnedDate'];
- if($copyID && $loanID){
+ if ($copyID && $loanID) {
removeLoan($pdo, $copyID, $loanID, $returnedDate);
- }else{
+ } else {
echo "