<footer class="footer">
  <div class="container">
    <?php
// STEP 2E FOOTER DYNAMIC


if (!function_exists('app_setting')) {
    function app_setting(PDO $pdo, string $key, string $default = ''): string {
        try {
            $stmt = $pdo->prepare("SELECT setting_value FROM app_settings WHERE setting_key = ? LIMIT 1");
            $stmt->execute([$key]);
            $value = $stmt->fetchColumn();
            return ($value !== false && $value !== null && $value !== '') ? (string)$value : $default;
        } catch (Throwable $e) {
            return $default;
        }
    }
}

$footerText = app_setting($pdo, 'footer_text', '<?php echo h($footerText); ?>')); ?>
  </div>
</footer>
<script>
if ('serviceWorker' in navigator) {
  navigator.serviceWorker.register('/men/service-worker.js');
}
</script>
</body>
</html>
