<?php
if (isset($_POST["submit_btn"])) {
    // Collect form data
    $firstName = $_POST['firstName'];
    $lastName = $_POST['lastName'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $investment = $_POST['investment'];
    $caseOutline = $_POST['caseOutline'];

    // Email content
    $to = 'noreply@fraud-payback.com';
    $subject = 'Consultation Form Submission';
    $message = "First Name: $firstName\n" .
               "Last Name: $lastName\n" .
               "Phone: $phone\n" .
               "Email: $email\n" .
               "Investment: $investment\n" .
               "Case Outline:\n$caseOutline\n";

    // Headers
    $headers = "From: $firstName $lastName <$email>\r\n" .
               "Reply-To: $email\r\n" .
               "X-Mailer: PHP/" . phpversion();

    // Send the email
    if (mail($to, $subject, $message, $headers)) {
        echo "<script>alert('Your consultation request has been submitted successfully. We will contact you shortly.')</script>";
    } else {
        echo "<script>alert('Oops! Something went wrong. Please try again later.')</script>";
    }
}


/*
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';

if (isset($_POST["submit_btn"])) {
    // Collect form data
    $firstName = $_POST['firstName'];
    $lastName = $_POST['lastName'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $investment = $_POST['investment'];
    $caseOutline = $_POST['caseOutline'];

    // Create a new PHPMailer instance
    $mail = new PHPMailer(true);

    try {
        // Server settings
        $mail->isSMTP();                                      // Set mailer to use SMTP
        $mail->Host = 'mail.fraud-payback.com';               // Specify main and backup SMTP servers
        $mail->SMTPAuth = true;                               // Enable SMTP authentication
        $mail->Username = 'noreply@fraud-payback.com';           // SMTP username
        $mail->Password = 'noreply@fraud-payback.com';              // SMTP password (replace with the actual password)
        $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
        $mail->Port = 465;                                    // TCP port to connect to

        // Recipients
        $mail->setFrom($email, "$firstName $lastName");       // Set sender's email and name
        $mail->addAddress('noreply@fraud-payback.com');          // Add a recipient

        // Content
        $mail->isHTML(false);                                 // Set email format to plain text
        $mail->Subject = 'Consultation Form Submission';
        $mail->Body    = "First Name: $firstName\n" .
                         "Last Name: $lastName\n" .
                         "Phone: $phone\n" .
                         "Email: $email\n" .
                         "Investment: $investment\n" .
                         "Case Outline:\n$caseOutline\n";

        // Send the email
        $mail->send();
        echo "<script>alert('Your consultation request has been submitted successfully. We will contact you shortly.')</script>";
    } catch (Exception $e) {
        echo "<script>alert('Oops! Something went wrong. Please try again later. Error: {$mail->ErrorInfo}')</script>";
    }
}

*/

?>


<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>Contact Us - Fraud PayBack - Trading & Investment Scam Funds & Recovery</title>
  <?php include("header-links.php"); ?> 
</head>

<body>

 <?php include("header.php"); ?>

   <!-- ======= Breadcrumbs ======= -->
   <div class="breadcrumbs">
      <div class="page-header d-flex align-items-center" style="background-color: blue');">
        <div class="container position-relative">
          <div class="row d-flex justify-content-center">
            <div class="col-lg-6 text-center">
              <h2>Contact</h2>
              <p>
                Get in touch to get your funds back
              </p>
            </div>
          </div>
        </div>
      </div>
      <nav>
        <div class="container">
          <ol>
            <li><a href="index.php">Home</a></li>
            <li>Contact</li>
          </ol>
        </div>
      </nav>
    </div><!-- End Breadcrumbs -->
 
  <main id="main">

    <div class="container">

     <div class="row my-4" style="align-items: center;">
      <div class="col-md-8 shadow p-4">

        <h5 style="font-weight: bolder;">Have you been scammed and want to recover your funds? Get a free consultation.</h5>
        <hr>
      <form action="" method="post">
  <div class="form-row">
    <div class="form-group mb-3">
      <label for="firstName">First Name</label>
      <input type="text" class="form-control" name="firstName" id="firstName" placeholder="Enter First Name" required>
    </div>
    <div class="form-group mb-3">
      <label for="lastName">Last Name</label>
      <input type="text" class="form-control" name="lastName" id="lastName" placeholder="Enter Last Name" required>
    </div>
  </div>
  <div class="form-row">
    <div class="form-group mb-3">
      <label for="phone">Phone</label>
      <input type="tel" class="form-control" name="phone" id="phone" placeholder="Enter Phone Number" required>
    </div>
    <div class="form-group mb-3">
      <label for="email">Email</label>
      <input type="email" class="form-control" name="email" id="email" placeholder="Enter Email" required>
    </div>
  </div>
  <div class="form-row">
    <div class="form-group mb-3">
      <label for="investment">How much did you invest?</label>
      <input type="number" class="form-control" name="investment" id="investment" placeholder="E.g. $300000" required>
    </div>
  </div>
  <div class="form-row">
    <div class="form-group mb-3">
      <label for="caseOutline">Outline your case</label>
      <textarea class="form-control" name="caseOutline" id="caseOutline" rows="3" placeholder="Enter Details" required></textarea>
    </div>
  </div>
  <button type="submit" class="btn btn-primary w-100 btn-lg" name="submit_btn">Get a Free Consultation</button>
</form>

      </div>

      <div class="col-md-4 p-4">
        <img src="assets/img/the_logo.jpg" class="img-fluid">
      </div>

     </div>

    </div>

 
  </main><!-- End #main -->

  <?php include("footer.php"); ?>
  <?php include("footer-links.php"); ?>

</body>

</html>