Meh
parent
84f306add9
commit
2ef6a4a062
|
@ -49,6 +49,24 @@
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$ID = $_GET['ausleihID'];
|
||||||
|
$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` = ?;");
|
||||||
|
$sql->bind_param("i", $ID);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<div class="hauptcontainer" id="verlängerung">
|
<div class="hauptcontainer" id="verlängerung">
|
||||||
<h1 id="verlängerungH1">Buch erfolgreich entfernt</h1>
|
<h1 id="verlängerungH1">Buch erfolgreich entfernt</h1>
|
||||||
<div id="verlängerungContent">
|
<div id="verlängerungContent">
|
||||||
|
|
|
@ -50,6 +50,8 @@
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="hauptcontainer">
|
<div class="hauptcontainer">
|
||||||
|
<h1 id="searchResult_heading">Reservierung stornieren</h1>
|
||||||
|
<div id="searchResult_container">
|
||||||
<?php
|
<?php
|
||||||
$servername = "localhost";
|
$servername = "localhost";
|
||||||
$username = "web_b-3";
|
$username = "web_b-3";
|
||||||
|
@ -126,6 +128,8 @@
|
||||||
$bookStartdate = $row['Anfangsdatum'];
|
$bookStartdate = $row['Anfangsdatum'];
|
||||||
$bookEnddate = $row['Enddatum'];
|
$bookEnddate = $row['Enddatum'];
|
||||||
|
|
||||||
|
$bookStartdatePlusSeven = $bookStartdate +7;
|
||||||
|
|
||||||
/* TODO: OnClick auslagern. */
|
/* TODO: OnClick auslagern. */
|
||||||
echo "<div id='book_container$bookID+$ausleihID' class='book_container'
|
echo "<div id='book_container$bookID+$ausleihID' class='book_container'
|
||||||
onclick='open_bookDetails(this.id)'>
|
onclick='open_bookDetails(this.id)'>
|
||||||
|
@ -162,29 +166,9 @@
|
||||||
parentDiv.style.backgroundColor
|
parentDiv.style.backgroundColor
|
||||||
= '#70AD47';
|
= '#70AD47';
|
||||||
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Diese Reservierung verfällt, wenn das Buch nicht bis zum $bookStartdatePlusSeven abgeholt wurde.';
|
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_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
|
||||||
else if (currentElement.innerHTML.trim().includes('Rückgabe') && $bookExtendable === 1){
|
|
||||||
parentDiv.style.backgroundColor
|
|
||||||
= '#70AD47';
|
|
||||||
document.getElementById('placeholder$ausleihID').classList.add('extend');
|
|
||||||
}
|
|
||||||
// Ausgeliehen und nicht Verlängerbar
|
|
||||||
else if (currentElement.innerHTML.trim().includes('Rückgabe') && $bookExtendable === 0){
|
|
||||||
parentDiv.style.backgroundColor
|
|
||||||
= '#F34343';
|
|
||||||
} else
|
|
||||||
// Noch nicht Ausgeliehen
|
// Noch nicht Ausgeliehen
|
||||||
{
|
{
|
||||||
parentDiv.style.backgroundColor
|
parentDiv.style.backgroundColor
|
||||||
|
@ -204,35 +188,21 @@
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
die("Ungültige SQL-Abfrage: " . mysqli_connect_error());
|
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'>Bestätigen</a>
|
||||||
|
<a id = 'verlängerungButton2' href='meinebuecher.php'>Abbrechen</a>
|
||||||
|
</div>";
|
||||||
mysqli_close($connection);
|
mysqli_close($connection);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!--<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>-->
|
|
||||||
<!---->
|
|
||||||
<!-- <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>-->
|
|
||||||
<!---->
|
|
||||||
<!-- <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>-->
|
|
||||||
<!---->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!---->
|
|
||||||
<!--</div>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,16 @@
|
||||||
= '#F34343';
|
= '#F34343';
|
||||||
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Dieses Buch ist für sie Reserviert.';
|
document.getElementById('bestellungsInfo$ausleihID').innerHTML = 'Dieses Buch ist für sie Reserviert.';
|
||||||
document.getElementById('placeholder$ausleihID').classList.add('bin');
|
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>
|
</script>
|
||||||
|
|
|
@ -41,7 +41,7 @@ document.getElementById("footer").innerHTML = `
|
||||||
document.getElementById("activeid").innerHTML = `
|
document.getElementById("activeid").innerHTML = `
|
||||||
<div class="navLinks">
|
<div class="navLinks">
|
||||||
<input class="nav-toggleclass"id="nav-toggle"
|
<input class="nav-toggleclass"id="nav-toggle"
|
||||||
type="checkbox" onclick="openNav()";>
|
type="checkbox" onclick="openNav()">
|
||||||
<label for="nav-toggle" class="icon-burger" >
|
<label for="nav-toggle" class="icon-burger" >
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
|
|
|
@ -354,7 +354,7 @@ TODO (optional, geringe Priorität):
|
||||||
}
|
}
|
||||||
|
|
||||||
function open_reservation() {
|
function open_reservation() {
|
||||||
var url = "http://141.19.142.11/reservierung.php";
|
var url = "http://141.19.142.11/anmelden.php";
|
||||||
location.href = url;
|
location.href = url;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue