/** * * File: Index.php * Desc: The main page, this is the placeholder for all the ajax functions * */ /** * Include global configuration */ require_once(dirname(__FILE__) . '/global.php'); /** * Include the class for the general stuff */ require_once(ABSPATH.'lib/general.class.php'); // Init the error msg array $errorMsg = array(); // Init the general class $general = new General(); // Get vars $ais = $_GET['ais']; $print = $_GET['print']; if (empty($print)) $print = false; // Check if there was a search action preformmed if ($_POST['search_objects']) { $ais = ($_POST['objectType'] == 0 ? 3 : 4); $searchPreformed = true; $objectValueFrom = $_POST['objectValueFrom']; $objectValueTo = $_POST['objectValueTo']; $objectLocation = $_POST['objectLocation']; header("location: index.php?ais=".$ais."&ovf=".$objectValueFrom."&ovt=".$objectValueTo."&ol=".$objectLocation); } else if ($_POST['send_phone_form']) { if (!ereg('((^06((\s{0,1})|(\-{0,1}))[0-9]{8}$)|(^[0-9]{3,4}(\s{0,1}|\-{0,1})[0-9]{6,7}$)|(^\+{1}[0-9]{2}(\s{0,1}|\-{0,1})[0-9]{2,3}(\s{0,1}|\-{0,1})[0-9]{6,7}$))', $_POST['formPhoneNumber'])) $emailMessage = '
Geen geldig telefoon nummer.
'; else { // De gegevens in een bericht zetten $bericht = "============================= Afzender: Email bericht van de website IP-adres: " . $_SERVER['REMOTE_ADDR'] . " Betreft: Contact op te nemen met onderstaand telefoon nummer. Bericht: ------------------------------------------- Telefoon nummer: ".$_POST['formPhoneNumber']." ------------------------------------------- ============================="; $email = 'info@estemate.nl'; $subject = 'Site verzoek: Verzoek contact op te nemen.'; $from = "From: Estemate WebsiteEmail is succesvol verzonden.
'; } else { // Zo niet, dan geven we een foutmelding. $emailMessage = "De email kon niet verzonden worden, u kunt ons direct emailen op ".$email."
"; } } $template->register_vars(array("email_message" => $emailMessage)); } // Global check for section if (!empty($ais) && ($ais > 7 || $ais < 1)) $ais = 1; else if (empty($ais)) $ais = 1; // Sections // Main page if ($ais == 1 || empty($ais)) { // Main section $file = 'main.php'; if (file_exists($file)) include($file); else die($template->error("Cant open de file : " + $file)); } // Nieuws else if ($ais == 2) { $file = 'news.php'; if (file_exists($file)) include($file); else die($template->error("Cant open de file : " + $file)); } // Huur // Koop objecten else if ($ais == 3 || $ais == 4) { $file = 'objects.php'; if (file_exists($file)) include($file); else die($template->error("Cant open de file : " + $file)); } // Financiering else if ($ais == 5) { // Main section $file = 'financiering.php'; if (file_exists($file)) include($file); else die($template->error("Cant open de file : " + $file)); } // Links else if ($ais == 6) { $file = 'links.php'; if (file_exists($file)) include($file); else die($template->error("Cant open de file : " + $file)); } // Contact else if ($ais == 7) { $file = 'contact.php'; if (file_exists($file)) include($file); else die($template->error("Cant open de file : " + $file)); } if (!$print) { // Register the template layout $template->register_vars(array("page_layout" => $inhoud)); // Parse the header $template->print_template($template->parse_template("header")); // Parse the header $template->print_template($template->parse_template("footer")); } // Unset all vars unset($template); $general->unsetAll(); unset($general); ?>