2023-01-17 22:21:28 +01:00
< ? php
function contact_query ( $query_params ) : string {
$url = parse_url ( $_SERVER [ " REQUEST_SCHEME " ] . " :// " . $_SERVER [ " HTTP_HOST " ] . ( $_SERVER [ " SERVER_PORT " ] != " 80 " || " 443 " ? " : " . $_SERVER [ " SERVER_PORT " ] : " " ) . $_SERVER [ " REQUEST_URI " ]);
isset ( $url [ 'query' ]) ? parse_str ( $url [ 'query' ], $params ) : $params = array ();
$params = array_merge ( $params , $query_params );
if ( isset ( $params [ 'profile' ]) && $params [ 'profile' ] == 'business' ) {
if ( isset ( $params [ 'subject' ]) && $params [ 'subject' ] == 'warranty' ) {
unset ( $params [ 'subject' ]);
}
}
if ( isset ( $params [ 'profile' ]) && $params [ 'profile' ] == 'consumer' ) {
if ( isset ( $params [ 'subject' ]) && $params [ 'subject' ] == 'integration' ) {
unset ( $params [ 'subject' ]);
}
}
$url [ 'query' ] = http_build_query ( $params );
return $url [ 'scheme' ] . '://' . $url [ 'host' ] . $url [ 'path' ] . '?' . $url [ 'query' ];
}
function contact_form ( $profile , $subject ) : string {
$text = ' </ div >
< div class = " contact " >
< div class = " right " id = " contact-info " >
< h3 > Elite Solar </ h3 >
< 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 >
2023-01-17 23:05:24 +01:00
</ 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 " >
2023-01-17 22:21:28 +01:00
< h3 > Formulaire de contact </ h3 >
< div class = " field " >
< label for = " name " > Nom </ label >< br >
< input type = " text " id = " name " name = " name " placeholder = " Votre nom.. " required >< br >
</ div >
< div class = " field " >
< label for = " email " > Adresse électronique </ label >< br >
< input type = " email " id = " email " name = " email " placeholder = " Votre adresse électronique.. " required >< br >
</ div > ' ;
2023-01-17 23:05:24 +01:00
if ( $profile == 'business' ) {
$text .= ' < input type = " radio " name = " type " value = " business " hidden checked >
2023-01-17 22:21:28 +01:00
< div class = " field " " >
< label for = " entreprise " > Entreprise </ label >< br >
< input type = " text " id = " entreprise " name = " entreprise " placeholder = " Nom de votre entreprise.. " required >< br >
</ div > ' ;
2023-01-17 23:05:24 +01:00
} else echo '<input type="radio" name="type" value="consumer" hidden checked>' ;
2023-01-17 22:21:28 +01:00
2023-01-17 23:05:24 +01:00
if ( $subject == 'integration' ) {
$text .= '<input type="text" name="subject" value="integration" hidden>' ;
} else $text .= ' < label for = " subject " > Sujet </ label >< br >
2023-01-17 22:21:28 +01:00
< input type = " text " id = " subject " name = " subject " placeholder = " Le sujet de votre demande.. " required >< br > ' ;
2023-01-17 23:05:24 +01:00
$text .= ' < div class = " field " >
2023-01-17 22:21:28 +01:00
< 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 >
2023-01-17 23:05:24 +01:00
' ;
}
$text .= '</div>' ;
2023-01-17 22:21:28 +01:00
return $text ;
}
function select_subject ( $profile ) : string {
$text = ' et votre demande concerne' ;
if ( isset ( $_GET [ " subject " ]) && $_GET [ " subject " ] == 'warranty' ) {
2023-01-17 23:05:24 +01:00
$text .= " <a href=' " . contact_query ( array ( " subject " => " " )) . " '>la garantie Solar Glass</a></h2> " ;
2023-01-17 22:21:28 +01:00
$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' ) {
2023-01-17 23:05:24 +01:00
$text .= " <a href=' " . contact_query ( array ( " subject " => " " )) . " '>l'intégration de Solar Glass dans vos produits</a></h2> " ;
2023-01-17 22:21:28 +01:00
$text .= contact_form ( $profile , $_GET [ " subject " ]);
} elseif ( isset ( $_GET [ " subject " ]) && $_GET [ " subject " ] == 'other' ) {
2023-01-17 23:05:24 +01:00
$text .= " <a href=' " . contact_query ( array ( " subject " => " " )) . " '>autre chose</a></h2> " ;
2023-01-17 22:21:28 +01:00
$text .= contact_form ( $profile , $_GET [ " subject " ]);
} else {
$text .= " ...</h2> " ;
if ( $profile == 'business' ) $text .= " <a class='button' href=' " . contact_query ( array ( " subject " => " integration " )) . " '>L'intégration de Solar Glass dans vos produits</a> " ;
if ( $profile == 'consumer' ) $text .= " <a class='button' href=' " . contact_query ( array ( " subject " => " warranty " )) . " '>La garantie Solar Glass</a> " ;
$text .= " <a class='button' href=' " . contact_query ( array ( " subject " => " other " )) . " '>Autre chose</a></div> " ;
}
return $text ;
}
function select_profile () : string {
$text = '' ;
$text .= " <h2>Vous êtes " ;
if ( isset ( $_GET [ " profile " ]) && $_GET [ " profile " ] == 'business' ) {
$text .= " <a href=' " . contact_query ( array ( " profile " => " " )) . " '>une entreprise</a> " ;
$text .= select_subject ( 'business' );
} else if ( isset ( $_GET [ " profile " ]) && $_GET [ " profile " ] == 'consumer' ) {
$text .= " <a href=' " . contact_query ( array ( " profile " => " " )) . " '>un particulier</a> " ;
$text .= select_subject ( 'consumer' );
} else $text .= " ...</h2>
< a class = 'button' href = " . contact_query(array( " profile " => " business " )) . " > Une entreprise </ a >
< a class = 'button' href = " . contact_query(array( " profile " => " consumer " )) . " > Un particulier </ a ></ div > " ;
return $text ;
}
?>
2023-01-05 13:05:09 +01:00
<! DOCTYPE html >
< html lang = " fr " >
2023-01-06 21:38:09 +01:00
< head >
< meta charset = " utf-8 " >
2023-01-09 11:22:51 +01:00
< meta name = " viewport " content = " width=device-width, initial-scale=1 " >
2023-01-06 21:38:09 +01:00
< title > Elite Solar </ title >
2023-01-16 19:38:28 +01:00
< link rel = " stylesheet " href = " ../assets/css/style.css " >
< link rel = " stylesheet " href = " ../assets/css/header.css " >
2023-01-17 22:21:28 +01:00
< link rel = " stylesheet " href = " ../assets/css/contact.css " >
2023-01-16 19:38:28 +01:00
< link rel = " stylesheet " href = " ../assets/css/footer.css " >
< script src = " ../assets/js/header.js " ></ script >
2023-01-06 21:38:09 +01:00
</ head >
< body >
< header >
< h1 > Elite Solar </ h1 >
2023-01-16 19:38:28 +01:00
< img id = " burger-menu " alt = " Menu " onclick = " burgerMenu() " src = " ../assets/img/open-menu.svg " >
2023-01-06 21:38:09 +01:00
< ul id = " menu " class = " invisible " >
2023-01-16 19:38:28 +01:00
< li >< a href = " ../ " > Accueil </ a ></ li >
< li >< a href = " ../about " > Qui sommes - nous ? </ a ></ li >
< li >< a href = " ../product " > Produit </ a ></ li >
< li class = " active " >< a href = " ../contact " > Contact </ a ></ li >
< li >< a href = " ../faq " > FAQ </ a ></ li >
2023-01-06 21:38:09 +01:00
</ ul >
</ header >
2023-01-17 22:21:28 +01:00
< main >
< div >
< h1 > Nous contacter </ h1 >
< ? = select_profile () ?>
</ main >
2023-01-09 10:44:39 +01:00
< footer >
< div id = " social " >
< p > Suivez - Nous </ p >
< ul >
2023-01-16 19:38:28 +01:00
< li >< a href = " https://linkedin.com " >< img src = " ../assets/img/linkedin.svg " width = " 50 " height = " 50 " alt = " LinkedIn " ></ a ></ li >
< li >< a href = " https://instagram.com/elitesolar77 " >< img src = " ../assets/img/instagram.svg " width = " 50 " height = " 50 " alt = " Instagram " ></ a ></ li >
< li >< a href = " https://www.facebook.com/profile.php?id=100089332237449 " >< img src = " ../assets/img/facebook.svg " width = " 50 " height = " 50 " alt = " Facebook " ></ a ></ li >
< li >< a href = " https://twitter.com/EliteSolar77 " >< img src = " ../assets/img/twitter.svg " width = " 50 " height = " 50 " alt = " Twitter " ></ a ></ li >
2023-01-09 10:44:39 +01:00
</ ul >
</ div >
< div id = " sitemap " >
< p > Plan du site </ p >
< ul >
2023-01-16 19:38:28 +01:00
< li >< a href = " ../ " > Page d ' accueil </ a ></ li >
< li >< a href = " ../about " > Qui sommes - nous ? </ a ></ li >
< li >< a href = " ../product " > Notre produit </ a ></ li >
< li >< a href = " ../faq " > Foire aux questions </ a ></ li >
< li >< a href = " ../contact " > Contact </ a ></ li >
< li >< a href = " ../privacy " > Politique de confidentialité </ a ></ li >
< li >< a href = " ../legal " > Mentions légales </ a ></ li >
2023-01-09 10:44:39 +01:00
</ ul >
</ div >
< div id = " contact " >
< p > Contact </ p >
< ul >
< li >< a href = " tel:+33160746800 " >+ 33 1 60 74 68 00 </ a ></ li >
< li >< a href = " mailto:elitesolar.contact77@gmail.com " > elitesolar . contact77 @ gmail . com </ a ></ li >
</ ul >
</ div >
2023-01-09 11:48:16 +01:00
< p id = " copyright " > © < ? = date ( " Y " ) ?> Elite Solar. Créé par Lyanis Souidi, Tom Moguljak et Romain Journeau.</p>
2023-01-09 10:44:39 +01:00
</ footer >
2023-01-17 22:21:28 +01:00
< script src = " ../assets/js/contact.js " ></ script >
2023-01-06 21:38:09 +01:00
</ body >
2023-01-09 17:32:46 +01:00
</ html >