<?php
	$settings['imEmailForm_123_12'] = array(
		"owner_email_from" => "Email Principal (Matriz, Filial...etc)",
		"owner_email_to" => "cyberfenix@gmail.com",
		"customer_email_from" => "cyberfenix@gmail.com",
		"customer_email_to" => "",
		"owner_message" => "",
		"customer_message" => "",
		"owner_subject" => "Criação de site para advogados - seucodigoaqui",
		"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(
			"Modelo Escolhido" => $_POST['imObjectForm_12_1'],
			"Nome do Escritório" => $_POST['imObjectForm_12_2'],
			"Responsável" => $_POST['imObjectForm_12_3'],
			"Insira apenas o nomedo do site a extensão escolhe abaixo" => $_POST['imObjectForm_12_4'],
			"Extensão" => $_POST['imObjectForm_12_5'],
			"Registrar endereço? (R$ 40,00 reais por ano)" => $_POST['imObjectForm_12_6'],
			"Email Principal (Matriz, Filial...etc)" => $_POST['imObjectForm_12_7'],
			"CNPJ do Escritório           (Ex: 82.827.513/0001-35)" => $_POST['imObjectForm_12_8'],
			"Telefone (Matriz, Filial...etc)           (Ex: Matriz (11) 3220-3336; Filial (11) 3220-3337)" => $_POST['imObjectForm_12_9'],
			"Mensagem adiconal" => $_POST['imObjectForm_12_11']
		);

		$files_data = array(
			"Anexo de arquivos ( Compacte os textos e imagens de seu site)" => $_FILES['imObjectForm_12_10']
		);

		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_123_12'], $form_data, $files_data);
			@header('Location: ' . $settings['imEmailForm_123_12']['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