<?php

include ("includes/functions.php");

if ($_POST['versturen']) 
	{ 
 	form_controle();
	}
if ($_GET['s'] == "ok") 
	{ 
	$vermelding = ""; 
	$image = '<img src="images/dank-u-wel-meertalig.jpg">';
	$verplicht = "";
	$code = "";
	
	} else { 
	$vermelding = ""; 
	$image = "";
	$verplicht = "<p><font color='#FF0000'>*</font> = donn&eacute;es obligatoires</b></p>";
	$code = '
	<form id="contactForm" action="enquete_fr.php" name="DataForm" method="post" onSubmit="return CheckRequiredFields()">
							<ol>
								<li>
									<label>Date de visite: (p.e. lundi 30 Juin) <span class="error">*</span></label>
									<input type="text" name="datum" class="Inputbox" />
								</li>
								<li>
									<label>Heure de visite: (p.e. 20h) <span class="error">*</span></label>
									<input type="text" name="uur" class="Inputbox" />
								</li>
								<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&eacute;l&eacute;phone: </label>
									<input type="text" name="telnr"  class="Inputbox"/>
								</li>
								<li>
                                	<label>J ai fait la connaissance de &quot;Het Kompas&quot; via:</label>
									<input type="text" name="waarkentu" class="Inputbox"/>
								</li>
								<li>
									<label>Y-a-t il eu des choses que vous jugez d&eacute;plaisantes lors de votre pr&eacute;sence?</label>
									<input type="text" name="stoorden" class="Inputbox" />
								</li>
								<li><label>Avez-vous des suggestions?</label>
									<input type="text" name="suggesties" class="Inputbox" />
								</li>
								<li>
									<label>Donner votre opinion</label>
									<table width="310" cellpadding="5" cellspacing="5" align="left" class="order-wrap">
										<tr>
											<th class="titel">&nbsp;</th>
											<th>Mauvais</th>
											<th>Moins</th>
											<th>OK</th>
											<th>Bien</th>
											<th class="noborder">Très bien</th>
										</tr>
										<tr>
											<td class="titel">Accueil: </td>
											<td>  <input type="hidden" name="OnthaalReason" value="" />
												<input type="radio" name="Onthaal" value="slecht" class="radio" />
											</td>
											<td><input type="radio" name="Onthaal" value="minder" class="radio" /></td>
											<td><input type="radio" name="Onthaal" value="OK" class="radio" /></td>
											<td><input type="radio" name="Onthaal" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Onthaal" value="zeer goed" class="radio" /></td>
										</tr>
										<tr>
											<td class="titel">Service: </td>
											<td>
											<input type="hidden" name="BedieningReason" value="" />
											<input type="radio" name="Bediening" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Bediening" value="minder" class="radio" /></td>
											<td><input type="radio" name="Bediening" value="OK" class="radio" /></td>
											<td><input type="radio" name="Bediening" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Bediening" value="zeer goed" class="radio" /></td>
										</tr>
										<tr>
											<td class="titel">Atmosph&egrave;re / cadre: </td>
											<td>
											<input type="hidden" name="SfeerReason" value="" />
											<input type="radio" name="Sfeer" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Sfeer" value="minder" class="radio" /></td>
											<td><input type="radio" name="Sfeer" value="OK" class="radio" /></td>
											<td><input type="radio" name="Sfeer" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Sfeer" value="zeer goed" class="radio" /></td>
										</tr>
										<tr>
											<td class="titel">Hygi&egrave;ne: </td>
											<td>

											<input type="hidden" name="ProperheidReason" value="" />
											<input type="radio" name="Properheid" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Properheid" value="minder" class="radio" /></td>
											<td><input type="radio" name="Properheid" value="OK" class="radio" /></td>
											<td><input type="radio" name="Properheid" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Properheid" value="zeer goed" class="radio" /></td>
										</tr>
										<!--<tr>
											<td class="titel">Musique: </td>
											<td>
											<input type="hidden" name="MuziekReason" value="" />
											<input type="radio" name="Muziek" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Muziek" value="minder" class="radio" /></td>
											<td><input type="radio" name="Muziek" value="OK" class="radio" /></td>
											<td><input type="radio" name="Muziek" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Muziek" value="zeer goed" class="radio" /></td>
										</tr>-->
										<tr>
											<td class="titel">Qualité du repas: </td>
											<td>
											<input type="hidden" name="KwaliteitReason" value="" />
											<input type="radio" name="Kwaliteit" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Kwaliteit" value="minder" class="radio" /></td>
											<td><input type="radio" name="Kwaliteit" value="OK" class="radio" /></td>
											<td><input type="radio" name="Kwaliteit" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Kwaliteit" value="zeer goed" class="radio" /></td>
										</tr>
										<tr>
											<td class="titel">Quantité du repas: </td>
												<td>
												<input type="hidden" name="KwantiteitReason" value="" />
												<input type="radio" name="Kwantiteit" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Kwantiteit" value="minder" class="radio" /></td>
											<td><input type="radio" name="Kwantiteit" value="OK" class="radio" /></td>
											<td><input type="radio" name="Kwantiteit" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Kwantiteit" value="zeer goed" class="radio" /></td>
										</tr>
                                          <!--<tr>
											<td class="titel">Si vous avez réservé par téléphone : La conversation était correcte? </td>
											<td>
											<input type="hidden" name="TelefoonReason" value="" />
	                                        <input type="radio" name="Telefoon" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Telefoon" value="minder" class="radio" /></td>
											<td><input type="radio" name="Telefoon" value="OK" class="radio" /></td>
											<td><input type="radio" name="Telefoon" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Telefoon" value="zeer goed" class="radio" /></td>
										</tr>
                                                                                <tr>
											<td class="titel">Si vous avez réservé “online”: Était-il facile? </td>
											<td>
											<input type="hidden" name="OnlineReason" value="" />
	                                        <input type="radio" name="Online" value="slecht" class="radio" /></td>
											<td><input type="radio" name="Online" value="minder" class="radio" /></td>
											<td><input type="radio" name="Online" value="OK" class="radio" /></td>
											<td><input type="radio" name="Online" value="goed" class="radio" /></td>
											<td class="noborder"><input type="radio" name="Online" value="zeer goed" class="radio" /></td>
										</tr>-->
										<tr>
											<td colspan="6" class="noborder"><input type="submit" class="Inputbox" name="versturen" value="Envoyer Enqu&ecirc;te" /></td>
										</tr>
									</table>
								</li>
							</ol>
							</form>   
	
	' ;
	}

?>
<!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><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Het Kompas :: Enquete Invulformulier</title>

<meta name="viewport" content="width=device-width">
<? MetaStuff (); ?>
<link href="style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" language="JavaScript">

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\nAdresse e-mail svp."; }
if(WithoutContent(document.DataForm.datum.value))
	{ errormessage += "\n\nDate de visite svp."; }	
if(WithoutContent(document.DataForm.uur.value))
	{ errormessage += "\n\nHeure de visite 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>

<script type="text/javascript" src="Scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
    $j = jQuery.noConflict();
    </script>
	<script type="text/javascript" src="Scripts/jquery.colorbox-min.js"></script>
	<script type="text/javascript" src="Scripts/enquete.js"></script>
   	<link rel="stylesheet" type="text/css" media="all" href="Scripts/colorbox.css" />

</head>
<body onload="MM_preloadImages('images/BlockMenu_o.jpg','images/BlockDrank_o.jpg','images/BlockEnquete_o.jpg','images/BlockCBon_o.jpg')">


<div style='display: none'>
		<div id="inline_example1" align='center'><br />
		<span align=left>Nous voulons bien savoir comment nous pourrions améliorer notre service.</span><br />
		<span align=left>Prière de remplir pourquoi vous n'étiez pas content.</span><br/><br/>
		<textarea cols=30 rows=5 name="reason"></textarea>
		<br/>
		<br/>

		<input type='button' id='saveReason' value='Continuer'/>
		<input type="hidden" name="reasonName" value="" />
        </div>
        </div>
        
<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="enquete_fr.php" id="current">Enquête</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">Contact</a></li>
					<li><a href="ligging_fr.php">info &amp; situation</a></li>
				</ul>
				</nav>
				</div>
			</div>
			<div class="langsel"><a href="enquete.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>Enqu&ecirc;te</h1>
							<p><?php echo $vermelding; ?></p>
							<p><?php echo $image; ?></p>
                            <p><?php echo $verplicht; ?></p>
                            <p><?php echo $code; ?></p>
							
						</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" />
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div id="Footer">&nbsp;</div>
	<div id="FooterContent">
		<? FooterContent_fr (); ?>
	</div>
</div>
<? GoogleAnal (); ?>
<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>
    
<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']);
$datum = ($_POST['datum']);
$uur = ($_POST['uur']);
$email = ($_POST['email']);
$waar = ($_POST['waarkentu']);
$stoorden = ($_POST['stoorden']);
$suggesties = ($_POST['suggesties']);
$Onthaal = ($_POST['Onthaal']);
$OnthaalReason = ($_POST['OnthaalReason']);
$Bediening = ($_POST['Bediening']);
$BedieningReason = ($_POST['BedieningReason']);
$Sfeer = ($_POST['Sfeer']);
$SfeerReason = ($_POST['SfeerReason']);
$Properheid = ($_POST['Properheid']);
$ProperheidReason = ($_POST['ProperheidReason']);
$Muziek = ($_POST['Muziek']);
$MuziekReason = ($_POST['MuziekReason']);
$Kwaliteit = ($_POST['Kwaliteit']);
$KwaliteitReason = ($_POST['KwaliteitReason']);
$Kwantiteit = ($_POST['Kwantiteit']);
$KwantiteitReason = ($_POST['KwantiteitReason']);
$wijnkaart = ($_POST['wijnkaart']);
$wijnkaartReason = ($_POST['wijnkaartReason']);
$terugkomen = ($_POST['terugkomen']);
$terugkomenReason = ($_POST['terugkomenReason']);
$Telefoon = ($_POST['Telefoon']);
$TelefoonReason = ($_POST['TelefoonReason']);
$Online = ($_POST['Online']);
$OnlineReason = ($_POST['OnlineReason']);



		
// Nu stuur ik een email om te zeggen dat er iemand bijgekomen is voor de mailing.

$to = "info@hetkompas.be";
//$to = "info@westdesign.be"; 
$subject = "Enquete via Website - FR";
$body = stripslashes ("
<html><title>Contact</title>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<font size=\"-1\" face=\"Verdana, Arial, Helvetica, sans-serif\">

<strong>Bezoek: $datum om $uur.</strong><br /><br />
<strong>Naam:</strong> $naam<br />
<strong>Tel:</strong> $telnr<br />
<strong>E-mail:</strong> $email<br /><br />
<strong>Ik heb Het Kompas leren kennen via:</strong> $waar<br />
<strong>Waren er zaken die u stoorden tijdens uw aanwezigheid?</strong><br />
$stoorden<br /><br />
<strong>Hebt u suggesties voor ons?</strong><br />
$suggesties
<br /><br />
<strong>Punten volgens de klant:</strong><br />
Onthaal: $Onthaal ( $OnthaalReason )<br />
Bediening: $Bediening ( $BedieningReason )<br />
Sfeer: $Sfeer ( $SfeerReason ) <br />
Properheid: $Properheid ( $ProperheidReason )<br />
Kwaliteit: $Kwaliteit ( $KwaliteitReason )<br />
Kwantiteit: $Kwantiteit ( $KwantiteitReason )<br />
");

$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";


mail($to, $subject, $body, $headers,'-finfo@hetkompas.be'); 

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

}
?>