<?php

include ("includes/functions.php");

if ($_POST['versturen']) 
	{ 
 	form_controle();
	}
if ($_GET['s'] == "ok") 
	{ 
	$vermelding = "<p><b><font color='#FF0000'>Nous vous r&eacute;pondrons aussi vite que possible.<br />
Veuillez contrôler certainement vous fichiers 'Spam' et 'mails non-souhaités', car parfois, nos réponses arrivent dans ces fichiers!</font></b></p>"; 
	} else { 
	$vermelding = ""; 
	}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Het Kompas :: Contacteer Ons</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="viewport" content="width=device-width">
<? MetaStuff (); ?>
<link rel="stylesheet" href="includes/meanmenu.css" media="all" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="includes//jquery.meanmenu.js"></script> 
<script>
jQuery(document).ready(function () {
    jQuery('nav').meanmenu();
});
</script>
<link href="style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" language="JavaScript">
<!-- Copyright 2003 Bontrager Connection, LLC
// Code obtained from http://WillMaster.com/
//
// Each required form field can be checked with JavaScript. Here are 
//    the function names for the different kinds of checks:
//
//       1. WithoutContent() -- check if the text, textarea, password, 
//              or file fields has no content.
//       2. NoneWithContent() -- check if none of the set of text, 
//              textarea, password, or file fields have content. 
//              (Set: More than one with the same field name.)
//
//       3. NoneWithCheck() -- check if none of the set of radio buttons 
//              or checkboxes are checked. (Set: More than one with the 
//              same field name.)
//       4. WithoutCheck() -- check if the single radio button or checkbox 
//              is unchecked.
//
//       5. WithoutSelectionValue() -- check if selected drop-down list or 
//              select box entries have no value.
//
//
// The format for using the above functions is
//             if(       WithoutContent([FORMFIELDVALUE])) [ERRORMESSAGE]
//             if(      NoneWithContent([FORMFIELD])     ) [ERRORMESSAGE]
//             if(        NoneWithCheck([FORMFIELD])     ) [ERRORMESSAGE]
//             if(         WithoutCheck([FORMFIELD])     ) [ERRORMESSAGE]
//             if(WithoutSelectionValue([FORMFIELD])     ) [ERRORMESSAGE]
//
// The if(...) part and the error message part may be on separate lines, like
//             if(WithoutContent([FORMFIELDVALUE]))
//                [ERRORMESSAGE]
//             if(NoneWithContent([FORMFIELD]))
//                [ERRORMESSAGE]
//             if(NoneWithCheck([FORMFIELD]))
//                [ERRORMESSAGE]
//             if(WithoutCheck([FORMFIELD]))
//                [ERRORMESSAGE]
//             if(WithoutSelectionValue([FORMFIELD]))
//                [ERRORMESSAGE]
//
//
//      FORMFIELD -- The format for specifying a "form field" is 
//                         document.[FORMNAME].[FIELDNAME]
// FORMFIELDVALUE -- The format for specifying a "form field value" is 
//                         document.[FORMNAME].[FIELDNAME].value
//   ERRORMESSAGE -- The format for specifying an "error message" is
//                         { errormessage += "\n\n[MESSAGE]"; }
//                   If the message itself contains quotation marks, 
//                      they must be preceded with a back slash. 
//                      Example: \"
//
//
//      FORMNAME -- The name assigned to the form in the <FORM... tag. 
//     FIELDNAME -- The field name being checked.
// 
//
// For use with this JavaScript, the only non-alphanumeric character a 
//    fieldname may have is the underscore. Replace any hyphens, colons, 
//    spaces, or other non-alphanumeric characters in your field names 
//    with an underscore character.
//
//
// Put field checks into the function CheckRequiredFields(), in the order 
//    you want the fields checked.
//

function CheckRequiredFields() {
var errormessage = new String();
// Put field checks below this point.

if(WithoutContent(document.DataForm.naam.value))
	{ errormessage += "\n\nNom SVP."; }
if(WithoutContent(document.DataForm.email.value))
	{ errormessage += "\n\nEmail SVP."; }
if(WithoutContent(document.DataForm.telnr.value))
	{ errormessage += "\n\nTel n° SVP."; }
if (document.DataForm.email.value != document.DataForm.email2.value) {
	errormessage += "\n\nVos 2 adresses e-mail ne se ressemblent pas.";
}


// Put field checks above this point.
if(errormessage.length > 2) {
	alert('NOTE:' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()


function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function NoneWithContent(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].value.length > 0) { return false; }
	}
return true;
}

function NoneWithCheck(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].checked) { return false; }
	}
return true;
}

function WithoutCheck(ss) {
if(ss.checked) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

//-->
</script>

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('images/BlockMenu_o.jpg','images/BlockDrank_o.jpg','images/BlockEnquete_o.jpg','images/BlockCBon_o.jpg')">
<div align="center">
	<div id="Wrapper">
		<div id="Header">
			<div id="HeaderNavigContainer">
				<div id="mobile-nav">
				<nav class="mob-menu">
					<ul class="HeaderNavig">
					<li><a href="index_fr.php">Bienvenue</a></li>
					<li><a href="fotogal_fr.php">Photos</a></li>
					<li><a href="artikels_fr.php">articles &amp; Media</a></li>
					<li><a href="contact_fr.php" id="current">Contact</a></li>
					<li><a href="ligging_fr.php">info &amp; situation</a></li>
				</ul>
				</nav>
				</div>
			</div>
			<div class="langsel"><a href="contact.php">Nederlands</a></div>
		</div>
		<div id="SubHeader">&nbsp;</div>
		<div id="Content">
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td id="LeftSide">
						<div class="LeftSide">
						<? SubMenu_fr (); ?>
						</div>
					</td>
					<td id="CenterPage">
						<div class="CenterPage">
							<h1>Contact</h1>
							<p>Vous pouvez nous joindre par téléphone en appelant <strong>058 / 23 08 23</strong><br/>ou par email <a href="mailto:info@hetkompas.be">info@hetkompas.be</a></p>
                        <!--<p style="font-size:16px; color:#F00">Prière de ne pas utiliser cette page pour réserver !<br />
Pour des réservations, cliquez ici <a href="http://www.hetkompas.be/reserveren_fr.php" target="_self">réserver...</a></p>-->
                            <p><?php echo $vermelding; ?></p>
							<p><span class="error">*</span> = donn&eacute;es obligatoires</p>
							<form id="contactForm" action="contact_fr.php" name="DataForm" method="post" onSubmit="return CheckRequiredFields()">
							<ol>
								<li><label>Nom: <span class="error">*</span></label>
							    	<input type="text" name="naam" class="Inputbox" />
								</li>
								<li><label>Email: <span class="error">*</span></label>
									<input type="text" name="email"  class="Inputbox"/>
								</li>
								<li><label>Répéter Email: <span class="error">*</span></label>
									<input type="text" name="email2"  class="Inputbox"/>
								</li>
								<li><label>Téléphone:<span class="error">*</span></label>
									<input type="text" name="telnr"  class="Inputbox"/>
								</li>
								<li><label>Message:</label>
									<textarea name="bericht" class="Inputbox"></textarea><br />
<p>“Nous vous enverrons un mail pour confirmer votre réservation.  Prière de contrôler certainement vos mails “spam” ou “non souhaités”, car parfois, notre mail de confirmation peut arriver dans un de ces fichiers.”</p>
								</li>
								<p><div align="center"><input type="submit" class="Inputbox" name="versturen" value="Envoyer" /></div></p>
								<li class="antispam"><label>Gelieve dit veld leeg te laten:</label><input name="url" /></li>
							</ol>
							</form>
						</div>
					</td>
					<td id="RightSide">
						<img src="images/HomePagePhoto-1212.jpg" width="234" height="157" alt="Het Kompas foto 1" /><br /><br />
						<img src="images/HomePagePhoto-1212-3.jpg" width="234" height="300" alt="Het Kompas foto 3" /><br /><br />
                        <a href="http://www.faq.hetkompas.be/FAQ FR.pdf" target="new"><img src="images/faq.png" width="234" height="127" alt="Het Kompas Faq" /></a></a>	<br />	
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div id="Footer">&nbsp;</div>
	<div id="FooterContent">
		<? FooterContent_fr (); ?>
	</div>
</div>
<? GoogleAnal (); ?>
<script>
  (function (w,i,d,g,e,t,s) {w[d] = w[d]||[];t= i.createElement(g);
    t.async=1;t.src=e;s=i.getElementsByTagName(g)[0];s.parentNode.insertBefore(t, s);
  })(window, document, '_gscq','script','//widgets.getsitecontrol.com/137588/script.js');
</script>


</body>
</html>

<?php
function form_controle()
{

$naam = ($_POST['naam']);
$telnr = ($_POST['telnr']);
$email = ($_POST['email']);
$bericht = ($_POST['bericht']);
$url = ($_POST['url']);
		
// Nu stuur ik een email om te zeggen dat er iemand bijgekomen is voor de mailing.

$to = "info@hetkompas.be"; 
$subject = "Contact via Website FR";

$body = stripslashes ("
<html><title>Contact</title>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<font size=\"-1\" face=\"Verdana, Arial, Helvetica, sans-serif\">
<strong>Naam:</strong> $naam <br />
<strong>Tel:</strong> $telnr <br />
<strong>E-mail:</strong> $email <br />
<hr />
<strong>Bericht:</strong><br />
$bericht
");

$headers ='X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$headers .= 'From: '.$email.''."\r\n";

if(isset($_POST['url']) && $_POST['url'] == '')
{
mail($to, $subject, $body, $headers,'-finfo@hetkompas.be'); 
}
else
{
	echo '<p>This is spam</p>';
}


header("Location:contact_fr.php?s=ok");

}
?>