<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 

function amina_list_category($ca_name, $ca_list) {

    $arr = explode("|", $ca_list); // 구분자가 , 로 되어 있음
    $str = "";
    for ($i=0; $i<count($arr); $i++) {
        if (trim($arr[$i])) {
			if(trim($arr[$i]) == $ca_name) { $selected = ' selected'; } else { $selected = ''; }
			$str .= '<option value="'.$arr[$i].'"'.$selected.'>'.$arr[$i].'</option>'."\n";
		}
	}
    return $str;
}

$category_option = amina_list_category($sca, $board['bo_category_list']);

switch($amina['cate_css']) {
	case 'theme-A'	: $cate_jQm_theme = 'data-theme="a"'; break;
	case 'theme-B'	: $cate_jQm_theme = 'data-theme="b"'; break;
	case 'theme-C'	: $cate_jQm_theme = 'data-theme="c"'; break;
	case 'theme-D'	: $cate_jQm_theme = 'data-theme="d"'; break;
	case 'theme-E'	: $cate_jQm_theme = 'data-theme="e"'; break;
	default			: $cate_jQm_theme = ''; break;
}

?>
<div class="data-role" style="padding:15px;">
	<div data-role="controlgroup">
		<select name="sca" id="sca" <?php echo $cate_jQm_theme; ?> data-iconpos="left" data-icon="bars" onchange="location='<?php echo G4_BBS_URL; ?>/board.php?bo_table=<?php echo $bo_table; ?>&sca=' + encodeURIComponent(this.value);">
		<option value="">전체보기</option>
		<?php echo $category_option; ?>
		</select>
		<a href="#" data-role="button" data-iconpos="left" data-icon="info"><span id="post_cnt">Total <?php echo number_format($total_count); ?></span>, <?php echo number_format($page).'/'.number_format($total_page); ?> Page</a>
	</div>
</div>