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

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

$token = get_token();

if ($is_admin != 'super')
    alert('최고관리자만 접근 가능합니다.');

if(!sql_query(" DESCRIBE `oksite_main` ", false)) {
    sql_query(" CREATE TABLE IF NOT EXISTS `oksite_main` (
   				  `idx` int(5) NOT NULL default '1',
                  `mainslider` varchar(255) NOT NULL default '',
                  `mainbbs1` varchar(255) NOT NULL default '',
                  `mainbbs2` varchar(255) NOT NULL default '',
                  `mainbbs3` varchar(255) NOT NULL default '',
                  PRIMARY KEY (`idx`)
                ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);

	sql_query(" INSERT INTO `oksite_main` VALUES (1, 'mainslider', 'qa', 'free', 'gallery') ");

}


$oksite_main = sql_fetch(" select * from `oksite_main` where idx='1' ");

$g5['title'] = "OKsite 게시판 설정";

include_once(G5_ADMIN_PATH.'/admin.head.php');

?>


<form name="ftjmain" id="ftjmain" action="./oksite_main_update.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="token" value="<?php echo $token ?>">


<div class="tbl_frm01 tbl_wrap">

    <table>
    <caption><?php echo $g5['title']; ?></caption>
    <thead>
    <tr>
        <th scope="col">위치</th>
        <th scope="col">게시판</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <th scope="row"><label for="mainslider">메인슬라이더</label></th>
        <td>
        <select name="mainslider" id="mainslider">
        <option value="" selected="selected">선택하세요.</option>
        <?php
        $sql2 = "SELECT * FROM {$g5['board_table']} ";
        $result2 = sql_query($sql2);
        while( $rows2 = sql_fetch_array($result2) ) {
        ?>
        <option <?php if($rows2["bo_table"] == $oksite_main['mainslider']){ echo 'selected="selected"';}?> value="<?php echo $rows2["bo_table"]; ?>"><?php echo $rows2["bo_subject"]; ?>(<?php echo $rows2["bo_table"]; ?>)</option>
        <?php } ?>
        </select>
      </td>
    </tr>
    <tr>
        <th scope="row"><label for="mainbbs1">예약게시판</label></th>
        <td>
        <select name="mainbbs1" id="mainbbs1">
        <option value="" selected="selected">선택하세요.</option>
        <?php
        $sql3 = "SELECT * FROM {$g5['board_table']} ";
        $result3 = sql_query($sql3);
        while( $rows3 = sql_fetch_array($result3) ) {
        ?>
        <option <?php if($rows3["bo_table"] == $oksite_main['mainbbs1']){ echo 'selected="selected"';}?> value="<?php echo $rows3["bo_table"]; ?>"><?php echo $rows3["bo_subject"]; ?>(<?php echo $rows3["bo_table"]; ?>)</option>
        <?php } ?>
        </select>
      </td>
    </tr>
    <tr>
        <th scope="row"><label for="mainbbs2">이용후기</label></th>
        <td>
        <select name="mainbbs2" id="mainbbs2">
        <option value="" selected="selected">선택하세요.</option>
        <?php
        $sql4 = "SELECT * FROM {$g5['board_table']} ";
        $result4 = sql_query($sql4);
        while( $rows4 = sql_fetch_array($result4) ) {
        ?>
        <option <?php if($rows4["bo_table"] == $oksite_main['mainbbs2']){ echo 'selected="selected"';}?> value="<?php echo $rows4["bo_table"]; ?>"><?php echo $rows4["bo_subject"]; ?>(<?php echo $rows4["bo_table"]; ?>)</option>
        <?php } ?>
        </select>
      </td>
    </tr>
    <tr>
        <th scope="row"><label for="mainbbs3">메뉴게시판</label></th>
        <td>
        <select name="mainbbs3" id="mainbbs3">
        <option value="" selected="selected">선택하세요.</option>
        <?php
        $sql5 = "SELECT * FROM {$g5['board_table']} ";
        $result5 = sql_query($sql5);
        while( $rows5 = sql_fetch_array($result5) ) {
        ?>
        <option <?php if($rows5["bo_table"] == $oksite_main['mainbbs3']){ echo 'selected="selected"';}?> value="<?php echo $rows5["bo_table"]; ?>"><?php echo $rows5["bo_subject"]; ?>(<?php echo $rows5["bo_table"]; ?>)</option>
        <?php } ?>
        </select>
      </td>
    </tr>
    </tbody>
</table>

</div>

<div class="btn_confirm01 btn_confirm">
    <input type="submit" value="확인" class="btn_submit" accesskey="s">
</div>

</form>

<div class="local_desc01 local_desc">
    <p>문의 : <a href="https://365ok.co.kr" target="_blank">https://365ok.co.kr</a>,  HP. 010-3254-5402</p>
</div>

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