    <!-- Closing container from header.php -->
    </div>

    <footer class="bg-light text-center text-lg-start mt-5 border-top">
        <div class="text-center p-3">
            <p class="mb-0 text-muted small">* Read-Only Mode | No Edit | No Update</p>
            <p class="mb-0">&copy; <?php echo date('Y'); ?> Office System. All rights reserved.</p>
        </div>
    </footer>

    <!-- Bootstrap Bundle with Popper (For pages using header.php/BS5) -->
    <!-- If using with BS4 pages, this might cause conflicts -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>

    <script>
        // Check connection status periodically
        function checkStatus() {
            const statusEl = document.getElementById('connectionStatus');
            if (!statusEl) return; // Exit if element doesn't exist

            fetch('api/check_status.php')
                .then(response => response.json())
                .then(data => {
                    if (data.connected) {
                        statusEl.innerHTML = '<span class="text-success">Connected</span>';
                    } else {
                        statusEl.innerHTML = '<span class="text-danger">Disconnected</span>';
                    }
                })
                .catch(error => {
                    console.error('Error checking status:', error);
                    statusEl.innerHTML = '<span class="text-warning">Error</span>';
                });
        }

        document.addEventListener('DOMContentLoaded', function() {
            // checkStatus();
            // setInterval(checkStatus, 30000); // Disabled to prevent unnecessary requests
        });
    </script>
</body>
</html>
