[ 'language' => 'English', 'title' => 'צלם לאירועים', 'subtitle' => 'הדפסת מגנטים במהלך האירוע', 'description' => 'צלם מקצועי שמציע צילום והדפסת מגנטים במהלך האירוע שלכם. חתונה, בר/בת מצווה, חלוקה, ברית מילה ועוד!', 'events' => 'סוגי אירועים', 'wedding' => 'חתונה', 'bar_mitzvah' => 'בר מצווה', 'bat_mitzvah' => 'בת מצווה', 'chalakeh' => 'חלוקה', 'brit_mila' => 'ברית מילה', 'contact_form' => 'טופס יצירת קשר', 'name' => 'שם מלא', 'email' => 'דוא"ל', 'phone' => 'מספר טלפון', 'event_type' => 'סוג האירוע', 'event_date' => 'תאריך האירוע', 'location' => 'מיקום האירוע', 'message' => 'הודעה', 'placeholder_message' => 'ספרו לנו על האירוע שלכם ומה אתם צריכים', 'send_message' => 'שלח הודעה', 'contact_whatsapp' => 'או צרו קשר ב-WhatsApp', 'contact_whatsapp_button' => 'WhatsApp', 'success_message' => 'הודעתך נשלחה בהצלחה! נחזור אליך בקרוב', 'error_message' => 'אירעה שגיאה בשליחת ההודעה. אנא נסה שוב', 'validation_error' => 'אנא מלאו את כל השדות הנדרשים עם פרטים תקינים', 'back_home' => 'חזרה לעמוד הבית', ], 'en' => [ 'language' => 'עברית', 'title' => 'Event Photographer', 'subtitle' => 'Magnet Printing During Your Event', 'description' => 'Professional photographer offering on-site magnet printing for your event. Weddings, Bar/Bat Mitzvah, Chalakeh, Brit Mila, and more!', 'events' => 'Event Types', 'wedding' => 'Wedding', 'bar_mitzvah' => 'Bar Mitzvah', 'bat_mitzvah' => 'Bat Mitzvah', 'chalakeh' => 'Chalakeh', 'brit_mila' => 'Brit Mila', 'contact_form' => 'Contact Form', 'name' => 'Full Name', 'email' => 'Email', 'phone' => 'Phone Number', 'event_type' => 'Event Type', 'event_date' => 'Event Date', 'location' => 'Event Location', 'message' => 'Message', 'placeholder_message' => 'Tell us about your event and what you need', 'send_message' => 'Send Message', 'contact_whatsapp' => 'Or contact us on WhatsApp', 'contact_whatsapp_button' => 'WhatsApp', 'success_message' => 'Your message was sent successfully! We\'ll get back to you soon', 'error_message' => 'An error occurred while sending the message. Please try again', 'validation_error' => 'Please fill in all required fields with valid details', 'back_home' => 'Back to Home', ] ]; $t = $translations[$lang]; $error = ''; $success = ''; // Handle form submission if ($_SERVER['REQUEST_METHOD'] === 'POST') { $name = trim($_POST['name'] ?? ''); $email = trim($_POST['email'] ?? ''); $phone = trim($_POST['phone'] ?? ''); $event_type = trim($_POST['event_type'] ?? ''); $event_date = trim($_POST['event_date'] ?? ''); $location = trim($_POST['location'] ?? ''); $message = trim($_POST['message'] ?? ''); // Validate if (empty($name) || empty($email) || empty($phone) || empty($event_type) || empty($event_date) || empty($location)) { $error = $t['validation_error']; } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $error = $t['validation_error']; } else { // Send email to photographer $subject = ($lang === 'he') ? 'בקשה חדשה לאירוע' : 'New Event Request'; $safeName = htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); $safeEmail = htmlspecialchars($email, ENT_QUOTES, 'UTF-8'); $safePhone = htmlspecialchars($phone, ENT_QUOTES, 'UTF-8'); $safeEventType = htmlspecialchars($event_type, ENT_QUOTES, 'UTF-8'); $safeEventDate = htmlspecialchars($event_date, ENT_QUOTES, 'UTF-8'); $safeLocation = htmlspecialchars($location, ENT_QUOTES, 'UTF-8'); $safeMessage = htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); $body = ($lang === 'he') ? "בקשה חדשה לאירוע\n\n" . "שם: $safeName\n" . "דוא\"ל: $safeEmail\n" . "טלפון: $safePhone\n" . "סוג האירוע: $safeEventType\n" . "תאריך: $safeEventDate\n" . "מיקום: $safeLocation\n" . "הודעה: $safeMessage" : "New Event Request\n\n" . "Name: $safeName\n" . "Email: $safeEmail\n" . "Phone: $safePhone\n" . "Event Type: $safeEventType\n" . "Date: $safeEventDate\n" . "Location: $safeLocation\n" . "Message: $safeMessage"; $emailService = new EmailService(); if ($emailService->send(PHOTOGRAPHER_EMAIL, $subject, $body)) { $success = $t['success_message']; } else { $error = $t['error_message']; } } } ?>