diff --git a/beetle.php b/beetle.php index cf4dfe4..6842766 100644 --- a/beetle.php +++ b/beetle.php @@ -37,7 +37,7 @@

Request for Booking

Fill your requirement to us. We will check your request and contact you soon.

-
+
diff --git a/contact.php b/contact.php index b777982..8a9d7fc 100644 --- a/contact.php +++ b/contact.php @@ -1,42 +1,4 @@ - - - - -
- - - - -
- - - - -
+
@@ -81,6 +43,7 @@
+
diff --git a/fordecosport.php b/fordecosport.php index 97d41e9..4df0c5e 100644 --- a/fordecosport.php +++ b/fordecosport.php @@ -37,7 +37,7 @@

Request for Booking

Fill your requirement to us. We will check your request and contact you soon.

- +
diff --git a/header.php b/header.php index e4f6eb5..2b2c374 100644 --- a/header.php +++ b/header.php @@ -1,3 +1,42 @@ + + + + +
+ + + + +
+ + + + + diff --git a/hondacity.php b/hondacity.php index ae86337..200bb60 100644 --- a/hondacity.php +++ b/hondacity.php @@ -37,7 +37,7 @@

Request for Booking

Fill your requirement to us. We will check your request and contact you soon.

- +
diff --git a/mailBooking.php b/mailBooking.php new file mode 100644 index 0000000..3d7f47d --- /dev/null +++ b/mailBooking.php @@ -0,0 +1,264 @@ + +isSMTP(); + $userMail->Host = 'smtp.gmail.com'; + $userMail->SMTPAuth = true; + $userMail->Username = 'noreply.nclex.email@gmail.com'; + $userMail->Password = 'gmbe nypd ofcl vpmi'; + $userMail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + $userMail->Port = 587; + + // User Email Configuration + $userMail->setFrom('noreply.nclex.email@gmail.com', $support_name); + $userMail->addAddress($user_email); + $userMail->isHTML(true); + $userMail->Subject = "Thank you for contacting ". $support_name; + + // Embed logo + $userMail->addEmbeddedImage('img/logo/logo-trans.png', 'logo_cid'); + + // User Email Template (Responsive & clean design) + $userMail->Body = << + + + + Booking Confirmation + + + + + + + +HTML; + + /*** Admin Notification Email ***/ + $adminMail = new PHPMailer(true); + + // SMTP Configuration + $adminMail->isSMTP(); + $adminMail->Host = 'smtp.gmail.com'; + $adminMail->SMTPAuth = true; + $adminMail->Username = 'noreply.nclex.email@gmail.com'; + $adminMail->Password = 'gmbe nypd ofcl vpmi'; + $adminMail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + $adminMail->Port = 587; + + $adminMail->setFrom('noreply.nclex.email@gmail.com', $support_name); + $adminMail->addAddress($company_email); + $adminMail->addReplyTo($user_email, $name); + $adminMail->isHTML(true); + $adminMail->Subject = "New Booking Request: {$subject}"; + + // Embed logo for admin email + $adminMail->addEmbeddedImage('img/logo/logo-trans.png', 'logo_cid'); + + $currentDateTime = date('Y-m-d H:i:s'); + + // Admin Email Template (all details nicely presented) + $adminMail->Body = << + + + + New Booking Request + + + + + + + +HTML; + + // Send the emails + $userMail->send(); + $adminMail->send(); + + // Redirect back to the referring page with a success status + $redirectUrl = buildRedirectUrl('success'); + header("Location: $redirectUrl"); + exit(); + + } catch (Exception $e) { + // On error, encode the message and redirect back with the error status + $errorMessage = "&message=" . urlencode($e->getMessage()); + $redirectUrl = buildRedirectUrl('error', $errorMessage); + header("Location: $redirectUrl"); + exit(); + } + + } else { + // Missing fields: redirect back with missing_fields status + $redirectUrl = buildRedirectUrl('missing_fields'); + header("Location: $redirectUrl"); + exit(); + } +} + +// Include header after potential redirects +include('header.php'); + +// Handle status messages (this part is optional if you want to display messages on the referring page) +if (isset($_GET['status'])) { + switch ($_GET['status']) { + case 'success': + echo "

✅ Your message has been sent successfully!

"; + break; + case 'error': + $error = isset($_GET['message']) ? htmlspecialchars($_GET['message']) : "There was an error sending your message. Please try again."; + echo "

❌ $error

"; + break; + case 'missing_fields': + echo "

⚠️ Please fill in all the required fields.

"; + break; + } +} +?> \ No newline at end of file diff --git a/mail.php b/mailContact.php similarity index 96% rename from mail.php rename to mailContact.php index 4cfbca2..3a0c00e 100644 --- a/mail.php +++ b/mailContact.php @@ -1,13 +1,8 @@ + Port = 587; // User Email Configuration - $userMail->setFrom('noreply.nclex.email@gmail.com', 'NCLEX Support'); + $userMail->setFrom('noreply.nclex.email@gmail.com', $support_name); $userMail->addAddress($user_email); $userMail->isHTML(true); - $userMail->Subject = "Thank you for contacting NCLEX Support"; + $userMail->Subject = "Thank you for contacting " . $support_name; // Embed logo $userMail->addEmbeddedImage('img/logo/logo-trans.png', 'logo_cid'); @@ -63,6 +58,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {