"exo 1 tp3 ok"

This commit is contained in:
JunkJumper 2020-10-05 10:39:22 +02:00
parent ce809b7466
commit 1a50cabfb4
5 changed files with 252 additions and 0 deletions

BIN
2020-2021/TD3/TP3-eno.pdf Normal file

Binary file not shown.

80
2020-2021/TD3/anim.css Executable file
View File

@ -0,0 +1,80 @@
.radial-timer {
overflow: hidden;
height: 144px;
width: 144px;
position: relative;
}
.radial-timer .radial-timer-half {
height: 144px;
width: 72px;
border-radius: 72px 0 0 72px;
background: red;
position: absolute;
}
.radial-timer .radial-timer-half:nth-of-type(2) {
z-index: 99999999;
-webkit-transform-origin: center right;
-webkit-transform: rotate(180deg);
}
.radial-timer .radial-timer-half:before {
content: "";
position: absolute;
top: 9px;
left: 9px;
height: 126px;
width: 63px;
border-radius: 67.5px 0 0 67.5px;
background: rgb(255, 255, 255);
}
.radial-timer .radial-timer-half:after {
content: "";
position: absolute;
background: rgb(255, 255, 255);
height: 288px;
width: 216px;
left: -144px;
top: -72px;
-webkit-transform-origin: center right;
}
.radial-timer.s-animate {
-webkit-transform-origin: center right;
}
.radial-timer.s-animate .radial-timer-half:nth-of-type(1):after {
-webkit-animation: rotateLeftMask 5s infinite linear;
}
.radial-timer.s-animate .radial-timer-half:nth-of-type(2):after {
-webkit-animation: rotateRightMask 5s infinite linear;
}
@-webkit-keyframes rotateLeftMask {
0% {
-webkit-transform: rotate(0deg);
}
50% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(180deg);
}
}
@-webkit-keyframes rotateRightMask {
0% {
-webkit-transform: rotate(0deg);
}
50% {
-webkit-transform: rotate(180deg);
visibility: hidden;
}
100% {
-webkit-transform: rotate(180deg);
visibility: hidden;
}
}

76
2020-2021/TD3/check.php Normal file
View File

@ -0,0 +1,76 @@
<html>
<style>
p {
font-weight: bold;
color : grey;
text-align : center;
}
p#rep {
font-weight: bold;
color : red;
text-align : center;
}
</style>
<link href="./anim.css" rel="stylesheet">
<?php
$checkN = false;
$checkE = false;
$tab = $_REQUEST['formulaire'];
$vins = "";
$denom = "";
if($tab['genre'] == "Homme") {
$denom = "Monsieur";
} else if ($tab['genre'] == "Femme") {
$denom = "Madamme";
} else {
$denom = "Damoixe";
}
if(preg_match("#[a-zA-Z_]#", $tab['nom']) && preg_match("#[a-zA-Z_]#",$tab['prenom'])) {
$checkN = true;
}
if(preg_match("#@#", $tab['email']) && preg_match("#.#",$tab['email']) && preg_match("#[a-zA-Z]{2}@#", $tab['email']) && preg_match("#@[a-zA-Z]{2}.#",$tab['email'])) {
$checkE = true;
}
if($checkN) {
foreach ($tab['vins'] as $key => $valeur) {
$vins = $valeur .'&nbsp,&nbsp';
}
echo '<p>Votre nom est : ' .$tab['nom'] .'</p>';
echo '<p>Votre prenom est : ' .$tab['prenom'] .'</p>';
if ($tab['sexe'] != null) {echo '<p>Votre genre est : ' .$tab['genre'] .'</p>';}
if ($vins != null) {echo '<p>Votre sélection de vin(s) est : ' .$vins .'</p>';}
} else {
echo '<p>Votre nom ou prénom n\'est pas correct.</p>';
}
if($checkE) {
echo '<p>Votre mail est : ' .$tab['email'] .'</p>';
} else {
echo '<p>Votre email n\'est pas correct.</p>';
}
if($checkE && $checkN) {
echo '<p id="rep">Bonjour ' .$denom .' ' .$tab['nom'] .' ' .$tab['prenom'] .',<br />
Nous vous remercions davoir commandé ' .$vins .'<br />'
.'Un mail de conformation vous a été envoyé à ladresse : ' .$tab['email'] .'</p>';
}
?>
<br /><br /><br /><br /> <center><div class="radial-timer s-animate"> <div class="radial-timer-half"></div> <div class="radial-timer-half"></div></center>
<script>
setTimeout(function () {
window.location.href = "./index.php";
}, 5000);
</script>
</html>

81
2020-2021/TD3/index.php Executable file
View File

@ -0,0 +1,81 @@
<!DOCTYPE html>
<?php
/**
* @Author: JunkJumper
* @Link: https://github.com/JunkJumper
* @Copyright: Creative Common 4.0 (CC BY 4.0)
* @Create Time: 05-10-2020 10:26
* @Description: M314 - TD3
*/
?>
<html>
<head>
<title>M314 - TD1</title>
<link rel="icon" type="image/png" href="https://www.junkjumper-projects.com/umming_lines_paint.png" />
<h1>M314 - TD3 : Manipulation des boucles, expressions conditionnelles et introduction aux tables globales</h1>
<meta charset="UTF-8" />
</head>
<body>
<p>Les champs marqués d'une <strong class="mandatory">*</strong> sont obligatoires</p>
<form action="./check.php" method="post" name="formulaire">
<strong class="mandatory">*</strong>Nom : <input type="text" name="formulaire[nom]" required><br />
<strong class="mandatory">*</strong>Prenom : <input type="text" name="formulaire[prenom]" required /><br />
<strong class="mandatory">*</strong>Email : <input type="email" name="formulaire[email]"required /><br />
Genre : <input type="radio" name="formulaire[genre]" value="Homme" />Homme
<input type="radio" name="formulaire[genre]" value="Femme" />Femme
<input type="radio" name="formulaire[genre]" value="Agenre" />Agenre
<input type="radio" name="formulaire[genre]" value="Demi-genre" />Demi-genre
<input type="radio" name="formulaire[genre]" value="Poly-genre" />Poly-genre
<input type="radio" name="formulaire[genre]" value="Genderfluid" />Genderfluid
<br />
Vin(s) Choisi(s) :
<input type="checkbox" name ="formulaire[vins][st_emilion]" value="St_Emilion" />St Emilion
<input type="checkbox" name ="formulaire[vins][chateau_hermitage]" value="Chateau_Hermitage" />Château lHermitage
<input type="checkbox" name ="formulaire[vins][entre_les_deux_mers]" value="Entre_les_Deux_Mers" />Entre les Deux Mers
<input type="checkbox" name ="formulaire[vins][fitou]" value="Fitou" />Fitou
<input type="checkbox" name ="formulaire[vins][bandol]" value="Bandol" />Bandol
<input type="checkbox" name ="formulaire[vins][cote_de_provence]" value="Cote_de_Provence" />Côte de Provence<br />
<input type="submit" value="Envoyer" />
</form>
<a href="..">
<button class="button blue">Retour à la page précédente</button>
</a>
</body>
<style>
h1, h2, h3, h4, h5, h6 {
color: #4c6e8a;
}
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.blue {
background-color: #4c6e8a;
}
b {
color: red;
}
strong.mandatory {
color : red;
}
</style>
</html>

15
2020-2021/TD3/post.php Normal file
View File

@ -0,0 +1,15 @@
<html>
<link href="./anim.css" rel="stylesheet">
<?php
print_r($_REQUEST);
?>
<br /><br /><br /><br /> <center><div class="radial-timer s-animate"> <div class="radial-timer-half"></div> <div class="radial-timer-half"></div></center>
<script>
setTimeout(function () {
window.location.href = "./index.php";
}, 5000);
</script>
</html>