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())); +} + +?> + + + + + Accueil + + + + + + + + + + +
+ + prepare($sqlQuery); + $oeuvresStatement->execute(); + $oeuvres = $oeuvresStatement->fetchAll(); + + foreach ($oeuvres as $oeuvre) { + ?> +
+

+

+

+

+

+ +
+ + +
+ +

INDISPONIBLE

+ + +
+ + +
+ +
+ + + +
+ + + \ No newline at end of file diff --git a/accueilStyle.css b/accueilStyle.css new file mode 100644 index 0000000..cbf6b65 --- /dev/null +++ b/accueilStyle.css @@ -0,0 +1,125 @@ +* { + font-family: 'Roboto Slab', serif; + box-sizing: border-box; + margin: 0; + +} + +body { + margin: 0; + background-image: url(./background.jpg); +} + +nav { + height: 150px; + width: 100%; + background-color: rgba(55, 26, 27, 0.9); + display: flex; + align-items: center; + margin-bottom: 20px; + justify-content: space-around; + gap: 15px; +} + +.logo { + object-fit: contain; + height: 120px; + margin-left: 40px; +} + +.user { + font-size: 1.5rem; + font-weight: 500; + color: #fff; +} + +.panier { + font-size: 1.5rem; + color: rgba(138, 147, 97, 0.9); + text-decoration: underline; +} +.panier:hover { + color: rgba(138, 147, 97, 1); + cursor: pointer; +} + +.admin { + font-size: 1.5rem; + color: red; + text-decoration: underline; +} + +.grid { + display: flex; + gap: 15px; + flex-wrap: wrap; + justify-content: center; +} + +.oeuvre { + height: 300px; + width: 300px; + background-color: rgba(55, 26, 27, 0.9); + 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; + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: center; + text-align: center; + position: relative; + +} + +.titre{ + font-size: 2rem; + font-weight: 600; + color: #ADD8E6; +} + +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; +} + +.delete{ + width: 40px; + height: 40px; + background-color: red; + color: black; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + right: -15px; + top: -15px; + opacity: 0.75; +} +.delete:hover{ + background-color: red; + opacity: 1; +} + +p { + font-size: 1.4rem; + font-weight: 500; + color: #fff; +} + +@media screen and (max-width: 613px) { + nav { + height: 200px; + flex-direction: column; + } +} \ No newline at end of file diff --git a/ajout.php b/ajout.php new file mode 100644 index 0000000..28beaad --- /dev/null +++ b/ajout.php @@ -0,0 +1,121 @@ +getMessage()); +} + +$query = "SELECT * FROM Artiste"; +$pdoStat = $mysqlClient->prepare($query); +$executeIsOk = $pdoStat->execute() +or die(print_r($mysqlClient->errorInfo())); +$artistes = $pdoStat->fetchAll(); + +$query2 = "SELECT * FROM Technique"; +$pdoStat = $mysqlClient->prepare($query2); +$executeIsOk = $pdoStat->execute() +or die(print_r($mysqlClient->errorInfo())); +$techniques = $pdoStat->fetchAll(); + +if (isset($_POST["titre"]) && isset($_POST["annee"])) { + $query3 = "INSERT INTO Oeuvre (titre, anneeCreation, artisteId, techniqueId) VALUES (:titre,:anneeCreation, :artisteId, :techniqueId)"; + $pdoStat = $mysqlClient->prepare($query3); + $executeIsOk = $pdoStat->execute([ + 'titre' => $_POST["titre"], + 'anneeCreation' => $_POST["annee"], + 'artisteId' => $_POST["idArtiste"], + 'techniqueId' => $_POST["idTechnique"] + ]) + or die(print_r($mysqlClient->errorInfo())); + header("Location: ajoutConfirmationOeuvre.php"); +} + +if (isset($_POST["nom"]) && isset($_POST["prenom"]) && isset($_POST["date"])) { + $query3 = "INSERT INTO Artiste (nomArtiste, prenomArtiste, dateNaissanceArtiste) VALUES (:nomArtiste,:prenomArtiste, :dateNaissanceArtiste)"; + $pdoStat = $mysqlClient->prepare($query3); + $executeIsOk = $pdoStat->execute([ + 'nomArtiste' => $_POST["nom"], + 'prenomArtiste' => $_POST["prenom"], + 'dateNaissanceArtiste' => $_POST["date"] + ]) + or die(print_r($mysqlClient->errorInfo())); + header("Location: ajoutConfirmationArtiste.php"); +} + +?> + + + + + + + Création de compte + + + + + + + + + +
+
+
NOUVELLE OEUVRE
+ La fille à la perle +
+ + + + + +
+
+ + +
+
NOUVEL ARTISTE
+ Portrait de Rembrandt +
+ + + + +
+
+
+ + + + + diff --git a/ajoutConfirmationArtiste.php b/ajoutConfirmationArtiste.php new file mode 100644 index 0000000..2e2a85d --- /dev/null +++ b/ajoutConfirmationArtiste.php @@ -0,0 +1,42 @@ + + + + + + + + + Confirmation + + + + + + + + + +
+

Le nouvel Artiste

+

à bien été créée !

+ + + +
+ + + \ No newline at end of file diff --git a/ajoutConfirmationOeuvre.php b/ajoutConfirmationOeuvre.php new file mode 100644 index 0000000..1f52d4a --- /dev/null +++ b/ajoutConfirmationOeuvre.php @@ -0,0 +1,42 @@ + + + + + + + + + Confirmation + + + + + + + + + +
+

La nouvelle oeuvre

+

à bien été créée !

+ + + +
+ + + \ No newline at end of file diff --git a/ajoutConfirmationStyle.css b/ajoutConfirmationStyle.css new file mode 100644 index 0000000..4da86d2 --- /dev/null +++ b/ajoutConfirmationStyle.css @@ -0,0 +1,118 @@ +* { + box-sizing: border-box; + margin: 0; + font-family: 'Roboto Slab', serif; +} + +body { + height: 100vh; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + background-image: url(./background.jpg); + gap : 15px +} + +nav { + height: 150px; + width: 100%; + background-color: rgba(55, 26, 27, 0.9); + display: flex; + align-items: center; + margin-bottom: 20px; + justify-content: space-around; + gap: 15px; +} + +.panier { + font-size: 1.5rem; + color: rgba(138, 147, 97, 0.9); + text-decoration: underline; +} +.panier:hover { + color: rgba(138, 147, 97, 1); + cursor: pointer; +} + +.admin { + font-size: 1.5rem; + color: red; + text-decoration: underline; +} + + +.user { + font-size: 1.5rem; + font-weight: 500; + color: white; +} + +button { + width: 200px; + height: 35px; + border-radius: 5px; + border: none; + background-color: rgba(138, 147, 97, 0.9); + font-weight: 600; +} + +button:hover { + background-color: rgba(138, 147, 97, 1); + cursor: pointer; +} + + +.card { + height: 200px; + width: 400px; + 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; + text-align: center; +} + +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; +} + +p { + font-weight: 700; + font-size: 1.5rem; + color: white; +} + +.alert{ + color: red; +} + +@media screen and (max-width: 613px) { + nav { + height: 200px; + flex-direction: column; + } +} + +@media screen and (max-width: 380px) { + .card { + width: 100%; + text-align: center; + } +} \ No newline at end of file diff --git a/ajoutStyle.css b/ajoutStyle.css new file mode 100644 index 0000000..f2648e7 --- /dev/null +++ b/ajoutStyle.css @@ -0,0 +1,150 @@ +* { + box-sizing: border-box; + margin: 0; + font-family: 'Roboto Slab', serif; +} + +body { + height: 100vh; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + background-image: url(./background.jpg); + gap: 15px; +} + +nav { + height: 150px; + width: 100%; + background-color: rgba(55, 26, 27, 0.9); + display: flex; + align-items: center; + margin-bottom: 20px; + justify-content: space-around; + gap: 15px; +} + +.panier { + font-size: 1.5rem; + color: rgba(138, 147, 97, 0.9); + text-decoration: underline; +} +.panier:hover { + color: rgba(138, 147, 97, 1); + cursor: pointer; +} + +.admin { + font-size: 1.5rem; + color: red; + text-decoration: underline; +} + +.user { + font-size: 1.5rem; + font-weight: 500; + color: white; +} + +.cardFlex{ + display: flex; + justify-content: space-between; + gap: 40px; +} + +.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; + gap: 5px; + 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: white; +} + +form { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + gap: 16px +} + +input, select{ + 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; +} + +.rembrandt { + object-fit: contain; + max-width: 65%; + border-radius: 5px; +} + +.rembrandt { + object-fit: contain; + max-width: 70%; + border-radius: 5px; +} + +@media screen and (max-width: 380px) { + .card { + width: 100%; + text-align: center; + } +} + +@media screen and (max-width: 767px) { + .cardFlex { + flex-direction: column; + } + nav { + height: 200px; + flex-direction: column; + } + body{ + height: auto; + } +} \ No newline at end of file diff --git a/alert.php b/alert.php new file mode 100644 index 0000000..14d7b11 --- /dev/null +++ b/alert.php @@ -0,0 +1,42 @@ + + + + + + + + + Confirmation + + + + + + + + + +
+

Vous ne pouvez pas emprunter

+

plus de 3 oeuvres !

+ + + +
+ + + \ No newline at end of file diff --git a/artRental.png b/artRental.png new file mode 100644 index 0000000..5289d5b Binary files /dev/null and b/artRental.png differ diff --git a/background.jpg b/background.jpg new file mode 100644 index 0000000..d431bed Binary files /dev/null and b/background.jpg differ diff --git a/baseDeDonnee.sql b/baseDeDonnee.sql new file mode 100644 index 0000000..f0cc197 --- /dev/null +++ b/baseDeDonnee.sql @@ -0,0 +1,134 @@ +#------------------------------------------------------------ +# Database: OeuvreDArt +#------------------------------------------------------------ + +DROP DATABASE IF EXISTS OeuvreDArt; +CREATE DATABASE OeuvreDArt; +USE OeuvreDArt; + +#------------------------------------------------------------ +# Table: Artiste +#------------------------------------------------------------ + +CREATE TABLE Artiste( + idArtiste INT AUTO_INCREMENT NOT NULL, + nomArtiste VARCHAR (100) NOT NULL, + prenomArtiste VARCHAR (100), + dateNaissanceArtiste DATE, + CONSTRAINT Artiste_PK PRIMARY KEY (idArtiste) +)ENGINE=InnoDB; + +INSERT INTO Artiste (nomArtiste, prenomArtiste, dateNaissanceArtiste) VALUES +('Van Gogh', 'Vincent', 18590330), +('De Vinci', 'Léonard', 14520415), +('Rembrandt', '', 16060715), +('Hugo', 'Victor', 18850522), +('Dali', 'Salvador', 19040511), +('Picasso', 'Pablo', 19730408), +('Monnet', 'Claude', 18401114), +('David', 'Jaques-louis', 17480830), +('Delacroix','Eugene',17980426), +('Buhot','Felix',18470709), +('Michel-Ange','', 14750306), +('Gian Lorenzo', 'Bernini', 15981207), +('Antokolski', 'Mark', 18401021), +('Ai Weiwei', 'Ai', 19570828), +('Othoniel', 'Jean-Michel', 19640127), +('Kandinsky', 'Vassily', 18661204); + + + + +#------------------------------------------------------------ +# Table: Technique +#------------------------------------------------------------ + +CREATE TABLE Technique( + idTechnique INT AUTO_INCREMENT NOT NULL, + nomTechnique VARCHAR (30) NOT NULL, + CONSTRAINT Technique_PK PRIMARY KEY (idTechnique) +)ENGINE=InnoDB; + +INSERT INTO Technique (nomTechnique) VALUES +('Huile sur toile'), +('Dessin à la plume'), +('Mine de plomb'), +('Encre brune'), +('Eau forte'), +('Sculpture classique'), +('Gravure'), +('Sculpture moderne'), +('Photographie'), +('Acrylique'); + +#------------------------------------------------------------ +# Table: Film +#------------------------------------------------------------ + +CREATE TABLE Oeuvre( + idOeuvre INT AUTO_INCREMENT NOT NULL, + titre VARCHAR (100) NOT NULL, + anneeCreation SMALLINT (10), + artisteId INT NOT NULL, + techniqueId INT NOT NULL, + disponible BOOLEAN DEFAULT true, + CONSTRAINT Oeuvre_PK PRIMARY KEY (idOeuvre), + CONSTRAINT Oeuvre_Artiste_FK FOREIGN KEY (artisteId) REFERENCES Artiste(idArtiste), + CONSTRAINT Oeuvre_Technique_FK FOREIGN KEY (techniqueId) REFERENCES Technique(idTechnique) +)ENGINE=InnoDB; + + + + + + +#------------------------------------------------------------ +# Table: Utilisateur +#------------------------------------------------------------ + +CREATE TABLE Utilisateur( + idUtilisateur INT AUTO_INCREMENT NOT NULL, + nom VARCHAR (100) NOT NULL, + prenom VARCHAR (100) NOT NULL, + dateNaissance DATE NOT NULL, + email VARCHAR (100) NOT NULL, + motDePasse VARCHAR (100) NOT NULL, + CONSTRAINT Utilisateur_PK PRIMARY KEY (idUtilisateur) +)ENGINE=InnoDB; + +INSERT INTO Utilisateur (nom, prenom, dateNaissance, email, motDePasse) VALUES + ('admin', 'admin',19921206,'admin@artrental.com', 'azerty'); + +#------------------------------------------------------------ +# Table: Emprunt +#------------------------------------------------------------ + +CREATE TABLE Emprunt( + utilisateurId INT NOT NULL, + oeuvreId INT NOT NULL, + dateEmprunt DATETIME NOT NULL, + dateRetour DATETIME, + CONSTRAINT Emprunt_PK PRIMARY KEY (utilisateurId,oeuvreId, dateEmprunt), + CONSTRAINT Emprunt_Utilisateur_FK FOREIGN KEY (utilisateurId) REFERENCES Utilisateur(idUtilisateur), + CONSTRAINT Emprunt_Oeuvre_FK FOREIGN KEY (oeuvreId) REFERENCES Oeuvre(idOeuvre) +)ENGINE=InnoDB; + +INSERT INTO Oeuvre (titre, anneeCreation, artisteId, techniqueId) VALUES + ('L\'homme à la pipe',1889, 1, 5), + ('Guernica', 1937, 6, 1), + ('Ma destinée', 1857, 4, 2), + ('La joconde', 1506, 2, 1), + ('La nuit étoilée', 1889,1, 1), + ('La gare saint-lazare', 1877, 7, 1), + ('La persistance de la mémoire', 1931, 5, 1), + ('Les sabines', 1799, 8, 1), + ('La promenade', 1875, 7, 1), + ('La ronde de nuit', 1642, 3, 1), + ('La liberté guidant le peuple', 1830, 9, 1 ), + ('Les demoiselles D\'avignon', 1907, 6, 1 ), + ('Environs de Gravesend', 1885,10, 5 ), + ('Meduse',1638, 12, 6), + ('Sirène',1900, 13, 6), + ('Forever bicycles', 2011, 14, 8), + ('Segment bleu', 1921,16,1), + ('La jeune fille devant un miroir', 1932, 6, 1); diff --git a/compte.php b/compte.php new file mode 100644 index 0000000..d15a087 --- /dev/null +++ b/compte.php @@ -0,0 +1,72 @@ +getMessage()); + } + $email = $_POST["email"]; + $query = 'SELECT * FROM utilisateur WHERE email = :email'; + $pdoStat = $db->prepare($query); + $pdoStat->execute(['email' => $email]); + $user = $pdoStat->fetch(); + + if ($user) { + $erreur = "L'e-mail existe déjà !"; + } else { + $query = 'INSERT INTO utilisateur(nom, prenom, dateNaissance, email, motDePasse) values ( :nom, :prenom, :dateNaissance, :email, :motDePasse)'; + $pdoStat = $db->prepare($query); + $executeIsOk = $pdoStat->execute([ + 'nom' => $_POST["name"], + 'prenom' => $_POST["prenom"], + 'dateNaissance' => $_POST["date"], + 'email' => $_POST["email"], + 'motDePasse' => $_POST["password"] + ]) or die(print_r($db->errorInfo())); + $client = $pdoStat->fetch(); + header("Location: confirmation.php"); + exit(); + } +} +?> + + + + + + + Création de compte + + + + + + + + +
+
INSCRIPTION
+ Portrait de Rembrandt +
+ + + + + + + +
+ + + +
+ + + + + + diff --git a/compteStyle.css b/compteStyle.css new file mode 100644 index 0000000..9e7b568 --- /dev/null +++ b/compteStyle.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; + gap: 5px; + 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; +} + +.rembrandt { + object-fit: contain; + max-width: 65%; + border-radius: 5px; +} \ No newline at end of file diff --git a/confirmation.php b/confirmation.php new file mode 100644 index 0000000..e391ef5 --- /dev/null +++ b/confirmation.php @@ -0,0 +1,27 @@ + + + + + + + Confirmation + + + + + + + + + +
+

Bravo !

+

Votre compte a bien été créé !

+ + + +
+ + + \ No newline at end of file diff --git a/confirmationstyle.css b/confirmationstyle.css new file mode 100644 index 0000000..d2ad727 --- /dev/null +++ b/confirmationstyle.css @@ -0,0 +1,49 @@ +* { + 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: 200px; + width: 400px; + 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; + color: white; +} + +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; +} + +p { + font-weight: 700; + font-size: 1.5rem; +} \ No newline at end of file diff --git a/deconnexion.php b/deconnexion.php new file mode 100644 index 0000000..c110925 --- /dev/null +++ b/deconnexion.php @@ -0,0 +1,5 @@ +getMessage()); +} + +if(isset($_POST["retour"])) { + $query2 = "UPDATE oeuvre SET disponible = 1 WHERE idOeuvre = :idOeuvre"; + $pdoStat = $mysqlClient->prepare($query2); + $executeIsOk = $pdoStat->execute([ + 'idOeuvre' => $_POST["retour"] + ]) or die(print_r($mysqlClient->errorInfo())); + $client = $pdoStat->fetch(); + + $query3 = "UPDATE emprunt SET dateRetour = :dateRetour WHERE oeuvreId = :idOeuvre AND dateRetour IS NULL"; + $pdoStat = $mysqlClient->prepare($query3); + $executeIsOk = $pdoStat->execute([ + 'dateRetour' => $retour, + 'idOeuvre' => $_POST["retour"] + ]) or die(print_r($mysqlClient->errorInfo())); + $client = $pdoStat->fetch(); +} +?> + + + + + + + Emprunt + + + + + + + + + + +
+ + prepare($sqlQuery); + $oeuvresStatement->execute([ + 'utilisateurId' => $_SESSION["idUser"], + ]); + $oeuvres = $oeuvresStatement->fetchAll(); + + foreach ($oeuvres as $oeuvre) { + ?> +
+

+

+

+

+

+
+ + +
+
+ + + +
+ + + + + diff --git a/empruntConfirmation.php b/empruntConfirmation.php new file mode 100644 index 0000000..34384ca --- /dev/null +++ b/empruntConfirmation.php @@ -0,0 +1,58 @@ +getMessage()); +} + +$sqlQuery = 'SELECT titre FROM oeuvre WHERE idOeuvre = :idOeuvre'; +$oeuvresStatement = $mysqlClient->prepare($sqlQuery); +$oeuvresStatement->execute([ + 'idOeuvre' => $_GET["idOeuvre"], + ]); +$oeuvres = $oeuvresStatement->fetchAll(); +?> + + + + + + + + Confirmation + + + + + + + + + +
+

Votre emprunt de

+

+

à bien été effectué !

+ + + +
+ + + diff --git a/empruntConfirmationStyle.css b/empruntConfirmationStyle.css new file mode 100644 index 0000000..3db6a7e --- /dev/null +++ b/empruntConfirmationStyle.css @@ -0,0 +1,114 @@ +* { + box-sizing: border-box; + margin: 0; + font-family: 'Roboto Slab', serif; +} + +body { + height: 100vh; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + background-image: url(./background.jpg); + gap : 15px +} + +nav { + height: 150px; + width: 100%; + background-color: rgba(55, 26, 27, 0.9); + display: flex; + align-items: center; + margin-bottom: 20px; + justify-content: space-around; + gap: 15px; +} + +.panier { + font-size: 1.5rem; + color: rgba(138, 147, 97, 0.9); + text-decoration: underline; +} +.panier:hover { + color: rgba(138, 147, 97, 1); + cursor: pointer; +} + +.admin { + font-size: 1.5rem; + color: red; + text-decoration: underline; +} + +.user { + font-size: 1.5rem; + font-weight: 500; + color: white; +} + +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; +} + +.card { + height: 200px; + width: 400px; + 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; + text-align: center; +} + +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; +} + +p { + font-weight: 700; + font-size: 1.5rem; + color: white; +} + +@media screen and (max-width: 613px) { + nav { + height: 200px; + flex-direction: column; + } +} + +@media screen and (max-width: 380px) { + .card { + width: 100%; + text-align: center; + } +} \ No newline at end of file diff --git a/empruntStyle.css b/empruntStyle.css new file mode 100644 index 0000000..49b54f5 --- /dev/null +++ b/empruntStyle.css @@ -0,0 +1,107 @@ +* { + font-family: 'Roboto Slab', serif; + box-sizing: border-box; + margin: 0; + +} + +body { + margin: 0; + background-image: url(./background.jpg); +} + +nav { + height: 150px; + width: 100%; + background-color: rgba(55, 26, 27, 0.9); + display: flex; + align-items: center; + margin-bottom: 20px; + justify-content: space-around; + gap: 15px; +} + +.logo { + object-fit: contain; + height: 120px; + margin-left: 40px; +} + +.user { + font-size: 1.5rem; + font-weight: 500; + color: white; +} + +.panier { + font-size: 1.5rem; + color: rgba(138, 147, 97, 0.9); + text-decoration: underline; +} + +.panier:hover { + color: rgba(138, 147, 97, 1); + cursor: pointer; +} + +.admin { + font-size: 1.5rem; + color: red; + text-decoration: underline; +} + +.grid { + display: flex; + gap: 15px; + flex-wrap: wrap; + justify-content: center; +} + +.titre { + font-size: 2rem; + font-weight: 600; + color: #ADD8E6; +} + +.oeuvre { + height: 300px; + width: 300px; + background-color: rgba(55, 26, 27, 0.9); + 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; + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: center; + text-align: center; + +} + +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; +} + +p { + font-size: 1.4rem; + font-weight: 500; + color: #fff; +} + +@media screen and (max-width: 613px) { + nav { + height: 200px; + flex-direction: column; + } +} \ No newline at end of file diff --git a/filleALaPerle.jpg b/filleALaPerle.jpg new file mode 100644 index 0000000..a001acd Binary files /dev/null and b/filleALaPerle.jpg differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..050363a --- /dev/null +++ b/index.php @@ -0,0 +1,65 @@ + +getMessage()); + } + $requete = 'Select * from Utilisateur where email ="'. $_POST['email']. '";'; + $resultat = $db->query($requete) or die(print_r($db->errorInfo())); + + foreach ($resultat as $row) { + if ($row["motDePasse"] == $_POST["password"] && $_POST["email"] == $row["email"]){ + $_SESSION["loggedUser"] = $_POST["email"]; + $_SESSION["idUser"] = $row["idUtilisateur"]; + $_SESSION["prenom"] = $row["prenom"]; + + header("Location: accueil.php"); + } + } +} + +?> + + + + + + + + Art Rental + + + + + + + + + +
+
ART RENTAL
+ La Joconde +
+
+ + + + +
+ +
+
+ + + diff --git a/joconde.jpg b/joconde.jpg new file mode 100644 index 0000000..859fb26 Binary files /dev/null and b/joconde.jpg differ diff --git a/rembrandt.jpg b/rembrandt.jpg new file mode 100644 index 0000000..ee5cdfb Binary files /dev/null and b/rembrandt.jpg differ