109 lines
5.1 KiB
PHP
109 lines
5.1 KiB
PHP
<?php
|
|
$title = "Contact Us";
|
|
require_once __DIR__ . '/includes/header.php';
|
|
require_once __DIR__ . '/mail/MailService.php';
|
|
|
|
$success = '';
|
|
$error = '';
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
$name = $_POST['name'] ?? '';
|
|
$email = $_POST['email'] ?? '';
|
|
$message = $_POST['message'] ?? '';
|
|
|
|
if (empty($name) || empty($email) || empty($message)) {
|
|
$error = "Please fill in all fields.";
|
|
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
$error = "Invalid email address.";
|
|
} else {
|
|
$res = MailService::sendContactMessage($name, $email, $message);
|
|
if (!empty($res['success'])) {
|
|
$success = "Your message has been sent successfully! We'll get back to you soon.";
|
|
} else {
|
|
$error = "Failed to send message: " . ($res['error'] ?? 'Unknown error');
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
|
|
<section>
|
|
<div class="container">
|
|
<div class="section-header">
|
|
<h1 class="text-gradient">Get in Touch</h1>
|
|
<p>Have questions about a listing or want to partner with us? Our team is here to help.</p>
|
|
</div>
|
|
|
|
<div class="contact-layout">
|
|
<!-- Contact Form -->
|
|
<div class="glass-card" style="padding: 3rem;">
|
|
<?php if ($success): ?>
|
|
<div style="background: rgba(16, 185, 129, 0.1); border: 1px solid var(--success); color: var(--success); padding: 1.25rem; border-radius: var(--radius-md); margin-bottom: 2rem; text-align: center; font-weight: 600;">
|
|
✓ <?php echo $success; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($error): ?>
|
|
<div style="background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); padding: 1.25rem; border-radius: var(--radius-md); margin-bottom: 2rem; text-align: center; font-weight: 600;">
|
|
⚠ <?php echo $error; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<form action="contact.php" method="POST">
|
|
<div class="form-group">
|
|
<label for="name">Full Name</label>
|
|
<input type="text" id="name" name="name" class="form-control" placeholder="Enter your name" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="email">Email Address</label>
|
|
<input type="email" id="email" name="email" class="form-control" placeholder="Enter your email" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="message">Your Message</label>
|
|
<textarea id="message" name="message" class="form-control" placeholder="Tell us what you're looking for..." required></textarea>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 1.25rem; font-size: 1.1rem; margin-top: 1rem;">Send Secure Message</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Locations -->
|
|
<div class="contact-info">
|
|
<h2 style="margin-bottom: 2rem;">Our Locations</h2>
|
|
|
|
<div class="glass-card location-card">
|
|
<h4>Kabul Headquarters (Main)</h4>
|
|
<p style="color: var(--text-muted);">Wazir Akbar Khan, District 10<br>Kabul, Afghanistan</p>
|
|
<p style="margin-top: 0.5rem; font-size: 0.9rem; color: var(--primary);">+93 700 123 456</p>
|
|
</div>
|
|
|
|
<div class="glass-card location-card">
|
|
<h4>Herat Regional Branch</h4>
|
|
<p style="color: var(--text-muted);">Jade-e-Pashtun Road<br>Herat, Afghanistan</p>
|
|
</div>
|
|
|
|
<div class="glass-card location-card">
|
|
<h4>Kandahar Sales Office</h4>
|
|
<p style="color: var(--text-muted);">Aino Mena, Phase 2<br>Kandahar, Afghanistan</p>
|
|
</div>
|
|
|
|
<div class="glass-card location-card">
|
|
<h4>Mazar-i-Sharif Hub</h4>
|
|
<p style="color: var(--text-muted);">Balkh Gate Street<br>Mazar-i-Sharif, Afghanistan</p>
|
|
</div>
|
|
|
|
<div class="glass-card location-card" style="border-color: var(--secondary);">
|
|
<h4>Buner International Office</h4>
|
|
<p style="color: var(--text-muted);">Main Bazar Daggar<br>District Buner, Pakistan</p>
|
|
<p style="margin-top: 0.5rem; font-size: 0.9rem; color: var(--secondary);">+92 939 123456</p>
|
|
</div>
|
|
|
|
<div style="margin-top: 3rem;">
|
|
<h3>General Inquiries</h3>
|
|
<p style="color: var(--text-muted); margin-top: 1rem;">Email: info@afgcars.com</p>
|
|
<p style="color: var(--text-muted);">Support: support@afgcars.com</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|