<?php
include_once('../../common.php');

$mod_type = isset($_POST['mod_type']) ? $_POST['mod_type'] : '';
?>

<?php 
if($mod_type == "ca_name") { 
    
    $md_bo_table = isset($_POST['md_bo_table']) ? $_POST['md_bo_table'] : '';
    
    if(isset($md_bo_table) && $md_bo_table) { 
        
        // 해당게시판의 카테고리 조회
        $res_ca = sql_fetch (" select bo_category_list from {$g5['board_table']} where bo_table = '{$md_bo_table}' and bo_use_category = '1' "); 
        $cat = $res_ca['bo_category_list'];
        $cat_opt = explode("|", $cat);

    }
?>
    <?php if(isset($md_bo_table) && $md_bo_table) { ?>
    <?php if(isset($cat) && $cat) { ?>
    <ul class="mt-5 selected_latest selected_select">
        <select class="select w100" name="md_sca">
            <option value="">전체 카테고리</option>
                <?php foreach($cat_opt as $option): ?>
                <option value="<?php echo $option; ?>"><?php echo $option; ?></option>
                <?php endforeach; ?>
        </select>
    </ul>
    <?php } ?>
    <?php } ?>
    
<?php } ?>