<?php
/**
 * 芋头CMS
 * ============================================================================
 * 版权所有 2016-2028 沅陵县乌托邦网络服务有限公司，并保留所有权利。
 * 网站地址: http://www.yutoucms.cn
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷。
 * ============================================================================
 * Author: 芋头 <mxgsf@qq.com>
 * Date: 2026-6-1
 */
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$pageData = $db->fetch("SELECT * FROM {$db->table('page')} WHERE id = ?", [$id]);
if(empty($pageData)) { header('Location: /'); exit; }
$channel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE id = ?", [$pageData['channel_id']]);
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($pageData['title']); ?> - <?php echo htmlspecialchars($site['site_name']); ?></title>
<link rel="stylesheet" href="<?php echo $site['template_dir']; ?>css/style.css">
</head>
<body>
<?php include __DIR__ . '/_header.php'; ?>

<div class="channel-banner channel-banner-page">
<div class="container">
<h1><?php echo htmlspecialchars($pageData['title']); ?></h1>
</div>
</div>

<div class="breadcrumb">
<div class="container">
<a href="/">首页</a><span>&gt;</span>
<a href="<?php echo getUrl('channel', $pageData['channel_id']); ?>"><?php echo htmlspecialchars($channel['channel_name'] ?? ''); ?></a><span>&gt;</span>
<?php echo htmlspecialchars($pageData['title']); ?>
</div>
</div>

<div class="page-content">
<div class="container">
<div class="content-body">
<h1 style="text-align:center;font-size:28px;color:#333;margin-bottom:30px;"><?php echo htmlspecialchars($pageData['title']); ?></h1>
<?php echo $pageData['content']; ?>
</div>
</div>
</div>

<?php include __DIR__ . '/_footer.php'; ?>
</body>
</html>