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> <body>
<header id="header"></header> <header id="header"></header>
<div class="hauptcontainer"> <div class="hauptcontainer">
<p id="büchertitel">Bücher</p> <h1 id="searchResult_heading">Bücher</h1>
<div id="searchResult_container">
<?php <?php
$sql = ''; $sql = '';
@ -26,7 +27,11 @@
GROUP_CONCAT(DISTINCT k.Name SEPARATOR ', ') AS 'Kategorie', GROUP_CONCAT(DISTINCT k.Name SEPARATOR ', ') AS 'Kategorie',
b.ISBN, b.Klappentext AS 'Inhalt', sp.Bezeichnung AS 'Sprache', b.ISBN, b.Klappentext AS 'Inhalt', sp.Bezeichnung AS 'Sprache',
GROUP_CONCAT(DISTINCT st.Text SEPARATOR ', ') AS 'Stichwort', 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 AS 'Verfügbarkeit' FROM `buch` AS b
INNER JOIN `buch_verfasst_von_autor` AS bvva INNER JOIN `buch_verfasst_von_autor` AS bvva
ON b.BuchID = bvva.BuchID ON b.BuchID = bvva.BuchID
@ -53,6 +58,7 @@
$result = mysqli_query($connection, $sql); $result = mysqli_query($connection, $sql);
$counter = 0; $counter = 0;
if (mysqli_num_rows($result) > 0) { if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) { while($row = mysqli_fetch_assoc($result)) {
$bookID = $row['BuchID']; $bookID = $row['BuchID'];
@ -128,6 +134,7 @@
?> ?>
</div> </div>
</div>