Jasmin Weise 2023-06-03 20:37:12 +02:00
commit d90ec603d9
30 changed files with 196 additions and 177 deletions

View File

@ -25,7 +25,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">
@ -125,7 +125,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -26,7 +26,7 @@ session_destroy();
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -26,7 +26,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">
@ -124,7 +124,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -23,7 +23,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">
@ -104,7 +104,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -1,146 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta lang="de"/>
<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" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Candle Bibliothek | Bücher</title>
<link rel="icon" href="pictures/candle.png">
</head>
<body>
<header>
<h1 class="kopf" >
<br><br>
Bibliothek <a href="index.html" id="bildID"> <img id="CandleID" src="pictures/candle.png" alt="Bild von einer Kerze"
width="200" height="192"/> </a>
<br><br> Candle
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">
<input class="suchleiste" type="search" placeholder="Suche..." >
<button type="submit" id="buttonID" class="searchButton"><i class="fa fa-search"></i> </button>
</form>
<a id="erweitertesuche" href="erweitertesuche.html">Erweiterte Suche</a>
<a href="anmelden.php" id="warenKorbID"> <img id="shoppingCard" src="pictures/einkaufswagen.png" alt="Bild von einem Wagen"
width="50" height="50"/> </a>
</div>
</header>
<div class="containerofbuecher">
<p id="büchertitel">Bücher</p>
<!--First Item-->
<div id="firstItem" class="items" >
<a href="percy.html"><img src="pictures/percy_jackson_diebe_im_olymp.jpg" width="125" height="200"/></a>
<h3 class="headerinItem">
<a href="percy.html">Percy Jackson: Diebe im Olymp</a>
</h3>
<p class="discinItem">Verfasser: Rick Riordan <br>
Erscheinungsjahr: 2010 <br>
Verlag: Carlsen <br>
Kategorie: Fantasy
</p>
<a class="greenbutton" href="percy.html">Verfügbar</a>
<a class="binPicture" href=""><img src="pictures/shopping_cart.png" width="25" height="25"></a>
<hr style="width: 92%;">
</div>
<!--Second Item-->
<div id="secondItem" class="items">
<a href="dalmatians.html"><img src="pictures/the_hundred_and_one_dalmatians.jpg" width="125" height="200"/></a>
<h3 class="headerinItem">
<a href="dalmatians.html">The Hundred and One Dalmatians</a>
</h3>
<p class="discinItem">Verfasser: Dodie Smith <br>
Erscheinungsjahr: 2015 <br>
Verlag: Farshore <br>
Kategorie: Kinderbuch
</p>
<a class="redbutton" href="dalmatians.html">Verfügbar ab: 30.04.2023</a>
<a class="binPicture" href="anmelden.php"><img src="pictures/shopping_cart.png" width="25" height="25"></a>
<hr style="width:92%;">
</div>
<!--Third Item-->
<div id="thirdItem" class="items">
<a href="penguin.html"><img src="pictures/penguin_highway.jpg" width="125" height="200"/></a>
<h3 class="headerinItem">
<a href="penguin.html">Penguin Highway</a>
</h3>
<p class="discinItem">Verfasser: Tomihiko Morimi <br>
Erscheinungsjahr: 2019 <br>
Verlag: Yen On <br>
Kategorie: Fantasy
</p>
<a class="greenbutton" href="penguin.html">Verfügbar</a>
<a class="binPicture" href=""><img src="pictures/shopping_cart.png" width="25" height="25"></a>
<hr style="width: 92%;">
</div>
<!--fourth Item-->
<div id="fourthItem" class="items" >
<a href="es.html"><img src="pictures/es.jpg" width="125" height="200"/></a>
<h3 class="headerinItem">
<a href="es.html">Es</a>
</h3>
<p class="discinItem">Verfasser: Stephen King <br>
Erscheinungsjahr: 2011 <br>
Verlag: Heyne <br>
Kategorie: Horror
</p>
<a class="redbutton" href="es.html" >Verfügbar ab: 10.05.2023</a>
<a class="binPicture" href=""><img src="pictures/shopping_cart.png" width="25" height="25"></a>
</div>
</div>
<!--Link JS file-->
<script src="burgerIcon.js"></script>
<script>
var widthissue = false;
window.addEventListener("resize", function(event) {
if(window.innerWidth > 800 && widthissue) {
widthissue = false
unset()
}
else if(window.innerWidth < 800) widthissue = true;
})
</script>
<!--Burger-->
<nav id="activeid" class="active">
<div class="navLinks">
<input class="nav-toggleclass"id="nav-toggle" type="checkbox" onclick="openNav()";>
<label for="nav-toggle" class="icon-burger" >
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</label>
</div>
</nav>
<footer class="fuss" >
<div>
<a id="impressum" href="impressum.html">Impressum</a>
<a id="kontakt" href="kontakt.html">Kontakt</a>
<a id="datenschutz" href="datenschutz.html">Datenschutz</a>
</div>
</footer>
</body>
</html>

165
buecher.php 100644
View File

@ -0,0 +1,165 @@
<!DOCTYPE html>
<html>
<head>
<meta lang="de"/>
<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 | Bücher</title>
<link rel="icon" href="pictures/candle.png">
<script src="notwendiges_laden.js" defer></script>
</head>
<body>
<header id="header"></header>
<div class="containerofbuecher">
<p id="büchertitel">Bücher</p>
<?php
$sql = '';
// SQL-Befehl zusammenstellen
$sql = "SELECT b.BuchID, b.Titel, b.Erscheinungsjahr, b.Bild,
b.Verlag,
GROUP_CONCAT(DISTINCT CONCAT(a.VorName, ' ', a.NachName)
SEPARATOR ', ') AS 'Autor',
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!'))
AS 'Verfügbarkeit' FROM `buch` AS b
INNER JOIN `buch_verfasst_von_autor` AS bvva
ON b.BuchID = bvva.BuchID
INNER JOIN `autor` AS a ON bvva.AutorNr = a.AutorNr
INNER JOIN `buch_hat_kategorie` AS bhk ON bhk.BuchID = b.BuchID
INNER JOIN `kategorie` AS k ON k.KategorieID = bhk.KategorieID
INNER JOIN `sprache` AS sp ON sp.SprachenID = b.SprachenID
INNER JOIN `buch_hat_stichwort` AS bhs ON bhs.BuchID = b.BuchID
INNER JOIN `stichwort` AS st ON st.StichwortID = bhs.StichwortID
GROUP BY b.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());
}
$result = mysqli_query($connection, $sql);
$counter = 0;
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$bookID = $row['BuchID'];
$bookCover = $row['Bild'];
$bookTitle = $row['Titel'];
$bookPublishingYear = $row['Erscheinungsjahr'];
$bookPublisher = $row['Verlag'];
$bookAuthor = $row['Autor'];
$bookCategory = $row['Kategorie'];
$bookAvailability = $row['Verfügbarkeit'];
if ($counter != 0) {
echo "<div class='divider'></div>";
}
// TODO: OnClick auslagern.
echo "<div id='book_container$bookID' class='book_container'
onclick='open_bookDetails(this.id)'>
<div class='bookCover_container'>
<img class='bookCover' src='pictures/$bookCover'
alt='Kein Bild vorhanden'>
</div>
<div class='bookDetails_container'>
<h2 class='bookTitle'>$bookTitle</h2>
<div class='bookDetails'>
<p class='author'>Verfasser: $bookAuthor</p>
<p class='publishing_year'>
Erscheinungsjahr: $bookPublishingYear</p>
<p class='publisher'>
Verlag: $bookPublisher</p>
<p class='category'>
Kategorie: $bookCategory</p>
</div>
<div class='available_container'>
<p id='available_$bookID' class='available'>
$bookAvailability</p>
<!--TODO: Auslagern-->
<script type='text/javascript'
language='JavaScript'>
(function() {
var currentElement = document.
getElementById('available_$bookID');
var parentDiv =
currentElement.parentElement;
if (currentElement.innerHTML.trim()
== 'Verfügbar') {
parentDiv.style.backgroundColor
= '#70AD47';
}
else {
parentDiv.style.backgroundColor
= '#F34343';
}
})();
</script>
</div>
</div>
<div class='shoppingCart_container'>
<div class='shoppingCart'></div>
</div>
</div>";
$counter++;
}
} else {
echo "Keine Ergebnisse.";
}
if (!$result) {
die("Ungültige SQL-Abfrage: " . mysqli_connect_error());
}
mysqli_close($connection);
?>
</div>
<!--Link JS file-->
<script src="burgerIcon.js"></script>
<script>
var widthissue = false;
window.addEventListener("resize", function(event) {
if(window.innerWidth > 800 && widthissue) {
widthissue = false
unset()
}
else if(window.innerWidth < 800) widthissue = true;
})
</script>
<!--Burger-->
<nav id="activeid" class="active">
<div class="navLinks">
<input class="nav-toggleclass"id="nav-toggle" type="checkbox" onclick="openNav()";>
<label for="nav-toggle" class="icon-burger" >
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</label>
</div>
</nav>
<footer id="footer" class="fuss" ></footer>
</body>
</html>

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -23,7 +23,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -10,7 +10,7 @@ document.getElementById("header").innerHTML = `
</h1>
<div>
<a id='uberuns' href='uberuns.html'>Über Uns</a>
<a id='buecher' href='buecher.html'>Bücher</a>
<a id='buecher' href='buecher.php'>Bücher</a>
<a id='meinebuecher' href='anmelden_meinebuecher.php'>
Meine Bücher</a>
<a id='abmelden' href='abmelden.php'>Abmelden</a>

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -22,7 +22,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -25,7 +25,7 @@ session_start();
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -94,7 +94,7 @@ if(isset($_POST['Registrieren'])){
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -19,7 +19,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -20,7 +20,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">

View File

@ -29,7 +29,7 @@
</h1>
<div>
<a id="uberuns" href="uberuns.html">Über Uns</a>
<a id="buecher" href="buecher.html">Bücher</a>
<a id="buecher" href="buecher.php">Bücher</a>
<a id="meinebuecher" href="meinebuecher.php">Meine Bücher</a>
<a id="abmelden" href="abmelden.php">Abmelden</a>
<form action="">