<?php
include 'includes/db.php';
include 'includes/header.php';
// Fetch content from the database
$sql = "SELECT * FROM about_content";
$result = $conn->query($sql);
$content = [];
if ($result && $result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$content[$row['section']] = $row;
}
}
?>
<main class="container my-5 pt-5">
<div class="text-center mb-5">
<h2 data-aos="fade-in"><?php echo htmlspecialchars($content['hero']['title'] ?? 'من نحن'); ?></h2>
<p data-aos="fade-in" data-aos-delay="100" class="text-muted"><?php echo htmlspecialchars($content['hero']['content'] ?? 'قصتنا، رؤيتنا، وقيمنا.'); ?></p>
</div>
<div class="glass-card p-4 p-md-5">
<div class="row align-items-center g-5">
<div class="col-lg-6" data-aos="fade-left">
<img src="<?php echo htmlspecialchars($content['story']['image_url'] ?? 'https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop'); ?>" class="img-fluid rounded shadow-lg">
</div>
<div class="col-lg-6" data-aos="fade-right">
<h3><?php echo htmlspecialchars($content['story']['title'] ?? 'قصتنا'); ?></h3>
<p><?php echo ($content['story']['content'] ?? 'تأسست M-AUTO بشغف حقيقي تجاه عالم السيارات...'); ?></p>
</div>
</div>
<hr class="my-5">
<div class="row align-items-center g-5">
<div class="col-lg-6 order-lg-2" data-aos="fade-right">
<img src="<?php echo htmlspecialchars($content['vision']['image_url'] ?? 'https://images.unsplash.com/photo-1556740738-b6a63e27c4df?q=80&w=2070&auto=format&fit=crop'); ?>" class="img-fluid rounded shadow-lg">
</div>
<div class="col-lg-6 order-lg-1" data-aos="fade-left">
<h3><?php echo htmlspecialchars($content['vision']['title'] ?? 'رؤيتنا ومهمتنا'); ?></h3>
<div><?php echo ($content['vision']['content'] ?? '<strong>رؤيتنا:</strong>...'); ?></div>
</div>
</div>
</div>
</main>
<?php include 'includes/footer.php'; ?>