<?php include __DIR__ . '/../statistik.php'; ?>

<footer class="footer-bws">

<div class="container py-5">
    <div class="row g-4">

        <!-- INFO -->
        <div class="col-md-5">
            <h4 class="fw-bold">Balai Wilayah Sungai Kalimantan IV Samarinda</h4>
            <p class="mt-3 small">
                Kantor BWS Kalimantan IV Samarinda<br>
                Jl. MT. Haryono No. 36, Samarinda<br>
                Kalimantan Timur - 75123
            </p>
        </div>

        <!-- KONTAK -->
        <div class="col-md-3">
            <h6 class="footer-title">Kontak</h6>
            <ul class="list-unstyled small">
                <li>📞 (0541) 2088390</li>
                <li>✉️ bws.kalimantan.iv.samarinda@pu.go.id</li>
            </ul>
        </div>

        <!-- SOSIAL -->
        <div class="col-md-2">
            <h6 class="footer-title">Media</h6>
            <div class="d-flex gap-3">
                <span>🐦</span>
                <span>📷</span>
                <span>▶️</span>
            </div>
        </div>

        <!-- STATISTIK -->
        <div class="col-md-2">
            <h6 class="footer-title">Statistik</h6>
            <div class="visitor-box">
                <div>Hari ini : <strong><?= $todayCount ?></strong></div>
                <div>Kemarin : <?= $yesterdayCount ?></div>
                <div>Total : <?= $total ?></div>
                <div>Online : <span id="online"><?= $online ?></span></div>
            </div>
        </div>

    </div>
</div>

<div class="footer-bottom">
    © <?= date('Y')?> BWS Kalimantan IV Samarinda - Kementerian Pekerjaan Umum
</div>

</footer>

<!-- AJAX ONLINE -->
<script>
setInterval(() => {
    fetch('online.php')
    .then(res => res.text())
    .then(data => {
        document.getElementById('online').innerText = data;
    });
}, 5000);
</script>

</body>
</html>