<?php
	$settings['imEmailForm_8_30'] = array(
		"owner_email_from" => "Email Principal",
		"owner_email_to" => "contato@minhafaturas.com",
		"customer_email_from" => "contato@minhafaturas.com",
		"customer_email_to" => "",
		"owner_message" => "",
		"customer_message" => "",
		"owner_subject" => "Dúvidas sobre Loja Virtual",
		"customer_subject" => "",
		"owner_csv" => False,
		"customer_csv" => False,
		"confirmation_page" => "../mensagem-enviada.html"
	);

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

		$answers = array(
		);

		$form_data = array(
			"Nome" => $_POST['imObjectForm_30_1'],
			"Email Principal" => $_POST['imObjectForm_30_2'],
			"Sua dúvida" => $_POST['imObjectForm_30_3']
		);

		$files_data = array(
		);

		if(@$_POST['action'] != "check_answer") {
			if(!isset($_POST['imJsCheck']) || $_POST['imJsCheck'] != "jsactive")
				die(imPrintJsError());
			if(isset($_POST['imSpProt']) && $_POST['imSpProt'] != "")
				die(imPrintJsError());
			$email = new imSendEmail();
			$email->sendFormEmail($settings['imEmailForm_8_30'], $form_data, $files_data);
			@header('Location: ' . $settings['imEmailForm_8_30']['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