<?php
include '../config/koneksi.php';
$setting = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM setting LIMIT 1"));
?>

</main>

<footer id="footer" class="footer light-background">
  <div class="container footer-top">
    <div class="row gy-4">

      <!-- Kiri: Logo, Nama, Tagline -->
      <div class="col-lg-4 col-md-6 footer-about">
        <a href="index.php" class="logo d-flex align-items-center">
          <?php if (!empty($setting['logo'])): ?>
            <img src="../uploads/logo/<?= $setting['logo']; ?>" alt="Logo" height="40">
          <?php endif; ?>
          <span class="sitename ms-2"><?= $setting['nama_madrasah']; ?></span>
        </a>
        <p class="pt-2"><?= $setting['tagline']; ?></p>
      </div>

      <!-- Tengah: Info Kontak -->
      <div class="col-lg-4 col-md-6 footer-contact">
        <h4>Kontak Kami</h4>
        <p><?= nl2br($setting['alamat']); ?></p>
        <p><strong>Phone:</strong> <span><?= $setting['telepon']; ?></span></p>
        <p><strong>Email:</strong> <span><?= $setting['email']; ?></span></p>
      </div>

      <!-- Kanan: Media Sosial -->
      <div class="col-lg-4 col-md-6">
        <h4>Media Sosial</h4>
        <div class="social-links d-flex mt-2">
          <?php if ($setting['x']) : ?><a href="<?= $setting['x']; ?>" target="_blank"><i class="bi bi-twitter-x"></i></a><?php endif; ?>
          <?php if ($setting['facebook']) : ?><a href="<?= $setting['facebook']; ?>" target="_blank"><i class="bi bi-facebook"></i></a><?php endif; ?>
          <?php if ($setting['instagram']) : ?><a href="<?= $setting['instagram']; ?>" target="_blank"><i class="bi bi-instagram"></i></a><?php endif; ?>
          <?php if ($setting['whatsapp']) : ?><a href="<?= $setting['whatsapp']; ?>" target="_blank"><i class="bi bi-whatsapp"></i></a><?php endif; ?>
        </div>
      </div>

    </div>
  </div>

  <div class="container copyright text-center mt-4">
    <p>© <span>Copyright</span> <strong class="px-1 sitename"><?= $setting['nama_madrasah']; ?></strong> <span>All Rights Reserved</span></p>
  </div>
</footer>

<!-- Scroll Top -->
<a href="#" id="scroll-top" class="scroll-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>

<!-- Preloader -->
<div id="preloader"></div>

<!-- Vendor JS Files -->
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<script src="assets/vendor/aos/aos.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/imagesloaded/imagesloaded.pkgd.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>

<!-- Main JS File -->
<script src="assets/js/main.js"></script>

</body>
</html>