style: add some style 5 (modal form 2)

This commit is contained in:
2026-06-05 12:07:31 +03:00
parent e6ea4f948e
commit 9e006c2572
2 changed files with 74 additions and 32 deletions

View File

@@ -1,32 +1,39 @@
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = strip_tags(trim($_POST["name"]));
$phone = strip_tags(trim($_POST["phone"]));
$email = strip_tags(trim($_POST["email"]));
header('Content-Type: application/json; charset=utf-8');
//$to = "receptionadmin@o-arena.ru"; // поменяй на свой реальный email
$to = "rid89@mail.ru"; // поменяй на свой реальный email
$subject = "Новая заявка с сайта OlimpArena";
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
echo json_encode(["status" => "error", "message" => "Неверный запрос"]);
exit;
}
$message = "Имя: $name\n";
$message .= "Телефон: $phone\n";
$message .= "Email: $email\n";
$message .= "Дата отправки: " . date('d.m.Y H:i') . "\n";
$name = trim(strip_tags($_POST["name"] ?? ""));
$phone = trim(strip_tags($_POST["phone"] ?? ""));
$email = trim(strip_tags($_POST["email"] ?? ""));
$headers = "From: no-reply@olimparena.aiconversion.ru\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
if (empty($name) || empty($phone)) {
echo json_encode(["status" => "error", "message" => "Имя и телефон обязательны"]);
exit;
}
if (mail($to, $subject, $message, $headers)) {
// Можно перенаправить на успех
header("Location: index.html#booking-success-modal");
// или показать JSON для JS
echo json_encode(["status" => "success"]);
} else {
echo json_encode(["status" => "error"]);
}
//$to = "receptionadmin@o-arena.ru"; // ← Измени на свой реальный email!
$to = "rid89@mail.ru";
$subject = "Новая заявка с сайта OlimpArena";
$message = "📩 Новая заявка из всплывающего окна\n\n";
$message .= "Имя: $name\n";
$message .= "Телефон: $phone\n";
$message .= "Email: $email\n\n";
$message .= "Дата: " . date('d.m.Y H:i:s') . "\n";
$headers = "From: no-reply@olimparena.aiconversion.ru\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
if (mail($to, $subject, $message, $headers)) {
echo json_encode(["status" => "success"]);
} else {
http_response_code(403);
echo "Доступ запрещён";
error_log("Mail error: " . print_r(error_get_last(), true));
echo json_encode(["status" => "error", "message" => "Не удалось отправить письмо"]);
}
?>