<?php
/**
 * 芋头CMS - 家具定制企业网站模板
 */
if (!defined('ROOT_PATH')) { exit('Access Denied'); }
$footerLinks = $db->fetchAll("SELECT * FROM {$db->table('link')} WHERE status = 1 ORDER BY sort_order ASC, id ASC LIMIT 10");
$siteICP = isset($siteConfig['site_icp']) ? $siteConfig['site_icp'] : '';
?>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="footer-grid">

<div class="footer-col">
<h4><?php echo htmlspecialchars(isset($siteConfig['site_name']) ? $siteConfig['site_name'] : '家具定制'); ?></h4>
<p style="color:#888;line-height:1.8;font-size:14px;">
<?php echo isset($siteConfig['site_description']) ? nl2br(htmlspecialchars($siteConfig['site_description'])) : '专业定制家具，匠心工艺，品质生活。'; ?>
</p>
<div style="margin-top:16px;display:flex;gap:10px;">
<a href="#" style="width:32px;height:32px;background:#333;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#888;font-size:14px;">微</a>
<a href="#" style="width:32px;height:32px;background:#333;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#888;font-size:14px;">微</a>
<a href="#" style="width:32px;height:32px;background:#333;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#888;font-size:14px;">抖</a>
</div>
</div>

<div class="footer-col">
<h4>快速导航</h4>
<ul>
<?php foreach ($topChannels as $ch): ?>
<li><a href="<?php echo getUrl('channel', $ch['id']); ?>"><?php echo htmlspecialchars($ch['channel_name']); ?></a></li>
<?php endforeach; ?>
<li><a href="<?php echo getUrl('guestbook'); ?>">在线留言</a></li>
</ul>
</div>

<div class="footer-col">
<h4>产品分类</h4>
<ul>
<?php
$productChannels = $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE parent_id = 0 AND channel_type = 2 AND is_show = 1 ORDER BY list_order ASC, id ASC LIMIT 8");
foreach ($productChannels as $pch):
?>
<li><a href="<?php echo getUrl('channel', $pch['id']); ?>"><?php echo htmlspecialchars($pch['channel_name']); ?></a></li>
<?php endforeach; ?>
</ul>
</div>

<div class="footer-col">
<h4>联系方式</h4>
<ul class="footer-contact">
<?php if (!empty($sitePhone)): ?>
<li><span>📞</span><span><?php echo htmlspecialchars($sitePhone); ?></span></li>
<?php endif; ?>
<?php if (!empty($siteAddress)): ?>
<li><span>📍</span><span><?php echo htmlspecialchars($siteAddress); ?></span></li>
<?php endif; ?>
<?php if (!empty($siteConfig['site_email'])): ?>
<li><span>✉️</span><span><?php echo htmlspecialchars($siteConfig['site_email']); ?></span></li>
<?php endif; ?>
</ul>
</div>

</div>
</div>

<div class="footer-bottom">
<div class="container">
<p>
&copy; <?php echo date('Y'); ?> <?php echo htmlspecialchars(isset($siteConfig['site_name']) ? $siteConfig['site_name'] : '家具定制'); ?> 版权所有
<?php if ($siteICP): ?>
&nbsp;|&nbsp;<a href="http://beian.miit.gov.cn" target="_blank"><?php echo htmlspecialchars($siteICP); ?></a>
<?php endif; ?>
&nbsp;|&nbsp;由 <a href="http://www.yutoucms.cn" target="_blank">芋头CMS</a> 驱动
</p>
</div>
</div>
</footer>

</body>
</html>