<?php
/**
 * 芋头CMS
 * ============================================================================
 * 版权所有 2016-2028 沅陵县乌托邦网络服务有限公司，并保留所有权利。
 * 网站地址: http://www.yutoucms.cn
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷。
 * ============================================================================
 * Author: 芋头 <mxgsf@qq.com>
 * Date: 2026-6-1
 */
$downloads = $db->fetchAll("SELECT * FROM {$db->table('download')} WHERE status = 1 ORDER BY create_time DESC LIMIT 20");
?>
<!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($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-download">
<div class="container">
<h1>资料下载</h1>
</div>
</div>

<div class="download-page">
<div class="container">
<?php foreach($downloads as $d): ?>
<div class="download-item">
<div class="download-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
</div>
<div class="download-info">
<h4><?php echo htmlspecialchars($d['title']); ?></h4>
<p><?php echo htmlspecialchars($d['summary'] ?? ''); ?></p>
</div>
<a href="<?php echo htmlspecialchars($d['file_path']); ?>" class="download-btn" download>下载</a>
</div>
<?php endforeach; ?>
<?php if(empty($downloads)): ?>
<p style="text-align:center;color:#999;padding:60px 0;">暂无下载内容</p>
<?php endif; ?>
</div>
</div>

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