buecher.php fertig

master
Nils Eilinghoff 2023-06-07 09:28:03 +02:00
parent 08fd5ab5ff
commit 4c9e82db27
1 changed files with 9 additions and 2 deletions

View File

@ -14,7 +14,8 @@
<body>
<header id="header"></header>
<div class="hauptcontainer">
<p id="büchertitel">Bücher</p>
<h1 id="searchResult_heading">Bücher</h1>
<div id="searchResult_container">
<?php
$sql = '';
@ -26,7 +27,11 @@
GROUP_CONCAT(DISTINCT k.Name SEPARATOR ', ') AS 'Kategorie',
b.ISBN, b.Klappentext AS 'Inhalt', sp.Bezeichnung AS 'Sprache',
GROUP_CONCAT(DISTINCT st.Text SEPARATOR ', ') AS 'Stichwort',
IF(b.Anzahl!=0, 'Verfügbar', CONCAT('Verfügbar ab: ', 'Test!'))
IF(b.Anzahl!=0, 'Verfügbar', CONCAT('Verfügbar ab: ',
(SELECT DATE_FORMAT(DATE_ADD(ab.Enddatum, INTERVAL 1 DAY)
,'%d.%m.%Y') FROM `ausgeliehenes_buch` AS ab
WHERE ab.BuchID = b.BuchID
ORDER BY ab.Reserviert ASC, ab.Enddatum ASC LIMIT 1)))
AS 'Verfügbarkeit' FROM `buch` AS b
INNER JOIN `buch_verfasst_von_autor` AS bvva
ON b.BuchID = bvva.BuchID
@ -53,6 +58,7 @@
$result = mysqli_query($connection, $sql);
$counter = 0;
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$bookID = $row['BuchID'];
@ -128,6 +134,7 @@
?>
</div>
</div>