Merge branch 'master' of https://gitty.informatik.hs-mannheim.de/2123174/Candle
commit
c28d830a8c
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
if(isset($_SESSION['eingeloggt']) && $_SESSION['eingeloggt'] == 1 ){
|
||||
require_once "warenkorb.php";
|
||||
require_once "reservierung.php";
|
||||
}else{
|
||||
echo '
|
||||
|
||||
|
@ -70,7 +70,7 @@
|
|||
<hr>
|
||||
|
||||
<div>
|
||||
<form class="anmeldung-überschriften" accept-charset="UTF-8" action="warenkorb.php" method="POST">
|
||||
<form class="anmeldung-überschriften" accept-charset="UTF-8" action="anmeldesystem_warenkorb.php" method="POST">
|
||||
Karten-ID <span id="question-mark">
|
||||
<svg width="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||
<path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<hr>
|
||||
|
||||
<div>
|
||||
<form class="anmeldung-überschriften" accept-charset="UTF-8" action="meinebuecher.php" method="POST">
|
||||
<form class="anmeldung-überschriften" accept-charset="UTF-8" action="anmeldesystem_meinebuecher.php" method="POST">
|
||||
Karten-ID <span id="question-mark">
|
||||
<svg width="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||
<path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<?php session_start();
|
||||
$db_link = mysqli_connect('localhost', 'web_b-3', 'een7Ao6s', 'bibliothek_candle', '3306');
|
||||
|
||||
function runSQL($sql){
|
||||
global $db_link;
|
||||
$db_res = mysqli_query($db_link, $sql);
|
||||
if(!$db_res){
|
||||
header("Location: 404.html");
|
||||
exit;
|
||||
}
|
||||
return $db_res;
|
||||
}
|
||||
|
||||
if(isset($_POST['submit'])){
|
||||
$kartenid = $_POST['karten-id'];
|
||||
$passwort = $_POST['password'];
|
||||
|
||||
$existiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid' and `Passwort` = '$passwort'");
|
||||
$row = mysqli_fetch_array($existiert);
|
||||
$karteexistiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid'");
|
||||
$zeile = mysqli_fetch_array($karteexistiert);
|
||||
if($row['COUNT(*)'] > 0){
|
||||
|
||||
$_SESSION['eingeloggt'] = 1;
|
||||
header("Location: meinebuecher.php");
|
||||
}else if($zeile['COUNT(*)'] > 0){
|
||||
header("Location: passwort_stimmt_nicht.php");
|
||||
}else{
|
||||
header("Location: benutzer_existiert_nicht.php");
|
||||
}
|
||||
|
||||
}else{
|
||||
header("Location: 404.html");
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,36 @@
|
|||
<?php session_start();
|
||||
$db_link = mysqli_connect('localhost', 'web_b-3', 'een7Ao6s', 'bibliothek_candle', '3306');
|
||||
|
||||
function runSQL($sql){
|
||||
global $db_link;
|
||||
$db_res = mysqli_query($db_link, $sql);
|
||||
if(!$db_res){
|
||||
header("Location: 404.html");
|
||||
exit;
|
||||
}
|
||||
return $db_res;
|
||||
}
|
||||
|
||||
if(isset($_POST['submit'])){
|
||||
$kartenid = $_POST['karten-id'];
|
||||
$passwort = $_POST['password'];
|
||||
|
||||
$existiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid' and `Passwort` = '$passwort'");
|
||||
$row = mysqli_fetch_array($existiert);
|
||||
$karteexistiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid'");
|
||||
$zeile = mysqli_fetch_array($karteexistiert);
|
||||
if($row['COUNT(*)'] > 0){
|
||||
|
||||
$_SESSION['eingeloggt'] = 1;
|
||||
header("Location: reservierung.php");
|
||||
}else if($zeile['COUNT(*)'] > 0){
|
||||
header("Location: passwort_stimmt_nicht.php");
|
||||
}else{
|
||||
header("Location: benutzer_existiert_nicht.php");
|
||||
}
|
||||
|
||||
}else{
|
||||
header("Location: 404.html");
|
||||
}
|
||||
|
||||
?>
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,13 +42,35 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
$ID = $_GET['ausleihID'];
|
||||
$BookID = $_GET['buchID'];
|
||||
$servername = "localhost";
|
||||
$username = "web_b-3";
|
||||
$password = "een7Ao6s";
|
||||
$dbname = "bibliothek_candle";
|
||||
|
||||
$connection =
|
||||
mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
if (!$connection) {
|
||||
die("Verbindung fehlgeschlagen: " . mysqli_connect_error());
|
||||
}
|
||||
$sql = $connection->prepare("
|
||||
DELETE FROM `ausgeliehenes_buch` WHERE `ausgeliehenes_buch`.`AusleihID` = ?;
|
||||
UPDATE `buch` SET `Anzahl` = Anzahl+1 WHERE `buch`.`BuchID` = ? ;
|
||||
");
|
||||
$sql->bind_param("ii", $ID, $BookID);
|
||||
|
||||
?>
|
||||
|
||||
<div class="hauptcontainer" id="verlängerung">
|
||||
<h1 id="verlängerungH1">Buch erfolgreich entfernt</h1>
|
||||
<div id="verlängerungContent">
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="device=device-width, initial-scaling=1"/>
|
||||
<link rel="Stylesheet" type="text/css" href="style.css"/>
|
||||
<link rel="Stylesheet" type="text/css" href="suchergebnisse.css"/>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<title>Candle Bibliothek | Löschen Meine Bücher</title>
|
||||
<link rel="icon" href="pictures/candle.png">
|
||||
|
@ -42,40 +43,171 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="hauptcontainer">
|
||||
<h1 id="searchResult_heading">Reservierung stornieren</h1>
|
||||
<div id="searchResult_container">
|
||||
<?php
|
||||
$servername = "localhost";
|
||||
$username = "web_b-3";
|
||||
$password = "een7Ao6s";
|
||||
$dbname = "bibliothek_candle";
|
||||
|
||||
<div class="hauptcontainer" id="verlängerung">
|
||||
<h1 id="verlängerungH1">Reservierung stornieren</h1>
|
||||
<div id="verlängerungContent">
|
||||
<p id="möchten-sie">Möchten Sie die Reservierung für das folgende Buch wirklich stornieren?</p>
|
||||
$connection =
|
||||
mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
<div class="item" id="verlängerungItem">
|
||||
<img src="pictures/the_hundred_and_one_dalmatians.jpg" alt="The Hundred and One Dalmatians" height="200">
|
||||
<div class="beschreibung">
|
||||
<h2>The Hundred and One Dalmatians</h2>
|
||||
<h3>von Dodie Smith</h3>
|
||||
<div class="b2 red">Abholbereit am: 03.05.2023</div>
|
||||
</div>
|
||||
</div>
|
||||
if (!$connection) {
|
||||
die("Verbindung fehlgeschlagen: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
<div id="verlängerungButtonContainer">
|
||||
<a id = "verlängerungButton1" href="loeschenErfolgreich_meine_buecher.html">Bestätigen</a>
|
||||
<a id = "verlängerungButton2" href="meinebuecher.php">Abbrechen</a>
|
||||
</div>
|
||||
/* SQL-Befehl vorbereiten */
|
||||
$sql = $connection->prepare("SELECT ab.AusleihID, ab.BuchID, b.Titel, b.Bild, ab.Verlängerbar, DATE_FORMAT(ab.Anfangsdatum, '%d.%m.%Y') as Anfangsdatum, DATE_FORMAT(ab.Enddatum, '%d.%m.%Y') as Enddatum,
|
||||
GROUP_CONCAT(DISTINCT CONCAT(a.VorName, ' ', a.NachName)
|
||||
SEPARATOR ', ') AS 'Autor',
|
||||
IF(
|
||||
(SELECT ausgeliehenes_buch.Anfangsdatum FROM ausgeliehenes_buch WHERE ausgeliehenes_buch.AusleihID=ab.AusleihID) = Curdate(), 'Sofort Abholbereit',
|
||||
(
|
||||
IF(
|
||||
(SELECT ausgeliehenes_buch.Anfangsdatum FROM ausgeliehenes_buch WHERE ausgeliehenes_buch.AusleihID=ab.AusleihID) > Curdate(),
|
||||
CONCAT(
|
||||
'Abholbereit am: ', (
|
||||
SELECT DATE_FORMAT(
|
||||
ausgeliehenes_buch.Anfangsdatum , '%d.%m.%Y'
|
||||
) FROM ausgeliehenes_buch WHERE ausgeliehenes_buch.AusleihID=ab.AusleihID
|
||||
)
|
||||
)
|
||||
, CONCAT(
|
||||
'Rückgabe am: ', (
|
||||
SELECT DATE_FORMAT(
|
||||
ausgeliehenes_buch.Enddatum , '%d.%m.%Y'
|
||||
) FROM ausgeliehenes_buch WHERE ausgeliehenes_buch.AusleihID=ab.AusleihID
|
||||
)
|
||||
))
|
||||
)
|
||||
)
|
||||
AS 'Verfügbarkeit'
|
||||
FROM ausgeliehenes_buch AS ab
|
||||
INNER JOIN buch as b
|
||||
ON ab.BuchID = b.BuchID
|
||||
INNER JOIN `buch_verfasst_von_autor` AS bvva
|
||||
ON b.BuchID = bvva.BuchID
|
||||
INNER JOIN `autor` AS a ON bvva.AutorNr = a.AutorNr
|
||||
WHERE ab.AusleihID=?
|
||||
GROUP BY ab.AusleihID;;");
|
||||
|
||||
// Parameter binden
|
||||
$sql->bind_param("i", $ID);
|
||||
|
||||
// Übergebene ID des angeklickten Container speichern
|
||||
$containerID = $_GET['ausleihID'];
|
||||
|
||||
// Buch ID abtrennen
|
||||
$ID = str_replace('placeholder_container', '', $containerID);
|
||||
|
||||
|
||||
// SQL-Befehl ausführen
|
||||
$sql->execute();
|
||||
|
||||
// Ergebnis speichern
|
||||
$result = $sql->get_result();
|
||||
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
while($row = mysqli_fetch_assoc($result)) {
|
||||
$bookID = $row['BuchID'];
|
||||
$ausleihID = $row['AusleihID'];
|
||||
$bookCover = $row['Bild'];
|
||||
$bookTitle = $row['Titel'];
|
||||
$bookAuthor = $row['Autor'];
|
||||
$bookAvailability = $row['Verfügbarkeit'];
|
||||
$bookExtendable = $row['Verlängerbar'];
|
||||
$bookStartdate = $row['Anfangsdatum'];
|
||||
$bookEnddate = $row['Enddatum'];
|
||||
|
||||
$bookStartdatePlusSeven = $bookStartdate +7;
|
||||
|
||||
/* TODO: OnClick auslagern. */
|
||||
echo "<div id='book_container$bookID+$ausleihID' class='book_container'
|
||||
onclick='open_bookDetails(this.id)'>
|
||||
<div class='bookCover_container'>
|
||||
<img class='bookCover' src='book_covers/$bookCover'
|
||||
alt='Kein Bild vorhanden'>
|
||||
</div>
|
||||
<div class='bookDetails_container'>
|
||||
<h2 class='bookTitle'>$bookTitle</h2>
|
||||
<div class='bookDetails'>
|
||||
<p class='author'>von $bookAuthor</p>
|
||||
|
||||
</div>
|
||||
<div class='available_container'>
|
||||
<p id='available_$ausleihID' class='available'>
|
||||
$bookAvailability</p>
|
||||
</div>
|
||||
<div>
|
||||
<p id='bestellungsInfo$ausleihID'></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class='placeholder_container' id='placeholder_container$ausleihID'>
|
||||
<div class='placeholder' id='placeholder$ausleihID'></div>
|
||||
</div>
|
||||
<script type='text/javascript'
|
||||
language='JavaScript'>
|
||||
(function() {
|
||||
var currentElement = document.
|
||||
getElementById('available_$ausleihID');
|
||||
var parentDiv = currentElement.parentElement;
|
||||
// Sofort Abholbereit
|
||||
if (currentElement.innerHTML.trim() === 'Sofort Abholbereit') {
|
||||
parentDiv.style.backgroundColor
|
||||
= '#70AD47';
|
||||
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Diese Reservierung verfällt, wenn das Buch nicht bis zum $bookStartdatePlusSeven abgeholt wurde.';
|
||||
|
||||
}
|
||||
else
|
||||
// Noch nicht Ausgeliehen
|
||||
{
|
||||
parentDiv.style.backgroundColor
|
||||
= '#F34343';
|
||||
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Dieses Buch ist für sie Reserviert.';
|
||||
document.getElementById('placeholder$ausleihID').classList.add('bin');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</div>";
|
||||
}
|
||||
} else {
|
||||
echo "Keine Infos vorhanden.";
|
||||
echo $_POST['ausleihID'];
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
die("Ungültige SQL-Abfrage: " . mysqli_connect_error());
|
||||
}
|
||||
echo "
|
||||
<div id='verlängerungButtonContainer'>
|
||||
<a id = 'verlängerungButton1' href='loeschen_erfolgreich_meine_buecher.php?ausleihID=$ID&buchID=$bookID'>Bestätigen</a>
|
||||
<a id = 'verlängerungButton2' href='meinebuecher.php'>Abbrechen</a>
|
||||
</div>";
|
||||
mysqli_close($connection);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--Link JS file-->
|
||||
<!--If it was small and got big, it calls the function only one time and doesn't do it all the time-->
|
||||
<script src="resize.js"></script>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
@ -51,30 +51,8 @@
|
|||
</header>
|
||||
<?php
|
||||
session_start();
|
||||
$db_link = mysqli_connect('localhost', 'web_b-3', 'een7Ao6s', 'bibliothek_candle', '3306');
|
||||
|
||||
function runSQL($sql){
|
||||
global $db_link;
|
||||
$db_res = mysqli_query($db_link, $sql);
|
||||
if(!$db_res){
|
||||
header("Location: 404.html");
|
||||
exit;
|
||||
}
|
||||
return $db_res;
|
||||
}
|
||||
$db_link = mysqli_connect('localhost', 'web_b-3', 'een7Ao6s', 'bibliothek_candle', '3306');
|
||||
|
||||
if(isset($_POST['submit'])){
|
||||
$kartenid = $_POST['karten-id'];
|
||||
$passwort = $_POST['password'];
|
||||
|
||||
$existiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid' and `Passwort` = '$passwort'");
|
||||
$row = mysqli_fetch_array($existiert);
|
||||
$karteexistiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid'");
|
||||
$zeile = mysqli_fetch_array($karteexistiert);
|
||||
|
||||
if($row['COUNT(*)'] > 0){
|
||||
|
||||
$_SESSION['eingeloggt'] = 1;
|
||||
echo '
|
||||
|
||||
<div class="hauptcontainer">
|
||||
|
@ -166,7 +144,7 @@ if(isset($_POST['submit'])){
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div class='placeholder_container'>
|
||||
<div class='placeholder_container' id='placeholder_container$ausleihID'>
|
||||
<div class='placeholder' id='placeholder$ausleihID'></div>
|
||||
</div>
|
||||
<script type='text/javascript'
|
||||
|
@ -181,7 +159,16 @@ if(isset($_POST['submit'])){
|
|||
= '#70AD47';
|
||||
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Diese Reservierung verfällt, wenn das Buch nicht bis zum $bookStartdatePlusSeven abgeholt wurde.';
|
||||
document.getElementById('placeholder$ausleihID').classList.add('bin');
|
||||
document.getElementById('placeholder$ausleihID').addEventListener('click', )
|
||||
document.getElementById('placeholder_container$ausleihID').addEventListener('click', function(){
|
||||
if (!e) var e = window.event;
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation) e.stopPropagation();
|
||||
ID = this.id;
|
||||
var data = new URLSearchParams();
|
||||
data.append('ausleihID', ID);
|
||||
var url = 'http://141.19.142.11/loeschen_meine_buecher.php?' + data.toString();
|
||||
location.href = url;
|
||||
});
|
||||
}
|
||||
// Ausgeliehen und Verlängerbar
|
||||
else if (currentElement.innerHTML.trim().includes('Rückgabe') && $bookExtendable === 1){
|
||||
|
@ -200,6 +187,16 @@ if(isset($_POST['submit'])){
|
|||
= '#F34343';
|
||||
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Dieses Buch ist für sie Reserviert.';
|
||||
document.getElementById('placeholder$ausleihID').classList.add('bin');
|
||||
document.getElementById('placeholder_container$ausleihID').addEventListener('click', function(){
|
||||
if (!e) var e = window.event;
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation) e.stopPropagation();
|
||||
ID = this.id;
|
||||
var data = new URLSearchParams();
|
||||
data.append('ausleihID', ID);
|
||||
var url = 'http://141.19.142.11/loeschen_meine_buecher.php?' + data.toString();
|
||||
location.href = url;
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
@ -215,17 +212,6 @@ if(isset($_POST['submit'])){
|
|||
}
|
||||
|
||||
mysqli_close($connection);
|
||||
|
||||
|
||||
}else if($zeile['COUNT(*)'] > 0){
|
||||
header("Location: passwort_stimmt_nicht.php");
|
||||
}else{
|
||||
header("Location: benutzer_existiert_nicht.php");
|
||||
}
|
||||
}else{
|
||||
header("Location: 404.html");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -242,6 +228,14 @@ if(isset($_POST['submit'])){
|
|||
data.toString();
|
||||
location.href = url;
|
||||
}
|
||||
|
||||
function bin (ID){
|
||||
// OnClick Event für open_bookDetails stoppen
|
||||
if (!e) var e = window.event;
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation) e.stopPropagation();
|
||||
alert(ID)
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--Link JS file-->
|
||||
|
|
|
@ -41,7 +41,7 @@ document.getElementById("footer").innerHTML = `
|
|||
document.getElementById("activeid").innerHTML = `
|
||||
<div class="navLinks">
|
||||
<input class="nav-toggleclass"id="nav-toggle"
|
||||
type="checkbox" onclick="openNav()";>
|
||||
type="checkbox" onclick="openNav()">
|
||||
<label for="nav-toggle" class="icon-burger" >
|
||||
<div class="line"></div>
|
||||
<div class="line"></div>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -47,7 +47,7 @@ TODO (optional):
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -47,7 +47,7 @@ TODO:
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.php">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
|
@ -54,7 +54,7 @@ TODO (optional, geringe Priorität):
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
@ -354,7 +354,7 @@ TODO (optional, geringe Priorität):
|
|||
}
|
||||
|
||||
function open_reservation() {
|
||||
var url = "http://141.19.142.11/reservierung.php";
|
||||
var url = "http://141.19.142.11/anmelden.php";
|
||||
location.href = url;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</form>
|
||||
<a id="erweitertesuche" href="erweitertesuche.html">
|
||||
Erweiterte Suche</a>
|
||||
<a href="anmelden.php" id="warenKorbID">
|
||||
<a href="warenkorb.php" id="warenKorbID">
|
||||
<img id="shoppingCard" src="pictures/einkaufswagen.png"
|
||||
alt="Bild von einem Wagen" width="50" height="50"/>
|
||||
</a>
|
||||
|
|
Loading…
Reference in New Issue