<?php
/**
 * 芋头CMS
 * ============================================================================
 * 版权所有 2016-2028 沅陵县乌托邦网络服务有限公司，并保留所有权利。
 * 网站地址: http://www.yutoucms.cn
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷。
 * ============================================================================
 * Author: 芋头 <mxgsf@qq.com>
 * Date: 2026-5-30
 */
if (!defined('ROOT_PATH')) { exit('Access Denied'); }
if (!isset($contentList)) {
    $contentList = $db->fetchAll("SELECT p.*, c.channel_name FROM {$db->table('product')} p LEFT JOIN {$db->table('channel')} c ON p.channel_id=c.id WHERE p.status=1 ORDER BY p.create_time DESC LIMIT 100");
}
$pageTitle = $channel['channel_name'] ?? '服务中心';
require_once __DIR__ . '/../_header.php';
$productChannels = $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE channel_type = 2 AND is_show = 1 ORDER BY list_order ASC, id ASC");
?>
<div class="bannern c" style="background:url(<?php echo $site['template_dir']; ?>static/upload/image/20220801/1659354277651388.jpg) no-repeat center;"></div>
<div class="n_cont c">
  <div class="jz c">
    <div class="ny_nav" id="my_sticky">
      <div class="wjssbt c"><?php echo htmlspecialchars($channel['channel_name'] ?? '服务中心'); ?></div>
      <ul class="wjsndh c">
        <?php foreach ($productChannels as $ch): ?>
        <li class="c"><a href="?m=channel&id=<?php echo intval($id); ?>&channel_id=<?php echo $ch['id']; ?>"><?php echo htmlspecialchars($ch['channel_name']); ?> <span>></span></a></li>
        <?php endforeach; ?>
      </ul>
      <div class="search_l">
        <form method="get" action="<?php echo getUrl('search'); ?>">
          <input type="hidden" name="m" value="search">
          <input type="text" class="ip" name="keyword" placeholder="请输入关键字">
          <input type="submit" class="btn" value="搜索">
        </form>
      </div>
    </div>
    <div class="ny_zqw ny_zqw_chb">
      <div class="nw_top"><span class="top_tzbt l"><?php echo htmlspecialchars($channel['channel_name'] ?? '服务中心'); ?></span><span class="top_mbx r am-icon-home">您的位置： <a href="<?php echo getUrl('home'); ?>">首页</a> >> <a href="<?php echo getUrl('channel', intval($id)); ?>"><?php echo htmlspecialchars($channel['channel_name'] ?? '服务中心'); ?></a></span></div>
      <div class="c"></div>
      <div class="abc-filter"></div>
      <div class="bjbld">
        <ul class="jsanl">
          <?php foreach ($contentList as $p): ?>
          <li><a href="<?php echo getUrl('product', $p['id']); ?>" title="<?php echo htmlspecialchars($p['title']); ?>"><span class="dpdzfd"><img src="<?php echo !empty($p['litpic']) ? htmlspecialchars($p['litpic']) : $site['template_dir'] . 'static/upload/image/20220801/1659323496152728.jpg'; ?>" alt="<?php echo htmlspecialchars($p['title']); ?>"></span><span class="jsalnr"><span class="jsrbt"><?php echo htmlspecialchars($p['title']); ?></span><span class="jsrnr"><?php echo htmlspecialchars(mb_substr(strip_tags($p['description'] ?? $p['content'] ?? ''), 0, 60)); ?></span><span class="jsrgd">查看详情</span></span></a></li>
          <?php endforeach; ?>
        </ul>
      </div>
    </div>
  </div>
</div>
<?php require_once __DIR__ . '/../_footer.php'; ?>
