95 lines
2.3 KiB
PHP
Raw Normal View History

2020-10-05 10:53:05 +02:00
<!--
@ Author: JunkJumper
@ Link: https://github.com/JunkJumper
@ Copyright: Creative Common 4.0 (CC BY 4.0)
@ Create Time: 05-10-2020 10:29:32
@ Modified by: JunkJumper
@ Modified time: 05-10-2020 10:51:10
-->
2020-10-05 10:39:22 +02:00
<html>
<style>
2020-10-05 10:53:05 +02:00
p {
font-weight: bold;
color: grey;
text-align: center;
}
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
p#rep {
font-weight: bold;
color: red;
text-align: center;
}
</style>
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
<link href="./anim.css" rel="stylesheet">
<?php
$checkN = false;
$checkE = false;
$tab = $_REQUEST['formulaire'];
2020-10-05 11:03:33 +02:00
$tVins = $tab['vins'];
2020-10-05 10:53:05 +02:00
$vins = "";
$denom = "Damoixe";
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
if ($tab['genre'] == "Homme") {
$denom = "Monsieur";
} else if ($tab['genre'] == "Femme") {
$denom = "Madamme";
}
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
if (preg_match("#[a-zA-Z_]#", $tab['nom']) && preg_match("#[a-zA-Z_]#", $tab['prenom'])) {
$checkN = true;
}
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
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;
}
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
if ($checkN) {
foreach ($tab['vins'] as $key => $valeur) {
2020-10-05 11:03:33 +02:00
$vins = $vins. $valeur . ', ';
2020-10-05 10:39:22 +02:00
}
2020-10-05 10:53:05 +02:00
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>';
2020-10-05 10:39:22 +02:00
}
2020-10-05 10:53:05 +02:00
if ($vins != null) {
2020-10-05 11:03:33 +02:00
$v = substr($vins, 0, strlen($vins) - 2);
echo '<p>Votre sélection de vin(s) est : ' . $v . '</p>';
2020-10-05 10:39:22 +02:00
}
2020-10-05 10:53:05 +02:00
} else {
echo '<p>Votre nom ou prénom n\'est pas correct.</p>';
}
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
if ($checkE) {
echo '<p>Votre mail est : ' . $tab['email'] . '</p>';
} else {
echo '<p>Votre email n\'est pas correct.</p>';
}
2020-10-05 10:39:22 +02:00
2020-10-05 10:53:05 +02:00
if ($checkE && $checkN) {
echo '<p id="rep">Bonjour ' . $denom . ' ' . $tab['nom'] . ' ' . $tab['prenom'] . ',<br />
2020-10-05 11:03:33 +02:00
Nous vous remercions davoir commandé ' . $v . '<br />'
2020-10-05 10:53:05 +02:00
. 'Un mail de conformation vous a été envoyé à ladresse : ' . $tab['email'] . '</p>';
2020-10-19 10:35:29 +02:00
} else {
echo "NIKTONKU";
2020-10-05 10:53:05 +02:00
}
2020-10-05 10:39:22 +02:00
?>
2020-10-05 10:53:05 +02:00
<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() {
2020-10-05 10:39:22 +02:00
window.location.href = "./index.php";
}, 5000);
2020-10-05 10:53:05 +02:00
</script>
2020-10-05 10:39:22 +02:00
</html>