-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
define('TARIF', 20); | ||
define('REMISE', 5); | ||
// création de la constante 'TARIF' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
include('_config.php'); | ||
?> | ||
|
||
<!DOCTYPE html> | ||
<html lang="fr"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Commander</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div> | ||
<form action="traitement.php" method="post" > | ||
<!-- post: permet d'envoyer des variables qui ne se passe pas dans l'URL--> | ||
<label for="quantite">Quantité: </label> | ||
<select name="quantite" id="quantite"> <!-- menu déroulant --> | ||
<!-- id = mettre en relation avec le label | ||
name = permet la récupération la quantité chosis par l'utilisateur --> | ||
<option value="1">1</option> | ||
<option value="2">2</option> | ||
<option value="3">3</option> | ||
<option value="4">4</option> | ||
<option value="5">5</option> | ||
</select> | ||
<p>Tarif: <?= TARIF; ?> €</p> | ||
<!-- echo + constante definev(^) --> | ||
<p>En commandant maintenant, vous aurez droit à une remise immediate de <?= REMISE; ?>€.</p> | ||
<p> | ||
<input type="submit" value="Commander"> | ||
</p> | ||
|
||
<img src="img/macaron.webp" alt=""> | ||
</form> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
body{ | ||
margin: 0; | ||
font-family: sans-serif; | ||
font-size: 1.3rem; | ||
background-image: url(./img/chocolat-bg.jpeg); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
background-position: center; | ||
background-attachment: fixed; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
div { | ||
max-width: 400px; | ||
background-color: rgba(255,255,255,0.8); | ||
box-shadow: 3px 3px 5px #555; | ||
padding: 20px; | ||
text-align: center; | ||
border-radius: 10px; | ||
} | ||
|
||
select { | ||
font-size: 1.3rem; | ||
padding: 3px 20px; | ||
border-radius: 50px; | ||
border: 2px solid orangered; | ||
outline: none; | ||
/* liserai autour du selecteur */ | ||
background: none; | ||
} | ||
|
||
input[type="submit"] { | ||
padding: 10px 40px; | ||
border-radius: 50px; | ||
border: none; | ||
background-color: orangered; | ||
color: white; | ||
font-size: 1.4rem; | ||
cursor: pointer; | ||
box-shadow: 3px 3px 5px #333; | ||
outline: none; | ||
transition: .5s; | ||
} | ||
|
||
input[type="submit"]:hover{ | ||
background-color: orange; | ||
color: black; | ||
transform: translateY(-7px); | ||
} | ||
|
||
img { | ||
width: 100%; | ||
border-radius: 50px; | ||
/* elle va occuper 100% de la boite div */ | ||
} | ||
|
||
h1{ | ||
font-size: 1.5rem; | ||
color: orangered; | ||
} | ||
|
||
ul{ | ||
text-align: left; | ||
} | ||
|
||
.orangered{ | ||
color: orangered; | ||
font-weight: 700; | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
include('_config.php'); | ||
// Calcul du Total à payer | ||
$total = $_POST['quantite'] * TARIF; | ||
$newTotal = $total - REMISE; | ||
?> | ||
|
||
|
||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Traitement</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>Merci pour votre commande</h1> | ||
<ul> | ||
<li>Nombre de boites commandées: <?= $_POST['quantite']; ?> </li> | ||
<!-- tu reprend du form car method POST donc "$_POST" et ca va prendre le "quantite" du select --> | ||
<li>Tarif unitaire: <?= TARIF; ?> €</li> | ||
<li>Total à payer: <?= $total; ?> €</li> | ||
<li>Remise: <?= REMISE; ?>€</li> | ||
<li><strong>nouveau Total:</strong> <span class="orangered"> <?= $newTotal; ?> €</span></li> | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |