setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $db->query("SELECT theme_id FROM themes LIMIT 1"); $currentThemeNumber = $stmt->fetchColumn(); $currentTheme = 'theme_' . $currentThemeNumber; } catch (PDOException $e) { $currentTheme = null; } $themes = range(1, 6); $page_content = '
'; foreach ($themes as $theme) { $theme_id = "theme_$theme"; $theme_image = $static_url . "media/themes/$theme_id.png"; $isChecked = ($currentTheme === $theme_id) ? 'checked' : ''; $activeClass = ($currentTheme === $theme_id) ? 'active-theme' : ''; $page_content .= '
Theme ' . $theme . '
'; } $page_content .= '
'; $page_content .= ' '; include 'includes/layout.php'; ?>