<?php
//ini_set('display_errors', 1);
//error_reporting(E_ALL);
include('config.php');
include(LOCAL_ROOT.'class/contacts_importer.class.php');
include(LOCAL_ROOT.'inc/invite.php');
include (ADMIN_ROOT.'class/class.php');
$DB = new DB();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<!-- #################################################-->
<!-- Made by: www.DIRECTBASING.com -->
<!-- Semantisch correcte xHTML Basing -->
<!-- #################################################-->
<head>
<title><?=SITE_TITLE?></title>
<script type="text/javascript" src="<?=IMG_ROOT?>2010/resources/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?=IMG_ROOT?>2010/resources/scripts/simpla.jquery.configuration.js"></script>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="keywords" content="key, words" />
<meta name="description" content="<?=SITE_DESCRIPTION?>" />
<meta name="robots" content="noindex, nofollow" /><!-- change into index, follow -->
<link rel="stylesheet" href="stylesheets/global.css" type="text/css" />
<?php
include (LOCAL_ROOT.'js/script.php');
?>
</head>
<body>
<div align="center">
<!-- / wrapper \ -->
<div id="wrapper" align="center" style="text-align:left">
<!-- / main container \ -->
<div id="mainCntr">
<!-- / header container \ -->
<div id="headerCntr">
<h1><a href="#">Gratis Spiegel</a></h1>
<!-- / menu box \ -->
<div class="menuBox">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="bestelstatus.php">Bestelstatus</a></li>
<li><a href="uitleg.php">Uitleg</a></li>
<li><a href="faq.php">Faq</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
<!-- \ menu box / -->
</div>
<!-- \ header container / -->
<!-- / banner container \ -->
<div id="bannerCntr">
<div class="details">
<h3>Wil Jij Ook Een Spiegel?</h3>
<p>Vaak is een gratis product nooit helemaal gratis. Of je moet een deel bijbetalen, of je moet verzendkosten betalen. Wij streven ernaar om producten <b>VOLLEDIG</b> te houden.</p>
<p>Vanzelfsprekend is het natuurlijk dat er wel wat tegenover staat. Dat is een stukje tijd. Wij vragen je na het invullen van het formulier een enquete voor ons in te vullen. Dit neemt slechts enkele minuten tijd in beslag.</p>
<p>Verder zit je helemaal nergens aan vast en tot volgende bestellingen. Vul snel het formulier op onze homepage in. In slechts 3 eenvoudige stappen heb je <b>JOUW</b> besteld.</p>
</div>
</div>
<!-- \ banner container / -->
<!-- / content container \ -->
<div id="contentCntr">
<!-- / form container \ -->
<div id="formCntr">
<?php
// registratiemail
if (isset($_POST['submit']) && $_POST['submit']!='Verstuur') {
include(LOCAL_ROOT.'inc/regemail.php');
$_SESSION['email'] = $_POST['email'];
$sessiemail = $_POST['email'];
$_POST['geboortedatum'] = $_POST['jaar'].'-'.$_POST['maand'].'-'.$_POST['dag'];
$from = ''.SITE_TITLE.'- Onderdeel van XXX';
$reply = 'no-reply@xxx.nl';
$DB->insertTableRow('profiel', $_POST);
$mailReg = new CHmail($_SESSION['email'],$from,$reply,"Registratie ".SITE_TITLE."",$bodyReg);
$mailReg->send();
?>
<div id="text">
<div class="details">
<h3>Registratie succcessvol voltooid</h3>
<p>
voordat je verder gaat vragen wij je nu om je vriend(-innen) op de hoogte te stellen van de Mascara actie door ze een tip te versturen. (er wordt slechts 1 berichtje verstuurd).
</p>
<p>Voor dit onderdeel kunt u gebruik maken van Windows Live en Gmail. Je kunt zelf bepalen welke vriend(-innen) je een "tip" wilt versturen. Log mij safe in via de Windows Live Verbinding of Gmail. Klik op 1 van de logo's, of sla deze stap over en klik <a href="stap3.php" target="_self">hier</a></p>
<p><br><br>
<div class="line">
<span class="left"><a href="<?=$import->getGMailLink()?>"><img src="images/gmail.jpg"></a></span><span class="centre"><a href="<?=$import->getWLLLink()?>"><img src="images/live.jpg"></a></span>
</div>
</div>
</div>
<?
} else if (!empty($contacts))
{
?>
<div id="textmail">
<div class="details">
<h3>Selecteer de email adressen die u wilt uitnodigen.</h3>
<form method="post" action="
<? echo $_SERVER['PHP_SELF']?>">
<div style=" float:left; clear:both;"> <input class="check-all" type="checkbox" /></div><div style="float:left; margin-left:10px;"><b>Selecteer alles</b></div>
<div style="clear:both"></div>
<?php
for ($i=1; $i < sizeof($contacts); $i++) {
if ($contacts[$i]->email !=='')
{
?>
<div style=" float:left; clear:both;"> <input type="checkbox" name="selectEmail[]" value="<?=$contacts[$i]->email?>"></div><div style="float:left; margin-left:10px;"><?=$contacts[$i]->email?></div>
<?php
}
}
?><input type="hidden" name="email" value="<?=$_SESSION['email']?>">
<div style="float:right; margin-bottom:10px;"> <input type="submit" name="submit" class="button" value="Verstuur" ></div>
</form>
</div>
</div>
<?php
// invite mail versturen
} else if ($_POST['submit']=='Verstuur')
{
$DB = new DB();
$from = ''.SITE_TITLE.'- Onderdeel van xxx';
$reply = 'no-reply@xxx.nl';
//$_SESSION['email2'] = $_SESSION['email'];
$_SESSION['email2'] = $_POST['email'];
$_SESSION['profielId'] = $DB->getProfielId($_SESSION['email2'],PROJECT_ID);
$email = $_POST['selectEmail'];
//print_r($id);
{
foreach ($email as $selectEmail)
{
include(LOCAL_ROOT.'inc/invitemail.php');
$DB->insertEmail('invites', $_SESSION['profielId'], $selectEmail,PROJECT_ID);
$mail = new CHmail($selectEmail,$from,$reply,"Uitnodiging",$body);
$mail->send();
}
}
?>
<div id="textmail">
<div class="details">
<h1>Start de vragenlijst!</h1>
<p>
<?=$voornaam?> , je hoeft nu nog maar 1 ding te doen en onze verzend afdeling zal jouw spiegel binnen 7 dagen verpakken en aan jou verzenden. Geef antwoord op onze vragen in de enqu?te en klik daarna op de button "Ga naar de finish!".
<?php
$inviteemail = $_SESSION['email2'];
//echo $inviteemail;
//echo 'test';
echo $_SESSION['profielId'] ;
if ($_SESSION['profielId']!='')
{
$profId = $DB->getProfId('profiel',$inviteemail,PROJECT_ID);
$DB->showEnquete('affiliates',PROJECT_ID,$_SESSION['profielId']);
} else {
$profId = $DB->getProfId('profiel',$inviteemail,PROJECT_ID);
$DB->showEnquete('affiliates',PROJECT_ID,$profId);
}
?>
<br />
<p>Klik <b>nadat</b> je de enqu?te hebt ingevuld op de onderstaande button, hiermee verstuur je jouw gegevens naar onze postafdeling verpakken en klaar maken voor verzending!
</p>
<a href="finish.php"><img src="images/verder.png" alt=""/></a>
<p>* je ontvangt altijd binnen 7 werkdagen 100% gratis in huis, en je zit nergens aan vast (gratis=gratis).
</p></p>
<br />
</div>
</div>
<?php
} else {
?>
<script>window.location.href = 'index.php';</script>
<?php
} ?>
</div>
<!-- \ form container / -->
</div>
<!-- \ content container / -->
</div>
<!-- \ main container / -->
<?php include('footer.php'); ?>
</div>
<!-- \ wrapper / -->
</div>
</body>
</html>