<?php session_start();
// grab recaptcha library
require_once "recaptchalib.php";
?>

<!DOCTYPE HTML>
<!--
	Twenty by HTML5 UP
	html5up.net | @n33co
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
	<head>
		<title>Contact - matutinal.fr</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
		<script src="js/jquery.min.js"></script>
		<script src="js/jquery.dropotron.min.js"></script>
		<script src="js/jquery.scrolly.min.js"></script>
		<script src="js/jquery.scrollgress.min.js"></script>
		<script src="js/skel.min.js"></script>
		<script src="js/skel-layers.min.js"></script>
		<script src="js/init.js"></script>
        <script src="js/contact.js"></script>
        <script src='https://www.google.com/recaptcha/api.js?hl=fr'></script>
		<noscript>
			<link rel="stylesheet" href="css/skel.css" />
			<link rel="stylesheet" href="css/style.css" />
			<link rel="stylesheet" href="css/style-wide.css" />
			<link rel="stylesheet" href="css/style-noscript.css" />
		</noscript>
		<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
		<!--[if lte IE 9]><link rel="stylesheet" href="css/ie/v9.css" /><![endif]-->
	</head>
	<body class="contact">
	
		<!-- Header -->
        <header id="header">
            <h1 id="logo"><a href="index.html">matutinal <span>Web designer / Webmaster</span></a></h1>
            <nav id="nav">
                <ul>
                    <li class="current"><a href="#main" class="scrolly">Contact</a></li>
                    <li class="submenu">
                        <a href="">Naviguer</a>
                        <ul>
                            <li><a href="index.html#main">Présentation</a></li>
                            <li><a href="index.html#realisations">Réalisations</a></li>
                            <li><a href="projet.html">Vos projets</a></li>
                            <li><a href="#" class="scrolly">Contact</a></li>
                            <li><a title="prochainement">Blog&nbsp;<span class="icon fa-sign-out"></span> <span class="icon fa-unlink"></span></a></li>
                        </ul>
                    </li>
                    <li><a title="prochainement">Blog&nbsp;<span class="icon fa-sign-out"></span> <span class="icon fa-unlink"></span></a></li>
                </ul>
            </nav>
        </header>
		
		<!-- Main -->
			<article id="main">

				<header class="special container">
					<span class="icon fa-envelope"></span>
					<h2>Laissez nous un message</h2>
					<p>Pour parler de vos projets, nous serons plus à l'aise <a href="projet.html">ici</a>.</p>

				</header>
					
				<!-- One -->
					<section class="wrapper style4 special container small">
					
						<!-- Content -->
							<div class="content">
                                <?php
                                //init variables
                                $cf = array();
                                $sr = false;

                                if(isset($_SESSION['cf_returndata'])){
                                    $cf = $_SESSION['cf_returndata'];
                                    $sr = true;
                                }
                                ?>
                                <ul id="errors" class="<?php echo ($sr && !$cf['form_ok']) ? 'visible' : ''; ?>">
                                    <li id="info">Il y a eu un problème lors de la validation de votre envoi :</li>
                                    <?php
                                    if(isset($cf['errors']) && count($cf['errors']) > 0) :
                                        foreach($cf['errors'] as $error) :
                                            ?>
                                            <li><?php echo $error ?></li>
                                        <?php
                                        endforeach;
                                    endif;
                                    ?>
                                </ul>
                                <div class="row">
                                    <div class="12u">
                                        <p id="success" class="<?php echo ($sr && $cf['form_ok']) ? 'visible' : ''; ?>">Merci d’avoir laissé un message ! Nous serons très vite en contact.</p>
                                    </div>
                                </div>
								<form method="post" action="process.php">
									<div class="row half collapse-at-2">
										<div class="6u">
                                            <input type="text" id="name" name="name" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['name'] : '' ?>" placeholder="Votre nom" required="required" autofocus="autofocus" />
										</div>
										<div class="6u">
                                            <input type="email" id="email" name="email" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['email'] : '' ?>" placeholder="Votre adresse mail" required="required" />
										</div>
									</div>

									<div class="row half">
										<div class="12u">
                                            <textarea id="message" name="message" placeholder="Votre message" required="required" rows="7"><?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['message'] : '' ?></textarea>
										</div>
									</div>
									<!--
									<div class="row">
										<div class="12u">
											<ul class="buttons">
												<li><input type="submit" id="submit-button" value="Envoyer le message" /></li>
											</ul>
										</div>
									</div>
									-->
								</form>
                                <div style= "display:none;" class="g-recaptcha" data-sitekey="6LfPtwITAAAAAN4e3azohNIXMaRF_x6jk1T0DfJt"></div>
                                <?php unset($_SESSION['cf_returndata']); ?>
                            </div>
                        <p style="font-style: italic; margin-top:15px;">Nous veillons à la confidentialité de vos informations. Nous n'envoyons pas de spam.</p>
					</section>
				
			</article>

		<!-- Footer -->
        <footer id="footer">
            <ul class="links">
                <li><a href="contact.php">Contact <span class="icon fa-envelope-o"></span></a></li>
                <li><a title="sitemap.xml" href="sitemap.xml" target="_blank">Plan du site <span class="icon fa-sitemap"></span></a></li>
                <li><a title="bientôt : blog.matutinal.fr">Blog <span class="icon fa-comments-o"> <span class="icon fa-unlink"></span></span></a></li>
            </ul>
            <ul class="license">
                <li>This work is licensed under a <a rel="license" target="_blank" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</li>
                <li>Design adapted from <a href="http://html5up.net" target="_blank">HTML5 Up</a>.</li>
                <li><a href="mentions-legales.html">Mentions légales</a></li>
                <li>Le site n'est pas dans sa version finale <span class="icon fa-smile-o"></span></li>
            </ul>

        </footer>

	</body>
</html>
