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

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

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

$g5['title'] = '이미지 주소 변경';
include_once('../admin.head.php');

$pg_anchor = '<ul class="anchor">
    <li><a href="#img_rename">이미지 주소 변경</a></li>
</ul>';

$frm_submit = '<div class="btn_confirm01 btn_confirm">
    <input type="submit" value="확인" class="btn_submit" accesskey="s">
    <a href="'.G5_URL.'/">메인으로</a>
</div>';
?>

<div class="local_desc01 local_desc">
    <p>
        이미지 주소 변경 시 게시판, 내용관리에 등록된 이미지의 주소가 현재 사이트 주소로 변경됩니다.
		<br><strong>그누보드5 , 영카드5</strong> 에서 사용 가능합니다.
    </p>
</div>

<form name="fconfigform" id="fconfigform" method="post" onsubmit="return fconfigform_submit(this);" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="token" value="" id="token">

<section id="img_rename">
    <div class="tbl_frm01 tbl_wrap">
       <table>
        <caption>이미지주소변경</caption>
        <colgroup>
            <col class="grid_4">
            <col>
            <col class="grid_4">
            <col>
        </colgroup>
        <tbody>
        <tr><lii id="btn_2" class="btn_03 btn" style="cursor:pointer;padding:5px">TABLES URL 보기</lii>
            <th scope="row"><label for="previous_site">이전 사이트 주소<strong class="sound_only">필수</strong></label></th>
            <td>
                <?php echo help('이전 사이트의 이미지 주소를 정확하게 입력해주세요.');?>
                <?php echo help('ex) http://test.co.kr') ?>
                <input type="text" name="previous_site" value="<?php include_once('./in_url.php');?>" id="previous_site" class="frm_input required" size="30" required>
            </td>
            <th scope="row"><label for="now_site">현재 사이트 주소<strong class="sound_only">필수</strong></label></th>
            <td>
                <?php echo help('수정불가.') ?>
                <input type="text" name="now_site" value="<?php echo G5_URL ?>" id="now_site" class="frm_input" size="30" readonly>
            </td>
        </tr>
        </tbody>
        </table>
    </div>
</section>
<?php echo $frm_submit; ?>

</form>
<div id="modal_2" style="position:relative;display:none;width:100%;height:auto;background-color:blue;color:white;padding:10px;box-sizing:border-box">
<?php include_once('./img_url.php');?>
</div>
<script>
function fconfigform_submit(f)
{
    f.action = "./img_rename_update.php";
    return true;
}

document.getElementById("btn_2").onclick = function() {
    var modal = document.getElementById("modal_2");
    var button = document.getElementById("btn_2");
    if (modal.style.display === "none" || modal.style.display === "") {
        modal.style.display = "block";
        button.textContent = "TABLES URL 닫기";
    } else {
        modal.style.display = "none";
        button.textContent = "TABLES URL 보기";
    }
};
</script>
<?php
include_once('../admin.tail.php');
