Skip to content

Commit

Permalink
Site Simul8 version finale
Browse files Browse the repository at this point in the history
  • Loading branch information
ylaghdas committed Jan 13, 2025
1 parent 822952f commit 8a27294
Show file tree
Hide file tree
Showing 676 changed files with 150,839 additions and 608 deletions.
15 changes: 12 additions & 3 deletions site/FormConnexion.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
<meta charset="UTF-8">
<title>Formulaire de Connexion</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<body>
<div class="login-container">


<div class="login-container" style="position: relative; width: 100%; height: 100vh;">
<div class="top-left-link">
<a href="accueil.php" class="back-to-home">
← Retourner à l'accueil
</a>
</div>
<div class="login-box">
<h2>Connexion</h2>
<form action="TraitConnexion.php" method="POST">
Expand All @@ -31,11 +37,14 @@
<input type="checkbox" id="souvenir" name="souvenir"> Se souvenir de moi
</label>
</div>
<div class="form-group">

<div class="form-group form-group-flex">
<input type="submit" name="connec" value="Se connecter" class="btn-login">
<div class="form-to-register">Vous n'avez pas de compte ? Créez en un en cliquant <a href="inscription.php">ici</a> </div>
</div>
</form>
</div>
</div>
</body>
</html>

8 changes: 7 additions & 1 deletion site/TraitConnexion.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


//Vérification des droits du compte
$adminCheck = $conn->prepare("SELECT estAdmin FROM Comptes WHERE identifiant = :login");
$adminCheck = $conn->prepare("SELECT estAdmin, estInactif FROM Comptes WHERE identifiant = :login");
$adminCheck->execute(['login' => htmlentities($login)]);

if ($adminCheck->rowCount() >= 1) {
Expand All @@ -46,6 +46,12 @@
$_SESSION['Sadmin'] = true;
}
}

if ($verif['estInactif'] == 1) {
session_destroy();
header("Location: FormConnexion.php?msgErreur=Votre compte est inactif, veuillez contacter un administrateur");
exit();
}
header("Location: accueil.php");
exit();
} else {
Expand Down
2 changes: 1 addition & 1 deletion site/TraitInscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

try{
//Insertion du compte
$insert=$conn->prepare("INSERT INTO Comptes (nom, prenom, email, identifiant, mdp, estAdmin, numeroTelephone) VALUES (:nom, :prenom, :email, :identifiant, :mdp, false, :numeroTelephone)");
$insert=$conn->prepare("INSERT INTO Comptes (nom, prenom, email, identifiant, mdp, estAdmin, numeroTelephone,estInactif , pointF) VALUES (:nom, :prenom, :email, :identifiant, :mdp, false, :numeroTelephone,0,0)");
$insert->execute(['nom'=>$nom, 'prenom'=>$prenom, 'email'=>$email, 'identifiant'=>$login, 'mdp'=>$mdp, 'numeroTelephone'=>$numero]);


Expand Down
64 changes: 64 additions & 0 deletions site/about-us.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php require_once('./includes/head.php'); ?>
<?php require_once('./includes/header.php'); ?>

<main class="about-us">
<div class="container mt-5">
<h1>À Propos de Simul8</h1>
<br>
<br>
<h2>Notre Histoire</h2>
<p>Simul8 est une entreprise spécialisée dans la production de maquettes à taille réelle, non fonctionnelles, mais extrêmement réalistes.</p>
<p>On s’adresse principalement à des particuliers souhaitant posséder des objets rares ou coûteux sous forme de répliques abordables, ainsi qu’à des professionnels du cinéma ou du théâtre recherchant des décors à moindre coût.</p>
<p>Notre slogan : "Fake it till you make it".</p>
<br><br>
<h2>Origines et Mission</h2>
<p>Fondée en 1999 par Matthias Lionardo, Simul8 est née d’une passion pour le bricolage et la création d’objets inaccessibles. L’entreprise, initialement basée dans le sud de la France, aspire aujourd’hui à se développer via sa nouvelle boutique en ligne.</p>
<br><br>
<h2>Équipe Dirigeante</h2>
<div class="team">
<div class="team-member">
<h3>Matthias Lionardo</h3>
<p>PDG et fondateur</p>
</div>
<div class="team-member">
<h3>Lohan Serre</h3>
<p>Directeur Général</p>
</div>
<div class="team-member">
<h3>Chefai Tristan</h3>
<p>Directeur Marketing et Artistique</p>
</div>
<div class="team-member">
<h3>Ethan Besse</h3>
<p>Directeur Logistique</p>
</div>
</div>
<br><br>
<h2>Site développé par :</h2>
<div class="team">
<div class="team-member">
<h3>Loïc Phrakousonh</h3>
<p>Chef d'équipe</p>
</div>
<div class="team-member">
<h3>Thomas Aussenac</h3>
<p>Expert BD</p>
</div>
<div class="team-member">
<h3>Joan Casas</h3>
<p>Développeur</p>
</div>
<div class="team-member">
<h3>Sidney Richards</h3>
<p>Développeur</p>
</div>
<div class="team-member">
<h3>Yassine Laghdas</h3>
<p>Designer web, Product owner</p>
</div>
</div>
<br><br>
</div>
</main>

<?php require_once('./includes/footer.php'); ?>
129 changes: 121 additions & 8 deletions site/accueil.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,126 @@
<?php require_once('./includes/head.php'); ?>

<?php require_once('./includes/header.php'); ?>

<!-- Section principale -->
<main class="hero">
<h1>FAKE IT TILL YOU MAKE IT !</h1>
<a href="#" class="btn-boutique">BOUTIQUE</a>
</main>


<!-- Section principale -->
<body>
<main class="hero" style="width: 100%; height: 100vh;">
<div id="particles-js"></div>
<h1>FAKE IT TILL YOU MAKE IT !</h1>
<a href="produits.php" class="btn-boutique">BOUTIQUE</a>
</main>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script>
particlesJS("particles-js", {
"particles": {
"number": {
"value": 100,
"density": {
"enable": true,
"value_area": 900
}
},
"color": {
"value": "#d00809"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 2,
"random": true,
"anim": {
"enable": false,
"speed": 50,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#d00809",
"opacity": 0.5,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
});
</script>
</body>

<?php require_once('./includes/footer.php'); ?>
92 changes: 92 additions & 0 deletions site/ajouterAdresse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php
require_once './includes/head.php';

include "connect.inc.php";

// Vérifiez si l'utilisateur est connecté
if (!isset($_SESSION['Suser'])) {
header('Location: FormConnexion.php');
exit();
}

// Vérifiez si le formulaire a été soumis
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$idCompte = $_SESSION['Suser'];
$pays = htmlentities($_POST['pays']);
$ville = htmlentities($_POST['ville']);
$codePostal = htmlentities($_POST['codePostal']);
$adresse = htmlentities($_POST['adresse']);
$numeroBatiment = !empty($_POST['numeroBatiment']) ? htmlentities($_POST['numeroBatiment']) : null;
$numeroAppartement = !empty($_POST['numeroAppartement']) ? htmlentities($_POST['numeroAppartement']) : null;

try {
// Insérer la nouvelle adresse dans la table Adresses
$stmtInsertAdresse = $conn->prepare("
INSERT INTO Adresses (pays, ville, codePostal, adresse, numeroBatiment, numeroAppartement)
VALUES (:pays, :ville, :codePostal, :adresse, :numeroBatiment, :numeroAppartement)
");
$stmtInsertAdresse->execute([
':pays' => $pays,
':ville' => $ville,
':codePostal' => $codePostal,
':adresse' => $adresse,
':numeroBatiment' => $numeroBatiment,
':numeroAppartement' => $numeroAppartement
]);

// Récupérer l'ID de l'adresse insérée
$idAdresse = $conn->lastInsertId();

// Associer l'adresse au compte
$stmtAssocierAdresse = $conn->prepare("
INSERT INTO Resider (idCompte, idAdresse)
VALUES (:idCompte, :idAdresse)
");
$stmtAssocierAdresse->execute([
':idCompte' => $idCompte,
':idAdresse' => $idAdresse
]);

// Redirection avec message de succès
$_SESSION['message'] = "Votre adresse a été ajoutée avec succès.";
header('Location: paiement.php');
exit();
} catch (Exception $e) {
echo "Erreur : " . $e->getMessage();
}
}
require_once './includes/header.php';
?>

<main class="container mt-5">
<h1>Ajouter une Adresse</h1>
<form action="ajouterAdresse.php" method="POST">
<div class="form-group">
<label for="pays" style="color: black;">Pays</label>
<input type="text" class="form-control" id="pays" name="pays" required>
</div>
<div class="form-group">
<label for="ville" style="color: black;">Ville</label>
<input type="text" class="form-control" id="ville" name="ville" required>
</div>
<div class="form-group">
<label for="codePostal" style="color: black;">Code Postal</label>
<input type="text" class="form-control" id="codePostal" name="codePostal" required pattern="\d{5}" title="Veuillez entrer un code postal valide (5 chiffres)">
</div>
<div class="form-group">
<label for="adresse" style="color: black;">Adresse</label>
<input type="text" class="form-control" id="adresse" name="adresse" required>
</div>
<div class="form-group">
<label for="numeroBatiment" style="color: black;">Numéro de Bâtiment (facultatif)</label>
<input type="text" class="form-control" id="numeroBatiment" name="numeroBatiment">
</div>
<div class="form-group">
<label for="numeroAppartement" style="color: black;">Numéro d'Appartement (facultatif)</label>
<input type="text" class="form-control" id="numeroAppartement" name="numeroAppartement">
</div>
<button type="submit" class="btn btn-primary mt-3">Ajouter l'Adresse</button>
</form>
</main>

<?php require_once './includes/footer.php'; ?>
26 changes: 26 additions & 0 deletions site/ajouterAvis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
include "connect.inc.php";

session_start();

if (!isset($_SESSION['Suser'])) {
header('Location: FormConnexion.php');
exit();
}

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['note'], $_POST['idProduit'])) {
$idCompte = htmlentities($_SESSION['Suser']);
$idProduit = (int)htmlentities($_POST['idProduit']);
$note = (int)htmlentities($_POST['note']);
$texteAvis = isset($_POST['texteAvis']) ? htmlentities($_POST['texteAvis']) : "";


$stmt = $conn->prepare("INSERT INTO Avis (idCompte, idProduit, note, texteAvis) VALUES (:idCompte, :idProduit, :note, :texteAvis)");
$stmt->execute(['idCompte' => $idCompte, 'idProduit' => $idProduit, 'note' => $note, 'texteAvis' => $texteAvis]);
header("Location: detailProduit.php?idProduit={$idProduit}");
exit();

} else {
header('Location: index.php');
exit();
}
Loading

0 comments on commit 8a27294

Please sign in to comment.