<?
$category_name	= $arr_category['category_name'];
$category_code1 = $arr_category1['category_code'];
$category_name1 = $arr_category1['category_name'];
$category_code2 = ''; $category_name2 = '';
if(isset($arr_category2['category_code'])==true) {
	$category_code2 = $arr_category2['category_code'];
	$category_name2 = $arr_category2['category_name'];
}
$category_code3 = ''; $category_name3 = '';
if(isset($arr_category3['category_code'])==true) {
	$category_code3 = $arr_category3['category_code'];
	$category_name3 = $arr_category3['category_name'];
}


$category_txt = $category_name1;
if($category_name2!='')	$category_txt.= ' <img src="/img/web/arrow_left.gif" style="vertical-align:baseline"> '.$category_name2;
if($category_name3!='')	$category_txt.= ' <img src="/img/web/arrow_left.gif" style="vertical-align:baseline"> '.$category_name3;

?>


	<div class="contents">
		<div class="wrap">
			<div class="list_left">
				<div class="news_list">
					<div class="rankynews">
						<div class="news_cate">
							<span class="beachblue" style="padding-right:5px;"><?=$category_name?></span>
							<span class="category fr" style="font-size:14px;line-height: 22px;"><?=$category_txt?></span>
						</div>
						<div class="rankytop" style="margin-bottom:10px">
							<span <? if($search_sort=='1') { echo 'class="radio_on"'; } else { echo 'class="radio_off"';}?> style="margin-right:10px;width: 60px;float: left;"><a href="/web/news/category/<?=$category_code?>?search_sort=1">최신순</a></span>
							<span <? if($search_sort=='2') { echo 'class="radio_on"'; } else { echo 'class="radio_off"';}?> style="float: left;width: 60px;"><a href="/web/news/category/<?=$category_code?>?search_sort=2">인기순</a></span>
						</div>

					</div>

				<?
                    foreach ($list as $val) {

                        $press_homepage	= $val['press_homepage'];
                        $comment_count 	= $val['comment_count'];
                        $comment_count_txt = $comment_count;
                        if($comment_count > 9) {
                            $calc_count = str_pad(1, strlen($comment_count), "0", STR_PAD_RIGHT);
                            $comment_count_txt = (floor($comment_count/$calc_count)) * $calc_count;
                            $comment_count_txt = $comment_count_txt.'+';
                        }

                        $display_date =  $val['display_date'];
                        $display_date_txt = substr($display_date, 0, 10);
                        $display_date_txt = str_replace('-', '.', $display_date_txt);

                        $title_txt 		= mb_strimwidth($val['title'], '0', '40', '..', 'utf-8');
						$content 		= preg_replace("(\<(/?[^\>]+)\>)", "", $val['content']);
						$content 		= strip_tags($content);
                        $content_txt	= mb_strimwidth($content, '0', '250', '..', 'utf-8');

                ?>

					<div class="news_list_cont">
						<div class="art-img2"><a href="/web/news/news_view/<?=$val['idx']?>"><img src="<?=$val['main_img']?>" width="160"></a></div>
						<div class="art-info2">
							<h2 class="art-title">
                                <a href="/web/news/news_view/<?=$val['idx']?>"><?=$title_txt?></a>
                                <span class="company"><a href="<?=$press_homepage?>" target="_blank"><?=$val['press_name']?></a></span>
                                <span class="comment fr"><img src="/img/web/img_comment.png"> <?=$comment_count_txt?></span></h2>
							<p class="n_date"><?=$display_date_txt?></p>
							<p class="art-sum"><a href="/web/news/news_view/<?=$val['idx']?>"><?=$content_txt?></a> </p>
						</div>
					</div>

                <?  }?>
				</div>


				<? if($pagination !='') {?>
				<div class="pagenumber">
					<?=$pagination?>
				</div>
			    <? }?>


                <? include_once ('news_main_content_inc.php');?>
                


			</div>

            <? include_once ('news_right_inc.php');?>
		</div>
	</div>
