<?php
$sub_menu = "400100";
include_once("./_common.php");

auth_check($auth[$sub_menu], 'w');

$g5['title'] = '메인페이지구성';
$administrator = 1;
include_once(G5_ADMIN_PATH.'/admin.head.php');

//===========================================================================
// PC용 스킨 옵션
//===========================================================================
//메인 레이아웃 스킨목록
$dir = BT_SKIN_PATH.'/layout';
$dirs = FileDir::getDirEntry($dir, 'd', 'php');
$layout_s = new SelectBox();
foreach($dirs as $key=>$val) $layout_s->add($val, $val);
$layout_s->selectedFromValue = $btcfg['bc_skin_layout'];

//메인 본문 스킨
$dir = BT_SKIN_PATH.'/main';
$dirs = FileDir::getDirEntry($dir, 'd', 'php');
$main_s = new SelectBox();
foreach($dirs as $key=>$val) $main_s->add($val, $val);
$main_s->selectedFromValue = $btcfg['bc_skin_main'];

//===========================================================================
// 모바일용 스킨 옵션
//===========================================================================
//모바일 레이아웃 스킨목록
$dir = BT_MSKIN_PATH.'/layout';
$dirs = FileDir::getDirEntry($dir, 'd', 'php');
$mlayout_s = new SelectBox();
foreach($dirs as $key=>$val) $mlayout_s->add($val, $val);
$mlayout_s->selectedFromValue = $btcfg['bc_skin_layout'];

//모바일 본문 스킨
$dir = BT_MSKIN_PATH.'/main';
$dirs = FileDir::getDirEntry($dir, 'd', 'php');
$mmain_s = new SelectBox();
foreach($dirs as $key=>$val) $mmain_s->add($val, $val);
$mmain_s->selectedFromValue = $btcfg['bc_skin_mmain'];
?>

<script type="text/javascript">
<!--
function fmainform_submit(f){
	return true;
}
//-->
</script>

<form name="fmainform" id="fmainform" action="./main_config_update.php" method="post" enctype="multipart/form-data" onsubmit="return fmainform_submit(this)">
<section>
    <div class="tbl_frm01 tbl_wrap">
    
    	<table>
        <caption>메인페이지구성</caption>
        <colgroup>
            <col class="grid_2">
            <col class="grid_7">
        </colgroup>
        <tbody>
        <tr>
        	<th scope="row"><label for="bc_logo">로고이미지</label></th>
        	<td><span class="frm_info">가로 200px X 세로 70px 이내</span>
        	<?if(file_exists(G5_DATA_PATH.'/file/logo/'.$btcfg['bc_logo'])){?>
        		<p><img src="<?php echo G5_DATA_URL.'/file/logo/'.$btcfg['bc_logo']?>" width="<?php echo $btcfg['bc_logo_width']?>" height="<?php echo $btcfg['bc_logo_height']?>" title="<?echo $g5['cf_title']?>" alt="<?echo $g5['cf_title']?>" /></p>
        	<?}?>
        		<input type="file" name="bc_logo" />
        	</td>
        </tr>
        <!--
        <tr>
            <th scope="row"><label for="bc_width">가로크기</label></th>
            <td><span class="frm_info">PC용 스킨의 가로 크기 (100이하 입력시 %로 계산됨)</span>
            	<input type="text" name="bc_width" value="<?=$btcfg['bc_width']?>" class="frm_input" size="5" maxlength="4" required='' class="required frm_input" />
            </td>
        </tr>
        -->
        <tr>
            <th scope="row"><label for="bc_image_width">페이지 이미지 크기</label></th>
            <td><span class="frm_info">페이지생성시 이미지의 가로폭이 아래 이상이면 썸네일로 크기를 조절합니다</span>
            	<input type="text" name="bc_image_width" value="<?=$btcfg['bc_image_width']?>" class="frm_input" size="5" maxlength="4" required='' class="required frm_input" />
            </td>
        </tr>
        <tr>
        	<th scope="row"><label for="bc_skin_layout">PC 레이아웃</label></th>
        	<td><select name="bc_skin_layout" id="bc_skin_layout"><?=$layout_s->getOption()?></select></td>
        </tr>
        <tr>
        	<th scope="row"><label for="bc_skin_main">PC 본문스킨</label></th>
        	<td><select name="bc_skin_main" id="bc_skin_main"><?=$main_s->getOption()?></select></td>
        </tr>
        <tr>
        	<th scope="row"><label for="bc_skin_mlayout">모바일 레이아웃</label></th>
        	<td><select name="bc_skin_mlayout" id="bc_skin_mlayout"><?=$mlayout_s->getOption()?></select></td>
        </tr>
        <tr>
        	<th scope="row"><label for="bc_skin_mmain">모바일 본문스킨</label></th>
        	<td><select name="bc_skin_mmain" id="bc_skin_mmain"><?=$mmain_s->getOption()?></select></td>
        </tr>
        <!--
        <tr>
        	<th scope="row"><label for="bc_tail_html">copy하단 내용</label></th>
        </tr>
        -->
        </tbody>
        </table>
    
    </div>
    
</section>

<div class="btn_confirm01 btn_confirm">
    <input type="submit" value="적용하기" class="btn_submit" accesskey="s">
</div>

</form>

<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>