<?
$menu_code = '57';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>






<form name="input_form" id="input_form" method="post" action="/admin/life/life_tag_list/5">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="idx" name="idx">
<input type="hidden" id="mode" name="mode">
<input type="hidden" id="search_type" name="search_type" value="tag">



<div class="common_table clearfix type01">
	<div class="searh_area">
		<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="태그명" onkeypress="if( event.keyCode==13 ){check_search();}">
		<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
	</div>
</div>




<!-- 테이블 시작-->
<div class="common_table">

	<span style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
	<span style="margin-left: 5px"><input type="radio" name="sort" value="1" <? if($sort=='1') { echo 'checked';}?> onclick="check_search();"> 최신순</span>
	<span style="margin-left: 5px"><input type="radio" name="sort" value="2" <? if($sort=='2') { echo 'checked';}?> onclick="check_search();"> 인기순</span>

	<table>
		<thead>
			<th>번호</th>
			<th>태그명</th>
			<th>등록글수</th>

		</thead>
		<tbody>


<?
	if(count($list)==0) {
?>
		<tr>
			<td colspan="3">등록된 내용이 없습니다.</td>
		</tr>
<?
	} else {
		$now_date = date("Y-m-d");
	    $dataNumber = ($total_count + $limit)-($page*$limit);
		foreach($list as $val) {
			$tag 			= $val['tag'];
			$article_count  = $val['cnt'];

?>

			<tr>
				<td><?=$dataNumber?></td>
				<td class="title"><a href="/admin/life/life_list/5?search_type=tag&search_keyword=<?=$tag?>"><?=$tag?></a></td>
				<td><?=number_format($article_count)?></td>
			</tr>

<?
		    $dataNumber--;
		}
	}
?>

</tbody>
</table>


<div class="pasing_wrap">
	<?=$pagination?>
</div>


</form>

<script type="text/javascript">
function check_search(){
    if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
        alert("검색할 항목을 선택해주세요.");
        return false;
    }
    $("#input_form").submit();
}




</script>