
<?php
include "db.php";

if ($_SERVER["REQUEST_METHOD"] == "POST") {

    $name = trim($_POST['name']);
    $email = trim($_POST['email']);
    $message = trim($_POST['message']);

    if (!empty($name) && !empty($email) && !empty($message)) {

        $stmt = $conn->prepare("INSERT INTO contact_form_submissions (name, email, message) VALUES (?, ?, ?)");
        $stmt->bind_param("sss", $name, $email, $message);

        if ($stmt->execute()) {
            echo "<script>alert('Message sent successfully!'); window.location.href='contact.php';</script>";
        } else {
            echo "Error: " . $stmt->error;
        }

        $stmt->close();
    } else {
        echo "<script>alert('All fields are required!'); window.history.back();</script>";
    }
}

$conn->close();
?>


<?php include "header.php" ?>
<section class="contact-page-hero">
  <div class="contact-page-container">

    <div class="contact-page-subtitle-wrap">
      <p class="contact-page-subtitle">Stay connected</p>
      <img 
        src="https://cdn.prod.website-files.com/6848312c31807741f8b0d49d/6848312c31807741f8b0d722_Underline%20(2).svg" 
        alt="underline"
        class="contact-page-underline"
      >
    </div>

    <h1 class="contact-page-title">Find all the ways to reach us <br> in one place</h1>

    <p class="contact-page-description">
      Get in touch with us through your preferred method. Whether by phone, email, or social media, we’re here to help. Visit us at our location or follow us online to stay updated.
    </p>

  </div>
</section>
<section class="contact-keycontact-section"> 
  <div class="contact-keycontact-header">
    <h2 class="contact-keycontact-title">KEY CONTACTS</h2>
  </div> 
  <div class="contact-keycontact-strip">
    <div class="contact-keycontact-grid">

      <div class="contact-keycontact-item">
        <h4>Sales</h4>
        <p><a href="#">sales@wellgearoiltools.com</a></p>
      </div>

      <div class="contact-keycontact-divider"></div>

      <div class="contact-keycontact-item">
        <h4>Business Development</h4>
        <p><a href="#">rahul@wellgearoiltools.com</a></p>
      </div>

      <div class="contact-keycontact-divider"></div>

      <div class="contact-keycontact-item">
        <h4>Genral Enquiry</h4>
        <p><a href="#">Info@wellgearoiltools.com</a></p>
      </div>

      <div class="contact-keycontact-divider"></div>

      <div class="contact-keycontact-item">
        <h4>CEO</h4>
        <p><a href="#">Rahul@wellgearoiltools.com</a></p>
      </div>

    </div>
  </div>

</section>
<section class="contact-location-container">

  <h2 class="contact-location-heading">LOCATIONS</h2>

  <div class="contact-location-grid">
 
    <div class="contact-location-item">
      <h3>HEADQUARTERS</h3>
      <div class="icon">
      <i class="fas fa-map-marker-alt"></i> B 14, Sector 62, Noida, Uttar Pradesh – 201309, India Newsletter
    </div>
        <div class="contact-item">
    <div class="icon">
      <i class="fas fa-envelope"></i><a href="Sales@wellgearoiltools.com">Sales@wellgearoiltools.com</a>
    </div>
 <div class="icon">
      <i class="fas fa-envelope"></i><a href="Sales@wellgearoiltools.com">Info@wellgearoiltools.com</a>
    </div>
  </div>
      <i class="fas fa-phone"></i><a href="tel:+91-9315925916">+91-9315925916</a>
    </div>
  </div>
</section>

<div class="contact-form-section">
  <div class="contact-form-container">

    <p class="contact-form-subtitle">
      Let’s start a conversation
      <img src="https://cdn.prod.website-files.com/6848312c31807741f8b0d49d/6848312c31807741f8b0d722_Underline%20(2).svg" alt="">
    </p>

    <h2 class="contact-form-title">Connect with us</h2>

 <form class="contact-form-form" method="POST" action="">

  <div class="contact-form-row">
    <input type="text" name="name" placeholder="Your name" class="contact-form-input" required>
    <input type="email" name="email" placeholder="Your email" class="contact-form-input" required>
  </div>

  <textarea name="message" placeholder="Your message" class="contact-form-textarea" required></textarea>

  <button type="submit" class="contact-form-btn">SUBMIT</button>
</form>
</div>
</div>
<?php include "footer.php"?>