Modification de la page de contact

- Ajout du traitement de la requête POST
- Ajout d'icône pour l'adresse mail et l'adresse postale
This commit is contained in:
Lyanis SOUIDI 2023-01-17 23:05:24 +01:00
parent c15793f395
commit 57282ec47b
2 changed files with 25 additions and 14 deletions

View File

@ -39,10 +39,14 @@ input[type=text], input[type=email], select, textarea {
content: "☎️ ";
}
#contact a[href^="mailto:"]::before {
#contact-info a[href^="mailto:"]::before {
content: "✉️ ";
}
#contact-info a[href*="google.com/maps"]::before {
content: "📌 ";
}
.contact {
display: grid;
gap: 25px;

View File

@ -30,8 +30,12 @@ function contact_form($profile, $subject) : string {
<p><a href="https://www.google.com/maps/place/8FW49MXP%2B3P" target="_blank">Route forestière Hurtault, 77300 Fontainebleau</a></p>
<p><a href="tel:+33160746800">+33 1 60 74 68 00</a></p>
<p><a href="mailto:elitesolar.contact77@gmail.com">elitesolar.contact77@gmail.com</a></p>
</div>
<form class="left" method="post">
</div>';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$text .= "<p>Votre demande a bien été prise en compte, nous y répondrons dans les meilleurs délais.</p>";
} else {
$text .= '<form class="left" method="post">
<h3>Formulaire de contact</h3>
<div class="field">
<label for="name">Nom</label><br>
@ -43,41 +47,44 @@ function contact_form($profile, $subject) : string {
<input type="email" id="email" name="email" placeholder="Votre adresse électronique.." required><br>
</div>';
if ($profile == 'business') {
$text .= '<input type="radio" name="type" value="business" hidden checked>
if ($profile == 'business') {
$text .= '<input type="radio" name="type" value="business" hidden checked>
<div class="field"">
<label for="entreprise">Entreprise</label><br>
<input type="text" id="entreprise" name="entreprise" placeholder="Nom de votre entreprise.." required><br>
</div>';
} else echo '<input type="radio" name="type" value="consumer" hidden checked>';
} else echo '<input type="radio" name="type" value="consumer" hidden checked>';
if ($subject == 'integration') {
$text .= '<input type="text" name="subject" value="integration" hidden>';
} else $text .= '<label for="subject">Sujet</label><br>
if ($subject == 'integration') {
$text .= '<input type="text" name="subject" value="integration" hidden>';
} else $text .= '<label for="subject">Sujet</label><br>
<input type="text" id="subject" name="subject" placeholder="Le sujet de votre demande.." required><br>';
$text .= '<div class="field">
$text .= '<div class="field">
<label for="message">Message</label><br>
<textarea id="message" name="message" placeholder="Votre message.."></textarea><br>
</div>
<input class="button" type="submit" value="Envoyer">
</form>
</div>';
';
}
$text .= '</div>';
return $text;
}
function select_subject($profile) : string {
$text = ' et votre demande concerne';
if (isset($_GET["subject"]) && $_GET["subject"] == 'warranty') {
$text .= " <a href='" . contact_query(array("subject" => "")) . "'>la garantie Solar Glass</a>.</h2>";
$text .= " <a href='" . contact_query(array("subject" => "")) . "'>la garantie Solar Glass</a></h2>";
$text .= "<p>La <a href='https://www.service-public.fr/particuliers/vosdroits/F11094' target='_blank'>garantie légale de conformité</a>
est assuré par le fabricant intégrant la technologie Solar Glass dans ses appareils, en cas de problème concernant Solar Glass sur votre appareil,
merci donc de <b>contacter directement le fabricant de votre appareil</b>.</p>";
} elseif (isset($_GET["subject"]) && $_GET["subject"] == 'integration') {
$text .= " <a href='" . contact_query(array("subject" => "")) . "'>l'intégration de Solar Glass dans vos produits</a>.</h2>";
$text .= " <a href='" . contact_query(array("subject" => "")) . "'>l'intégration de Solar Glass dans vos produits</a></h2>";
$text .= contact_form($profile, $_GET["subject"]);
} elseif (isset($_GET["subject"]) && $_GET["subject"] == 'other') {
$text .= " <a href='" . contact_query(array("subject" => "")) . "'>autre chose</a>.</h2>";
$text .= " <a href='" . contact_query(array("subject" => "")) . "'>autre chose</a></h2>";
$text .= contact_form($profile, $_GET["subject"]);
} else {
$text .= "...</h2>";