BLACKSITE
:
216.73.216.140
:
199.188.200.160 / jeddahhousingltd.com
:
Linux server383.web-hosting.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
:
/
home
/
jeddveug
/
www
/
Upload File:
files >> /home/jeddveug/www/offer_details.php
<?php require_once 'config/db.php'; $id = (int)($_GET['id'] ?? 0); if (!$id) { header('Location: ' . baseUrl('index.php')); exit; } $stmt = $pdo->prepare("SELECT * FROM offers WHERE id = ? AND status = 'active'"); $stmt->execute([$id]); $offer = $stmt->fetch(); if (!$offer) { header('Location: ' . baseUrl('index.php')); exit; } $page_title = $offer['title']; $meta_description = $offer['short_description'] ?: 'Special offer from Jeddah Housing Ltd. — ' . $offer['title']; // Handle inquiry submission $success = false; $errors = []; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $name = trim(($_POST['first_name'] ?? '') . ' ' . ($_POST['last_name'] ?? '')); $phone = trim($_POST['phone'] ?? ''); $email = trim($_POST['email'] ?? ''); $address = trim($_POST['address'] ?? ''); $message = trim($_POST['message'] ?? ''); if (!$name || $name === ' ') $errors[] = 'Name is required.'; if (!$phone) $errors[] = 'Phone number is required.'; if (!$message) $errors[] = 'Message is required.'; if (empty($errors)) { $stmt = $pdo->prepare("INSERT INTO messages (name, phone, email, address, message, offer_id, type) VALUES (?,?,?,?,?,?,?)"); $stmt->execute([$name, $phone, $email, $address, $message, $id, 'offer_inquiry']); $success = true; } } require_once 'includes/header.php'; ?> <!-- Breadcrumb --> <div class="bg-primary-900 pt-24 pb-10"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="flex items-center text-sm text-primary-200 mb-3"> <a href="<?= baseUrl('/') ?>" class="hover:text-gold-400 transition-colors">Home</a> <i class="fas fa-chevron-right text-xs mx-2 text-primary-400"></i> <a href="<?= baseUrl('/') ?>#offers" class="hover:text-gold-400 transition-colors">Offers</a> <i class="fas fa-chevron-right text-xs mx-2 text-primary-400"></i> <span class="text-gold-400"><?= htmlspecialchars($offer['title']) ?></span> </div> <h1 class="text-3xl md:text-4xl font-bold text-white"><?= htmlspecialchars($offer['title']) ?></h1> </div> </div> <section class="py-12 bg-gray-50"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> <!-- Offer Details --> <div class="lg:col-span-2"> <div class="bg-white rounded-2xl shadow-sm overflow-hidden"> <?php if ($offer['image']): ?> <img src="<?= baseUrl('uploads/offers/' . htmlspecialchars($offer['image'])) ?>" class="w-full h-64 md:h-96 object-cover" alt="<?= htmlspecialchars($offer['title']) ?>"> <?php else: ?> <div class="w-full h-64 md:h-96 bg-gradient-to-br from-primary-600 to-primary-800 flex items-center justify-center"> <i class="fas fa-tags text-white/30 text-6xl"></i> </div> <?php endif; ?> <div class="p-8"> <div class="flex flex-wrap items-center gap-4 mb-6"> <?php if ($offer['discount_price']): ?> <span class="bg-red-100 text-red-600 px-4 py-1.5 rounded-full text-sm font-semibold">Special Offer</span> <span class="text-gray-400 line-through text-lg"><?= htmlspecialchars($offer['price']) ?></span> <span class="text-primary-700 font-bold text-2xl"><?= htmlspecialchars($offer['discount_price']) ?></span> <?php elseif ($offer['price']): ?> <span class="text-primary-700 font-bold text-2xl"><?= htmlspecialchars($offer['price']) ?></span> <?php endif; ?> </div> <?php if ($offer['short_description']): ?> <p class="text-gray-600 text-lg mb-6 leading-relaxed"><?= htmlspecialchars($offer['short_description']) ?></p> <?php endif; ?> <?php if ($offer['description']): ?> <div class="prose max-w-none text-gray-600 leading-relaxed"> <?= nl2br(htmlspecialchars($offer['description'])) ?> </div> <?php endif; ?> </div> </div> </div> <!-- Inquiry Form --> <div> <div class="bg-white rounded-2xl shadow-sm p-6 sticky top-24"> <h3 class="text-xl font-bold text-gray-800 mb-2">Interested in this offer?</h3> <p class="text-gray-500 text-sm mb-6">Send us a message and we'll get back to you shortly.</p> <?php if ($success): ?> <div class="bg-green-100 text-green-700 px-4 py-3 rounded-xl text-sm mb-4 text-center font-medium"> ✅ Your inquiry has been sent! We'll contact you soon. </div> <?php endif; ?> <?php if (!empty($errors)): ?> <div class="bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-xl mb-4 text-sm"> <?php foreach ($errors as $err): ?><p>• <?= htmlspecialchars($err) ?></p><?php endforeach; ?> </div> <?php endif; ?> <form method="POST" class="space-y-4"> <div class="grid grid-cols-2 gap-3"> <div> <label class="block text-xs font-medium text-gray-600 mb-1">First Name *</label> <input type="text" name="first_name" required class="w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm"> </div> <div> <label class="block text-xs font-medium text-gray-600 mb-1">Last Name</label> <input type="text" name="last_name" class="w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm"> </div> </div> <div> <label class="block text-xs font-medium text-gray-600 mb-1">Phone *</label> <input type="tel" name="phone" required class="w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm"> </div> <div> <label class="block text-xs font-medium text-gray-600 mb-1">Email</label> <input type="email" name="email" class="w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm"> </div> <div> <label class="block text-xs font-medium text-gray-600 mb-1">Address</label> <input type="text" name="address" class="w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm"> </div> <div> <label class="block text-xs font-medium text-gray-600 mb-1">Message *</label> <textarea name="message" rows="4" required class="w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm" placeholder="I'm interested in this offer..."></textarea> </div> <button type="submit" class="w-full bg-gold-400 hover:bg-gold-500 text-primary-900 py-3 rounded-xl font-semibold transition-all hover:shadow-lg text-sm"> <i class="fas fa-paper-plane mr-2"></i> Send Inquiry </button> </form> <div class="mt-6 pt-6 border-t"> <p class="text-xs text-gray-500 mb-3">Or contact us directly:</p> <a href="tel:+8801626757577" class="flex items-center text-sm text-primary-700 hover:text-primary-800 mb-2"><i class="fas fa-phone mr-2 text-gold-400"></i>+880 1626-757577</a> <a href="mailto:info@jeddahhousing.com" class="flex items-center text-sm text-primary-700 hover:text-primary-800"><i class="fas fa-envelope mr-2 text-gold-400"></i>info@jeddahhousing.com</a> </div> </div> </div> </div> </div> </section> <?php require_once 'includes/footer.php'; ?>