<?php
$catName = getCategoryName($_GET['cat']);
?>
<div class="pmlt1"><img src="images/ic_p.gif"><?php echo $catName?></div>
<div class="h10"></div>
<div class="pmlt3">
    <div class="pjtt"></div>
    <?php
	$categories = getCategoriesByParent($_GET['cat']);
	$total = count($categories);
	$i = 0;
	foreach ($categories as $category):
		if ($i % 2 == 0) {
			$catName = getCategoryName($category['id']);
			$image = NSO_UPLOAD_DIR_NAME . '/' . $category['image'];
		?>
			<div class="pjltc">	
            	<div class="pjltca"><a href="solution_list.php?cat=<?php echo $category['id']?>"><img width="94" height="94" border="0" alt="<?php echo $catName?>" src="<?php echo $image?>"></a></div>
                <div class="pj3ca">
                    <div class="pj3tt"><a class="STYLE15" href="solution_list.php?cat=<?php echo $category['id']?>"><?php echo $catName?></a></div>
                    <ul>
                    <?php 
					$posts = getPostsByCategory($category['id'], '', 4);
					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="bgnone" class="pj3more"><a href="solution_list.php?cat=<?php echo $category['id']?>">更多 </a><img width="7" height="8" src="images/ic_3.gif">&nbsp;</li>
                    </ul>
                </div>
		<?php 
		} else {
			$catName = getCategoryName($category['id']);
			$image = NSO_UPLOAD_DIR_NAME . '/' . $category['image'];	
		?>
                <div class="pjltca pj3l35"><a href="solution_list.php?cat=<?php echo $category['id']?>"><img width="94" height="94" border="0" alt="<?php echo $catName?>" src="<?php echo $image?>"></a></div>
                <div class="pj3ca">
                    <div class="pj3tt"><a class="STYLE15" href="solution_list.php?cat=<?php echo $category['id']?>"><?php echo $catName?></a></div>
                    <ul>
                    <?php 
					$posts = getPostsByCategory($category['id'], '', 4);
					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="bgnone" class="pj3more"><a href="solution_list.php?cat=<?php echo $category['id']?>">更多 </a><img width="7" height="8" src="images/ic_3.gif">&nbsp;</li>
                    </ul>
                </div>
                <div class="bline"></div>
            </div>
    <?php } $i++; endforeach;?>
</div>
<div class="h15"></div>