<?php
/**
 * 芋头CMS
 * ============================================================================
 * 版权所有 2016-2028 沅陵县乌托邦网络服务有限公司，并保留所有权利。
 * 网站地址: http://www.yutoucms.cn
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷。
 * ============================================================================
 * Author: 芋头 <mxgsf@qq.com>
 * Date: 2026-6-2
 */
if (!defined('ROOT_PATH')) exit;
$aboutChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE channel_type=3 AND is_show=1 ORDER BY list_order ASC,id ASC LIMIT 1");
$aboutPage = $aboutChannel ? $db->fetch("SELECT * FROM {$db->table('page')} WHERE channel_id=".intval($aboutChannel['id'])." AND status=1 ORDER BY id DESC LIMIT 1") : null;
$companyIntro = isset($site['company_intro']) ? trim(strip_tags($site['company_intro'])) : '';
$companyIntroText = $companyIntro !== '' ? $companyIntro : ($aboutPage ? trim(strip_tags($aboutPage['content'])) : ('欢迎来到'.$site['site_name']));
$heroSlidePic = (!empty($slides) && !empty($slides[0]['slide_pic'])) ? $slides[0]['slide_pic'] : (($aboutPage && !empty($aboutPage['litpic'])) ? $aboutPage['litpic'] : 'https://picsum.photos/800/600?random=21');
$productChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE channel_type=2 AND is_show=1 ORDER BY list_order ASC,id ASC LIMIT 1");
$newsChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE channel_type=1 AND is_show=1 ORDER BY list_order ASC,id ASC LIMIT 1");
$homeProducts = $db->fetchAll("SELECT * FROM {$db->table('product')} WHERE status=1 ORDER BY create_time DESC LIMIT 8");
$homeNews = $db->fetchAll("SELECT * FROM {$db->table('article')} WHERE status=1 ORDER BY create_time DESC LIMIT 6");
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title><?php echo htmlspecialchars(isset($site['site_title']) && $site['site_title']!=='' ? $site['site_title'] : $site['site_name']); ?></title>
<meta name="keywords" content="<?php echo htmlspecialchars(isset($site['site_keywords']) ? $site['site_keywords'] : ''); ?>">
<meta name="description" content="<?php echo htmlspecialchars(isset($site['site_description']) ? $site['site_description'] : ''); ?>">
<link href="<?php echo $site['template_dir']; ?>css/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $site['template_dir']; ?>css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $site['template_dir']; ?>css/swiper-bundle.min.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $site['template_dir']; ?>css/home-patch.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $site['template_dir']; ?>js/jquery-1.8.3.min.js"></script>
</head><body>
<?php include dirname(__FILE__).'/_header.php'; ?>
<div class="banner_n" style="background:url(<?php echo htmlspecialchars($heroSlidePic); ?>) no-repeat top center;background-size:cover;">
  <div class="capitalize">
    <div class="ad-tit"><?php echo htmlspecialchars($site['site_name']); ?></div>
    <div class="ad-line"></div>
  </div>
</div>
<div class="mbanner"><img src="<?php echo htmlspecialchars($heroSlidePic); ?>" width="100%" alt="<?php echo htmlspecialchars($site['site_name']); ?>" /></div>
<div class="about" id="company-intro"><div class="cont clearfix"><div class="aboutnrl col-md-6 col-sm-12 col-xs-12"><div class="abouttit"><h3><a href="<?php echo $aboutChannel ? getUrl('channel', intval($aboutChannel['id']), isset($aboutChannel['channel_dir']) ? $aboutChannel['channel_dir'] : '') : '#'; ?>">公司介绍</a></h3></div><div class="aboutnr"><p><?php echo htmlspecialchars(msubstr($companyIntroText,0,220)); ?></p></div><div class="ab_fl clearfix"><dl class="col-md-6 col-sm-6 col-xs-6"><dt><span class="counter">2005</span>年</dt><dd>公司成立于</dd></dl><dl class="col-md-6 col-sm-6 col-xs-6"><dt><span class="counter">500</span>+万元</dt><dd>总资产</dd></dl></div><script src="<?php echo $site['template_dir']; ?>js/jquery.waypoints.min.js"></script><script src="<?php echo $site['template_dir']; ?>js/jquery.countup.min.js"></script><script>$('.counter').countUp();</script><div class="aboutmore"><a href="<?php echo $aboutChannel ? getUrl('channel', intval($aboutChannel['id']), isset($aboutChannel['channel_dir']) ? $aboutChannel['channel_dir'] : '') : '#'; ?>">查看更多+</a></div></div><div class="aboutnrr col-md-6 col-sm-12 col-xs-12"><img src="<?php echo htmlspecialchars($heroSlidePic); ?>" alt="公司介绍" width="100%"/></div></div></div>
<div class="pro"><div class="cont"><div class="tit"><h3><a href="<?php echo $productChannel ? getUrl('channel', intval($productChannel['id']), isset($productChannel['channel_dir']) ? $productChannel['channel_dir'] : '') : '#'; ?>">产品展示</a></h3><p></p></div></div><div class="pronr cont"><div class="pro-grid clearfix"><?php foreach ($homeProducts as $p) { ?><div class="prolist"><a href="<?php echo getUrl('product', intval($p['id'])); ?>"><div class="proimg"><img src="<?php echo htmlspecialchars(!empty($p['litpic']) ? $p['litpic'] : 'https://picsum.photos/600/500?random='.intval($p['id'])); ?>" alt="<?php echo htmlspecialchars($p['title']); ?>"/></div><div class="protit"><?php echo htmlspecialchars($p['title']); ?></div></a></div><?php } ?></div><div class="clear"></div><div class="aboutmore"><a href="<?php echo $productChannel ? getUrl('channel', intval($productChannel['id']), isset($productChannel['channel_dir']) ? $productChannel['channel_dir'] : '') : '#'; ?>">查看更多+</a></div></div></div>
<div class="news"><div class="cont"><div class="tit"><h3><a href="<?php echo $newsChannel ? getUrl('channel', intval($newsChannel['id']), isset($newsChannel['channel_dir']) ? $newsChannel['channel_dir'] : '') : '#'; ?>">新闻资讯</a></h3></div></div><?php foreach ($homeNews as $n) { $ts = is_numeric($n['create_time']) ? intval($n['create_time']) : strtotime($n['create_time']); ?><div class="newslist"><div class="cont"><a href="<?php echo getUrl('article', intval($n['id'])); ?>"><div class="newsdate"><p><?php echo date('m-d',$ts); ?></p><span><?php echo date('Y',$ts); ?></span></div><div class="newscon"><div class="newsbt"><?php echo htmlspecialchars($n['title']); ?></div><div class="newsms"><?php echo htmlspecialchars(msubstr(strip_tags($n['content']),0,80)); ?></div></div></a></div></div><?php } ?><div class="aboutmore"><a href="<?php echo $newsChannel ? getUrl('channel', intval($newsChannel['id']), isset($newsChannel['channel_dir']) ? $newsChannel['channel_dir'] : '') : '#'; ?>">查看详细</a></div></div>
<?php include dirname(__FILE__).'/_footer.php'; ?>
</body></html>
