diff --git a/IndexStyle.css b/IndexStyle.css new file mode 100644 index 0000000..25a4f6e --- /dev/null +++ b/IndexStyle.css @@ -0,0 +1,83 @@ +* { + box-sizing: border-box; + margin: 0; + font-family: 'Roboto Slab', serif; +} + +body { + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background-image: url(./background.jpg); +} + + +.card { + height: 600px; + width: 340px; + background-color: rgba(55, 26, 27, 0.9); + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 32px; + border-radius: 15px; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; +} + +.title{ +font-weight: 800; +font-size: 1.5rem; +color: #fff; +} + +form { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + gap: 16px +} + +input { + width: 100%; + height: 24px; + border-radius: 5px; + border: solid black 1px; + background-color: #8a9361; + color: black; + +} + +::placeholder{ + color:darkslategray; +} + +button { + width: 200px; + height: 35px; + border-radius: 5px; + border: none; + background-color: rgba(138, 147, 97, 0.9); + font-weight: 900; + font-size: 1.1rem; + color: black; +} + +button:hover{ + background-color: rgba(138, 147, 97, 1); + cursor: pointer; +} + +.spaceButton { + display: flex; + flex-direction: column; + gap: 8px; +} + +.joconde { + object-fit: contain; + max-width: 70%; + border-radius: 5px; +} \ No newline at end of file diff --git a/accueil.php b/accueil.php new file mode 100644 index 0000000..f8a8c93 --- /dev/null +++ b/accueil.php @@ -0,0 +1,134 @@ +getMessage()); +} + +$query5 = "SELECT * FROM Emprunt WHERE `utilisateurId` = :idUser AND `dateRetour` IS NULL;"; +$pdoStat = $mysqlClient->prepare($query5); +$executeIsOk = $pdoStat->execute([ + 'idUser' => $_SESSION['idUser'] +]) or die(print_r($mysqlClient->errorInfo())); +$alert = $pdoStat->fetchAll(); + + +if (isset($_POST["emprunt"])) { + if (count($alert) >= 3) { + header("location: alert.php"); + } else { + $query2 = "UPDATE oeuvre SET disponible = 0 WHERE idOeuvre = :idOeuvre"; + $pdoStat = $mysqlClient->prepare($query2); + $executeIsOk = $pdoStat->execute([ + 'idOeuvre' => $_POST["emprunt"] + ]) or die(print_r($mysqlClient->errorInfo())); + + $query3 = 'INSERT INTO emprunt(utilisateurId, oeuvreId, dateEmprunt) values ( :utilisateurId, :oeuvreId, :dateEmprunt)'; + $pdoStat = $mysqlClient->prepare($query3); + $executeIsOk = $pdoStat->execute([ + 'utilisateurId' => $_SESSION["idUser"], + 'oeuvreId' => $_POST["emprunt"], + 'dateEmprunt' => $dateEmprunt + ]) or die(print_r($mysqlClient->errorInfo())); + header("Location: empruntConfirmation.php?idOeuvre=" . $_POST["emprunt"]); + exit(); + } +} + +if (isset($_POST["oeuvreDelete"])) { + $query5 = "DELETE FROM emprunt WHERE oeuvreId = :idOeuvre;"; + $pdoStat = $mysqlClient->prepare($query5); + $executeIsOk = $pdoStat->execute([ + 'idOeuvre' => $_POST["oeuvreDelete"] + ]) or die(print_r($mysqlClient->errorInfo())); + + $query6 = "DELETE FROM oeuvre WHERE idOeuvre = :idOeuvre"; + $pdoStat2 = $mysqlClient->prepare($query6); + $executeIsOk2 = $pdoStat2->execute([ + "idOeuvre" => $_POST["oeuvreDelete"] + ]) or die(print_r($mysqlClient->errorInfo())); +} + +?> + +
+ + ++ + + + + +
INDISPONIBLE
+ + + + +