<?php
	$settings['imEmailForm_5_2'] = array(
		"owner_email_from" => "info@colegiovida.edu.gt",
		"owner_email_to" => "info@colegiovida.edu.gt",
		"customer_email_from" => "info@colegiovida.edu.gt",
		"customer_email_to" => "",
		"owner_message" => "",
		"customer_message" => "",
		"owner_subject" => "Mensaje enviado desde su pagina web",
		"customer_subject" => "",
		"owner_csv" => True,
		"customer_csv" => False,
		"confirmation_page" => "../index.html"
	);

	if(substr(basename($_SERVER['PHP_SELF']), 0, 11) == "imEmailForm") {
		include "../res/x5engine.php";

		$answers = array(
		);

		$form_data = array(
			"NOMBRE" => $_POST['imObjectForm_2_1'],
			"TELEFONO" => $_POST['imObjectForm_2_2'],
			"CORREO" => $_POST['imObjectForm_2_3'],
			"COMENTARIOS" => $_POST['imObjectForm_2_4']
		);

		$files_data = array(
		);

		if(@$_POST['action'] != "check_answer") {
			if(!isset($_POST['imJsCheck']) || $_POST['imJsCheck'] != "jsactive")
				die(imPrintJsError());
			if (isset($_POST['imCpt']) && !isset($_POST['imCptHdn']))
				die(imPrintJsError());
			if(isset($_POST['imSpProt']) && $_POST['imSpProt'] != "")
				die(imPrintJsError());
			$email = new imSendEmail();
			$email->sendFormEmail($settings['imEmailForm_5_2'], $form_data, $files_data);
			@header('Location: ' . $settings['imEmailForm_5_2']['confirmation_page']);
		} else {
			if(@$_POST['id'] == "" || @$_POST['answer'] == "" || strtolower(trim($answers[@$_POST['id']])) != strtolower(trim(@$_POST['answer'])))
				echo "0";
			else
				echo "1";
		}
	}

// End of file