[APP_CONTENT::regist_site/regist_site.php]
<!--
<div id="register_site_step1"
     class="panel col-12 tc register_site_step">
    <div class="panel_container">
        <div class="panel_header">
            <h4 class="section_title">STEP1. 테마 선택하기</h4>
        </div>
        <div class="panel_body">
            <ul id="theme_list">
            </ul>
            <script type="text/javascript">
                bm.httpSend(
                        "[WEB_ROOT]themeTemplateManage/getThemeTemplateList"
                        ,null
                        ,function(data){
                            var $themeList = $("#theme_list");
                            $themeList.empty();
                            for( var i in data.data.list ){
                                var theme = data.data.list[i];
                                var _li = '<li class="item_theme col-3" data-theme-id="'+theme['id']+'" data-theme-revision="'+theme['revision']+'">';
                                _li +=          '<img class="theme_thumb" src="[RESOURCE::img/sample/default_theme_thumb.jpg]"/>';
                                _li +=          '<span class="col-12 theme_title">'+theme['subject']+'</span></br>';
                                _li +=          '<input type="button" class="btn_small lime icon_confirm col-8 btn_select" value="테마선택"/>';
                                _li +=     '</li>';
                                $themeList.append( _li );
                            }
                            // 로딩이 끝났으니 버튼에 이벤트를 부여한다.
                            pageStart();
                        }
                        ,"json", "post");
            </script>
        </div>
    </div>
</div>

<div id="register_site_step2"
     class="panel col-12 tc hidden register_site_step">
    <form name="form_site_info" action="[WEB_ROOT]siteManage/createSiteFromRegister" method="post">
        <div class="panel_container">
            <div class="panel_header">
                <h4 class="section_title">STEP2. 기본정보 입력</h4>
            </div>
            <div class="panel_body">

                <input type="hidden" name="theme_id" value=""/>
                <input type="hidden" name="theme_rev" value=""/>

                <table class="filter_table col-6 col-center mt40">
                    <tr>
                        <th class="tr"><label for="txt_site_id">기본주소 입력</label></th>
                        <td><input type="text" class="input_90 tl" id="txt_site_id" name="site_id" placeholder=".weven.co.kr"></td>
                    </tr>
                    <tr>
                        <th class="tr"><label for="txt_email">이메일</label></th>
                        <td><input type="text" class="input_90 tl" id="txt_email" name="email"></td>
                    </tr>
                    <tr>
                        <th class="tr"><label for="txt_password">비밀번호 입력</label></th>
                        <td><input type="password" class="input_90 tl" id="txt_password" name="password"></td>
                    </tr>
                    <tr>
                        <th class="tr"><label for="txt_password_conf">비밀번호 확인</label></th>
                        <td><input type="password" class="input_90 tl" id="txt_password_conf" name="password_conf"></td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="panel_util">
            <input type="submit" class="btn_guide pink icon_write" value="생성"/>
        </div>
    </form>
</div>

<div id="register_site_step3"
     class="panel col-12 tc hidden register_site_step">
    <div class="panel_container">
        <div class="panel_header">
            <h4 class="section_title">STEP3. 만들기 완료</h4>
        </div>
        <div class="panel_body">
            <h2>귀하의 웹사이트가 완성되었습니다.<br/> 프리미엄 사이트를 경험해보세요.</h2>
            <table class="filter_table col-6 col-center mt40">
                <colgroup>
                    <col width="50%">
                    <col width="50%">
                </colgroup>
                <tr>
                    <th class="tr pr10">사이트 주소</th>
                    <td class="tl pl10"><span class="txt_site_url">www.weven.co.kr</span></td>
                </tr>
                <tr>
                    <th class="tr pr10">ADMIN 주소</th>
                    <td class="tl pl10"><span class="txt_site_url_admin">webmaster@weven.co.kr</span></td>
                </tr>
                <tr>
                    <th class="tr pr10">아이디</th>
                    <td class="tl pl10"><span class="txt_member_id">webmaster</span></td>
                </tr>
            </table>
        </div>
    </div>
    <div class="panel_util">
        <a class="btn_guide lime btn_goto_site">사용자화면</a>
        <a class="btn_guide navy btn_goto_site_admin">관리자화면</a>
    </div>
</div>

<script type="text/javascript">
    function pageStart(){
        $(".register_site_step").hide();
        $("#register_site_step1").show();

        // [ Step1 이벤트 ] :: 테마 선택
        $("#register_site_step1 .item_theme").on("click", function(){
            var _selectedId = $(this).attr("data-theme-id");
            var _selectedRev = $(this).attr("data-theme-revision");

            // 다음 단계로.
            goStep2( _selectedId, _selectedRev );
        });

        // [ Step2 이벤트 ] :: 입력정보 검증
        var $infoForm = $("#register_site_step2 form");
        $infoForm.on("submit", function(event){
            event.preventDefault();

            var _pass1 = $infoForm.find("[name='password']").val();
            var _pass2 = $infoForm.find("[name='password_conf']").val();
            if( _pass1 != _pass2 ){
                alert("비밀번호가 일치하지 않습니다.");
                return;
            }

            bm.httpSend(
                    $infoForm.attr("action"),
                    {
                        theme_id: $infoForm.find("[name='theme_id']").val(),
                        theme_rev: $infoForm.find("[name='theme_rev']").val(),
                        site_id: $infoForm.find("[name='site_id']").val(),
                        email: $infoForm.find("[name='email']").val(),
                        password: _pass1,
                        password_confirm: _pass2
                    },
                    function(data){
                        if( data.result== false ){
                            alert(data.message);
                            return;
                        }else{
                            goStep3(data.data['url'], data.data['url_admin'], data.data['member_id'] );
                        }
                    },
                    'json', 'post'
            )
        });

        // [ Step3 이벤트 ] :: 사이트 이동
        var $step3 = $("#register_site_step3");
        $step3.find(".btn_goto_site").on("click", function(){
            window.open( $step3.find(".txt_site_url").text(), "_blank" );
        });
        $step3.find(".btn_goto_site_admin").on("click", function(){
            window.open( $step3.find(".txt_site_url_admin").text(), "_blank" );
        });


        // step 전환 -------
        function goStep2( selectedThemeId, selectedThemeRev ){
            $("#register_site_step1").hide();
            $("#register_site_step2").show();

            $infoForm.find("[name='theme_id']").val(selectedThemeId);
            $infoForm.find("[name='theme_rev']").val(selectedThemeRev);
        }
        // step 전환 -------
        function goStep3( url, urlAdmin, memberId ){
            $("#register_site_step2").hide();
            $("#register_site_step3").show();

            $step3.find(".txt_site_url").text(url);
            $step3.find(".txt_site_url_admin").text(urlAdmin);
            $step3.find(".txt_member_id").text(memberId);
        }
    };
</script>
-->