From 3423eb4a111b148ba089fc6604dfea26138d96ff Mon Sep 17 00:00:00 2001 From: AntoineReibel <124444455+AntoineReibel@users.noreply.github.com> Date: Fri, 28 Apr 2023 18:58:15 +0200 Subject: [PATCH] Add files via upload --- IndexStyle.css | 83 +++++++++++++++++++ accueil.php | 134 +++++++++++++++++++++++++++++++ accueilStyle.css | 125 +++++++++++++++++++++++++++++ ajout.php | 121 ++++++++++++++++++++++++++++ ajoutConfirmationArtiste.php | 42 ++++++++++ ajoutConfirmationOeuvre.php | 42 ++++++++++ ajoutConfirmationStyle.css | 118 +++++++++++++++++++++++++++ ajoutStyle.css | 150 +++++++++++++++++++++++++++++++++++ alert.php | 42 ++++++++++ artRental.png | Bin 0 -> 35370 bytes background.jpg | Bin 0 -> 183122 bytes baseDeDonnee.sql | 134 +++++++++++++++++++++++++++++++ compte.php | 72 +++++++++++++++++ compteStyle.css | 83 +++++++++++++++++++ confirmation.php | 27 +++++++ confirmationstyle.css | 49 ++++++++++++ deconnexion.php | 5 ++ emprunt.php | 102 ++++++++++++++++++++++++ empruntConfirmation.php | 58 ++++++++++++++ empruntConfirmationStyle.css | 114 ++++++++++++++++++++++++++ empruntStyle.css | 107 +++++++++++++++++++++++++ filleALaPerle.jpg | Bin 0 -> 35827 bytes index.php | 65 +++++++++++++++ joconde.jpg | Bin 0 -> 1141550 bytes rembrandt.jpg | Bin 0 -> 2479186 bytes 25 files changed, 1673 insertions(+) create mode 100644 IndexStyle.css create mode 100644 accueil.php create mode 100644 accueilStyle.css create mode 100644 ajout.php create mode 100644 ajoutConfirmationArtiste.php create mode 100644 ajoutConfirmationOeuvre.php create mode 100644 ajoutConfirmationStyle.css create mode 100644 ajoutStyle.css create mode 100644 alert.php create mode 100644 artRental.png create mode 100644 background.jpg create mode 100644 baseDeDonnee.sql create mode 100644 compte.php create mode 100644 compteStyle.css create mode 100644 confirmation.php create mode 100644 confirmationstyle.css create mode 100644 deconnexion.php create mode 100644 emprunt.php create mode 100644 empruntConfirmation.php create mode 100644 empruntConfirmationStyle.css create mode 100644 empruntStyle.css create mode 100644 filleALaPerle.jpg create mode 100644 index.php create mode 100644 joconde.jpg create mode 100644 rembrandt.jpg 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
+ + + + +