[insert_php]

if ($_SERVER[“REQUEST_METHOD”] == “POST”
&& (isset($_POST[“width”]) && $_POST[“width”] > 0
&& isset($_POST[“length”]) && $_POST[“length”] > 0
&& isset($_POST[“colorSelectValue”]) && !empty($_POST[“colorSelectValue”])
&& isset($_POST[“coberturaValue”]) && !empty($_POST[“coberturaValue”])
&& isset($_POST[“fachadaValue”]) && !empty($_POST[“fachadaValue”])
&& isset($_POST[“frontGateValue”]) && !empty($_POST[“frontGateValue”])
&& isset($_POST[“sideGateValue”]) && !empty($_POST[“sideGateValue”])
&& isset($_POST[“contactName”]) && !empty($_POST[“contactName”])
&& isset($_POST[“email”]) && !empty($_POST[“email”])
&& isset($_POST[“phone”]) && !empty($_POST[“phone”])
&& isset($_POST[“contribuinte”]) && !empty($_POST[“contribuinte”])
&& isset($_POST[“info”])
&& isset($_POST[“optradio”]) && !empty($_POST[“optradio”])
//&& ((isset($_POST[“street”]) && !empty($_POST[“street”])
&& (isset($_POST[“locale”]) && !empty($_POST[“locale”])
&& isset($_POST[“postCode”])
&& isset($_POST[“postCodeTxt”])
&& isset($_POST[“mapRegionValue”]) && !empty($_POST[“mapRegionValue”]))
&& !empty($_REQUEST[‘captchaValue’])
&& (!empty($_SESSION[‘captcha’]) && trim(strtolower($_REQUEST[‘captchaValue’])) == “”.$_SESSION[‘captcha’])
)) {

$width = $_POST[“width”];
$length = $_POST[“length”];
$color = $_POST[“colorSelectValue”];
$cobertura = $_POST[“coberturaValue”];
$fachada = $_POST[“fachadaValue”];
$frontGate = $_POST[“frontGateValue”];
$sideGate = $_POST[“sideGateValue”];
$name = $_POST[“contactName”];
$email = $_POST[“email”];
$phone = $_POST[“phone”];
$info = $_POST[“info”];
$montagem = $_POST[“optradio”];
//$street = $_POST[“street”];
$locale = $_POST[“locale”];
$postCode = $_POST[“postCode”];
$postCodeTxt = $_POST[“postCodeTxt”];
$region = $_POST[“mapRegionValue”];
$contribuinte = $_POST[“contribuinte”];

$message =
“Nome: “.$name. “\n\r”.
“Email: “.$email. “\n\r”.
“Telefone: “.$phone. “\n\r”.
“Contribuinte: “.$contribuinte. “\n\r”.
“Informação adicional: “.$info. “\n\r\n\r”.
“Largura: “.$width. ” m\n\r”.
“Comprimento: “.$length. ” m\n\r”.
“Cor: “.$color. “\n\r”.
“Cobertura: “.$cobertura. “\n\r”.
“Fachada: “.$fachada. “\n\r”.
“Portão Fachada Frontal: “.$frontGate. “\n\r”.
“Portão Fachada Lateral: “.$sideGate. “\n\r”.
“Montagem: “.$montagem. “\n\r”.
“Região: “.$region. “\n\r”.
//”Rua: “.$street. “\n\r”.
“Localidade: “.$locale. “\n\r”.
“Código Postal: “.$postCode. ” “.$postCodeTxt. “\n\r”;

//send email to administrator
$adminEmail = get_option( ‘admin_email’ );
//$adminEmail = $email;
wp_mail($adminEmail, ‘Novo pedido de Orçamento’, $message );

$FileLocation = “/wp-content/themes/orcamento/partials/submit-quotation-ok.php”;
include($_SERVER[‘DOCUMENT_ROOT’].$FileLocation);

} else{
$FileLocation = “/wp-content/themes/orcamento/partials/main.php”;
include($_SERVER[‘DOCUMENT_ROOT’].$FileLocation);
}

[/insert_php]