<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['name'])) {$name = $_POST['name'];}
if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
if (isset($_POST['email'])) {$email = $_POST['email'];}
if (isset($_POST['message'])) {$message = $_POST['message'];}
if (isset($_POST['formData'])) {$formData = $_POST['formData'];}
if (isset($_POST['subject'])) {$formData = $_POST['subject'];}
if (isset($_FILES['file'])) {$file = $_FILES['file'];}
if (isset($_POST['house-type'])) {$house = $_POST['house-type'];}
if (isset($_POST['window-type'])) {$wind_type = $_POST['window-type'];}
if (isset($_POST['window-config'])) {$wind_conf = $_POST['window-config'];}
if (isset($_POST['window-material'])) {$wind_mat = $_POST['window-material'];}
if (isset($_POST['window-sytem'])) {$wind_syst = $_POST['window-sytem'];}
if (isset($_POST['window-pack'])) {$wind_paket = $_POST['window-pack'];}
if (isset($_POST['window-size'])) {$size = $_POST['window-size'];}
if (isset($_POST['wmosquito-net'])) {$moskit = $_POST['mosquito-net'];}
if (isset($_POST['sill'])) {$podok = $_POST['sill'];}
if (isset($_POST['sill-material'])) {$podok_mat = $_POST['sill-material'];}
if (isset($_POST['sill-length'])) {$podok_long = $_POST['sill-length'];}
if (isset($_POST['sill-width'])) {$podok_width = $_POST['sill-width'];}
if (isset($_POST['tide'])) {$otliv = $_POST['tide'];}
if (isset($_POST['tide-material'])) {$otliv_mat = $_POST['tide-material'];}
if (isset($_POST['tide-length'])) {$otliv_long = $_POST['tide-length'];}
if (isset($_POST['tide-width'])) {$otliv_width = $_POST['tide-width'];}
if (isset($_POST['slope'])) {$otkos = $_POST['slope'];}
if (isset($_POST['slope-color'])) {$otkos_color = $_POST['slope-color'];}
if (isset($_POST['lamination'])) {$lamin = $_POST['lamination'];}
if (isset($_POST['lamination-side'])) {$lamin_color = $_POST['lamination-side'];}
if (isset($_POST['installation'])) {$montaj = $_POST['installation'];}
if (isset($_POST['installation-type'])) {$montaj_type = $_POST['installation-type'];}
if (isset($_POST['finish-price'])) {$res_Otdelki = $_POST['finish-price'];}
if (isset($_POST['window-price'])) {$res_Okno = $_POST['window-price'];}
if (isset($_POST['all-price'])) {$res_All = $_POST['all-price'];}
if (isset($_POST['finish-type'])) {$var_otdelki = $_POST['finish-type'];}
if (isset($_POST['winterization-type'])) {$var_utepl = $_POST['winterization-type'];}
if (isset($_POST['floor-laying'])) {$floor = $_POST['floor-laying'];}
if (isset($_POST['finish-parapet'])) {$parapet = $_POST['finish-parapet'];}
if (isset($_POST['finish-ceiling'])) {$potolok = $_POST['finish-ceiling'];}
if (isset($_POST['finish-side-walls'])) {$sidewall = $_POST['finish-side-walls'];}
if (isset($_POST['exterior-finish-siding'])) {$siding = $_POST['exterior-finish-siding'];}
if (isset($_POST['electrician'])) {$electric = $_POST['electrician'];}
if (isset($_POST['masonry-foam-blocks'])) {$penoblock = $_POST['masonry-foam-blocks'];}
if (isset($_POST['roof'])) {$roof = $_POST['roof'];}
$to = "s.atlant74@gmail.com, Okna.atlant@mail.ru, kunahov_as@mail.ru"; /*Укажите ваш адрес электронной почты*/
$headers = "Content-type: text/plain; charset = utf-8";
$subject = "$formData";
$message = "$formData\n\nИмя: $name \n\nТелефон: $phone \n\nПочта: $email \n\nТема: $subject \n\nСообщение: $message
\n\nДетали заказа:
\n\n*******************Окно (балкон/лоджия)*******************
\n\nТип дома: $house
\n\nТип изделия: $wind_type $wind_conf $wind_mat $wind_syst $wind_paket
\n\nРазмеры (Ш х В): $size
\n\nСетка: $moskit
\n\nПодоконник: $podok $podok_mat Длина $podok_long Ширина $podok_width
\n\nОтлив: $otliv $otliv_mat Длина $otliv_long Ширина $otliv_width
\n\nОткос: $otkos Цвет $otkos_color
\n\nЛаминация: $lamin Тип $lamin_color
\n\nМонтаж: $montaj Тип $montaj_type
\n\n*******************Отделка балкона (лоджии)*******************
\n\nВариант отделки: $var_otdelki
\n\nВариант утепления: $var_utepl
\n\nПол: $floor
\n\nОграждение: $parapet
\n\nПотолок: $potolok
\n\nСтены: $sidewall
\n\nОтделка сайдингом: $siding
\n\nЭлектрика: $electric
\n\nКладка пеноблока: $penoblock
\n\nУстройство крыши: $roof
\n\nЦена изделия: $res_Okno
\n\nЦена отделки: $res_Otdelki
\n\nОбщая цена: $res_All
";
$send = mail ($to, $subject, $message, $headers);
if ($send == 'true')
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: /spasibo.html");
}
else
{
echo "<center><b>Ошибка. Сообщение не отправлено!</b></center>";
}
} else {
http_response_code(403);
echo "Попробуйте еще раз";
}
?>