<?php require_once 'nsoconfig.php';?>
<?php include_once '_cake_top.php';?>
    <?php include_once '_cake_header.php';?>
    <div id="main-content">
        <div id="hot-product">
            <h3>条码设备推荐</h3>
            <div class="tabs">
                <ul>
                    <li><span class="current">最新产品</span></li>
                    <li><span>条码打印机</span></li>
                    <li><span>数据采集器</span></li>
                    <li><span>条码扫描器</span></li>
                </ul>
            </div>
            <div class="contents">
                <div class="tab_content current">
                	<ul>
                    <?php
					$categories = getCategoriesByParent($nsoProductCatId);
					$cats = array();
					foreach ($categories as $cat) {
						$cats[] = $cat['id'];
					}
					$catIn = implode(', ', $cats);
					$sql = "SELECT * FROM posts, rel_post_cat
							WHERE posts.id = rel_post_cat.post_id
							AND posts.status <> 'deleted'
							AND rel_post_cat.cat_id IN ({$catIn}) 
							ORDER BY posts.date DESC 
							LIMIT 0, 5";
					$posts = $nsodb->get_results($sql, ARRAY_A);
					if ($posts): foreach ($posts as $post):
						$image = getFileWithFullPathByPost($post['post_id'], 'image');
						$image = getImagePathBySize($image, '200');
					?>
                    	<li><div><a href="product_detail.php?id=<?php echo $post['post_id']?>"><img src="<?php echo $image?>" /></a><h4><?php echo $post['title']?></h4></div></li>
                    <?php endforeach; endif;?>
                    </ul>
                </div>
                <div class="tab_content">
                	<ul>
                    <?php
					$posts = getPostsByCategory(32, '', 5);
					if ($posts): foreach ($posts as $post):
						$image = getFileWithFullPathByPost($post['post_id'], 'image');
						$image = getImagePathBySize($image, '200');
					?>
                    	<li><div><a href="product_detail.php?id=<?php echo $post['post_id']?>"><img src="<?php echo $image?>" /></a><h4><?php echo $post['title']?></h4></div></li>
                    <?php endforeach; endif;?>
                    </ul>
                </div>
                <div class="tab_content">
                	<ul>
                    <?php
					$posts = getPostsByCategory(33, '', 5);
					if ($posts): foreach ($posts as $post):
						$image = getFileWithFullPathByPost($post['post_id'], 'image');
						$image = getImagePathBySize($image, '200');
					?>
                    	<li><div><a href="product_detail.php?id=<?php echo $post['post_id']?>"><img src="<?php echo $image?>" /></a><h4><?php echo $post['title']?></h4></div></li>
                    <?php endforeach; endif;?>
                    </ul>
                </div>
                <div class="tab_content">
                	<ul>
                    <?php
					$posts = getPostsByCategory(34, '', 5);
					if ($posts): foreach ($posts as $post):
						$image = getFileWithFullPathByPost($post['post_id'], 'image');
						$image = getImagePathBySize($image, '200');
					?>
                    	<li><div><a href="product_detail.php?id=<?php echo $post['post_id']?>"><img src="<?php echo $image?>" /></a><h4><?php echo $post['title']?></h4></div></li>
                    <?php endforeach; endif;?>
                    </ul>
                </div>
            </div>
        </div>
        <div id="resolution-container">
            <h3>实施案例</h3>
            <div class="contents">
                <div class="content">
                    <h4>实施案例展示</h4>
                    <div class="img"><img alt="条码应用系统集成专家-泽瑞条码" src="images/pj_1.jpg"></div>
                    <div class="list">
                        <ul>
                            <?php $posts = getPostsByCategory(8, '', 6);
                        	if($posts): foreach ($posts as $post):?>
                           <li><a href="solution_detail.php?id=<?php echo $post['post_id']?>"><?php echo $post['title']?></a></li>
                            <?php endforeach; endif;?>
                        	<li id="mp1cli3"><a href="solutions.php?cat=8">更多&gt;&gt;</a></li>
                        </ul>
                  </div>
                    <div class="more"></div>
                </div>
                <div class="line"></div>
                <div class="content">
                    <h4>泽瑞解决方案</h4>
                    <div class="img"><img alt="条码应用系统集成专家-泽瑞条码" src="images/pj_2.jpg"></div>
                    <div class="list">
                        <ul>
                            <?php $posts = getPostsByCategory(9, '', 6);
                        	if($posts): foreach ($posts as $post):?>
                            <li><a href="solution_detail.php?id=<?php echo $post['post_id']?>"><?php echo $post['title']?></a></li>
                            <?php endforeach; endif;?>
                        	<li id="mp1cli3"><a href="solutions.php?cat=9">更多&gt;&gt;</a></li>
                        </ul>
                    </div>
                    <div class="more"></div>
                </div>
                <div class="line"></div>
                <div class="content">
                    <h4>行业解决方案</h4>
                    <div class="img"><img alt="条码应用系统集成专家-泽瑞条码" src="images/pj_3.jpg"></div>
                    <div class="list">
                        <ul>
                            <?php 
							$categories = getCategoriesByParent(10);
							$cats = array();
							foreach ($categories as $cat) {
								$cats[] = $cat['id'];
							}
							$catIn = implode(', ', $cats);
							$sql = "SELECT * FROM posts, rel_post_cat
									WHERE posts.id = rel_post_cat.post_id
									AND posts.status <> 'deleted'
									AND rel_post_cat.cat_id IN ({$catIn}) 
									ORDER BY posts.date DESC 
									LIMIT 0, 6";
							$posts = $nsodb->get_results($sql, ARRAY_A);
                        	if($posts): foreach ($posts as $post):?>
                            <li><a class="STYLE1" href="solution_detail.php?id=<?php echo $post['post_id']?>"><?php echo $post['title']?></a></li>
                            <?php endforeach; endif;?>
                        	<li id="mp1cli3"><a href="solutions.php?cat=10">更多&gt;&gt;</a></li>
                        </ul>
                    </div>
                    <div class="more"></div>
                </div>
            </div>
        </div>
        <div id="news-container">
            <div id="more-help">
                <div class="mp2a1">选购指南</div>
                <div class="mp2a2l">
                    <ul>
                        <?php $posts = getPostsByCategory(17, '', 5);
						if($posts): foreach ($posts as $post):?>
						<li><a class="STYLE1" href="knowledge_detail.php?id=<?php echo $post['post_id']?>"><?php echo $post['title']?></a></li>
						<?php endforeach; endif;?>
                    </ul>
                </div>
                <div class="h1"></div>
                <div class="mp2a2r1">产品快捷通道</div>
                <div class="mp2a2r2">
                    <select style="width:120px;" size="1" name="category" id="category">
                        <option selected="selected" value="">--请选择分类--</option>
                        <?php
                        $categories = getCategoriesByParent($nsoProductCatId);
                        if ($categories): foreach ($categories as $category):
                        ?>
                        <option value="<?php echo $category['id']?>"><?php echo $category['name']?></option>
                        <?php endforeach; endif;?>
                    </select>
                </div>
                <div class="mp2a2r2">
                    <select style="width:120px;" size="1" name="brand" id="brand">
                        <option selected="selected" value="">--请选择品牌--</option>
                    </select>
                </div>
                <div class="mp2a2r2">
                    <select style="width:120px;" size="1" name="product" id="product">
                        <option selected="selected" value="">--请选择产品--</option>
                    </select>
                </div>
                <div class="mp2a11">自助服务</div>
                <div class="mp2a3">
                    <div class="mp2a3b"><a href="question.php">常见问题</a></div>
                    <div id="w5"></div>
                    <div class="mp2a3b"><a href="download.php">资料下载</a></div>
                    <div id="w255">&nbsp;</div>
                    <div class="mp2a3b"><a href="knowledge.php">知识中心</a></div>
                    <div id="w5"></div>
                    <div class="mp2a3b"><a href="knowledge_list.php?cat=18">视频学习</a></div>
                </div>
            </div>
            <div class="mp2a">
                <div class="mp3a1">公司新闻</div>
                <div class="more"><a href="news_list.php?cat=30">更多</a> <img width="7" height="8" src="images/ic_3.gif"></div>
                <div class="mp3a2l">
                    <ul>
                        <?php $posts = getPostsByCategory(30, '', 12);
						if($posts): foreach ($posts as $post):?>
						<li><a target="_blank" href="news_detail.php?id=<?php echo $post['post_id']?>"><?php echo $post['title']?></a></li>
						<li class="datetime"><?php echo date('y-m-d', strtotime($post['date']))?></li>
						<?php endforeach; endif;?>
                    </ul>
                </div>
            </div>
            <div class="mp2a">
                <div class="mp3a1">行业资讯</div>
                <div class="more"><a href="news_list.php?cat=31">更多</a> <img width="7" height="8" src="images/ic_3.gif"></div>
                <div class="mp3a2l">
                    <ul>
                        <?php $posts = getPostsByCategory(31, '', 12);
						if($posts): foreach ($posts as $post):?>
						<li><a target="_blank" href="news_detail.php?id=<?php echo $post['post_id']?>"><?php echo $post['title']?></a></li>
						<li class="datetime"><?php echo date('y-m-d', strtotime($post['date']))?></li>
						<?php endforeach; endif;?>
                    </ul>
                </div>
            </div>
        </div>
        <div class="mcom">合作伙伴</div>
        <div class="mcom2"><img alt="条码打印机,数据采集器,条码扫描枪" src="images/mcom.gif"></div>
        <div class="keyw">关  键  字：<a href="product_list.php?cat=32">条码 |</a> <a href="product_list.php?cat=32">条形码</a> | <a href="product_list.php?cat=32">条码打印机</a> | <a href="product_list.php?cat=34">条码扫描器</a> | <a href="product_list.php?cat=33">数据采集器</a> | <a href="product_list.php?cat=32">条形码打印机</a> | 标签打印机 | 条形码扫描器 | <a href="product_list.php?cat=35">RFID设备</a> | 证卡打印机 | 泽瑞收款机 | 条码扫描平台 | </div>
       
    </div>
    <?php include_once '_cake_footer.php';?>