Anmeldung
parent
e00f680053
commit
cd2debae98
|
@ -20,8 +20,18 @@ if(isset($_POST['submit'])){
|
|||
$karteexistiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid'");
|
||||
$zeile = mysqli_fetch_array($karteexistiert);
|
||||
if($row['COUNT(*)'] > 0){
|
||||
|
||||
$_SESSION['eingeloggt'] = 1;
|
||||
if(!isset($_SESSION['userID'])){
|
||||
$sql = $db_link->prepare("SELECT benutzer.BenutzerID FROM benutzer WHERE benutzer.KartenID = ?;");
|
||||
$sql->bind_param("i", $kartenid);
|
||||
$sql->execute();
|
||||
$result = $sql->get_result();
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$_SESSION['userID'] = $row['BenutzerID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
header("Location: meinebuecher.php");
|
||||
}else if($zeile['COUNT(*)'] > 0){
|
||||
header("Location: passwort_stimmt_nicht.php");
|
||||
|
|
|
@ -22,6 +22,17 @@ if(isset($_POST['submit'])){
|
|||
if($row['COUNT(*)'] > 0){
|
||||
|
||||
$_SESSION['eingeloggt'] = 1;
|
||||
if(!isset($_SESSION['userID'])){
|
||||
$sql = $db_link->prepare("SELECT benutzer.BenutzerID FROM benutzer WHERE benutzer.KartenID = ?;");
|
||||
$sql->bind_param("i", $kartenid);
|
||||
$sql->execute();
|
||||
$result = $sql->get_result();
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$_SESSION['userID'] = $row['BenutzerID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
header("Location: reservierung.php");
|
||||
}else if($zeile['COUNT(*)'] > 0){
|
||||
header("Location: passwort_stimmt_nicht.php");
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
GROUP BY ab.AusleihID;");
|
||||
|
||||
$sql->bind_param("i", $BenutzerID);
|
||||
$BenutzerID = 5;
|
||||
$BenutzerID = $_SESSION['userID'];
|
||||
$sql->execute();
|
||||
$result = $sql->get_result();
|
||||
$connection = $db_link;
|
||||
|
|
|
@ -59,7 +59,7 @@ TODO:
|
|||
|
||||
// Benutzer ID abholen
|
||||
//$userID = ?;
|
||||
$userID = 5;
|
||||
$userID = $_SESSION['userID'];
|
||||
|
||||
// Überprüfen, ob Bücher im Warenkorb liegen
|
||||
if(isset($_SESSION['cart']) && !empty($_SESSION['cart'])) {
|
||||
|
|
|
@ -194,33 +194,6 @@ if (!$result) {
|
|||
}
|
||||
?>
|
||||
|
||||
<!--<div class="hauptcontainer" id="verlängerung">-->
|
||||
<!-- <h1 id="verlängerungH1">Buch erfolgreich verlängert</h1>-->
|
||||
<!-- <div id="verlängerungContent">-->
|
||||
<!-- <p id="möchten-sie">Das Buch wurde verlängert.<br>Neues Rückgabedatum: 10.05.2023</p>-->
|
||||
<!---->
|
||||
<!---->
|
||||
<!-- <div class="item" id="verlängerungItem">-->
|
||||
<!-- <img src="pictures/es.jpg" alt="Es" height="200">-->
|
||||
<!-- <div class="beschreibung">-->
|
||||
<!-- <h2>Es</h2>-->
|
||||
<!-- <h3>von Stephen King</h3>-->
|
||||
<!-- <div class="b2 green">Rückgabe am: 10.05.2023</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!---->
|
||||
<!-- <div id="verlängerungButtonContainer">-->
|
||||
<!-- <a id = "verlängerungErfolgreichButton1" href="meinebuecher.php">Zurück zu Meine Bücher</a>-->
|
||||
<!-- </div>-->
|
||||
<!---->
|
||||
<!-- </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>
|
||||
|
|
Loading…
Reference in New Issue