| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585 |
- <?php
- include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
- $nav_title = "회원가입";
- ?>
- <!-- s : header -->
- <? include("../inc/inc_header.php"); ?>
- <!-- // e : header -->
- <style>
- .txt_red{color:#be0606;}
- </style>
- <form id="frmMember" name="frmMember" method="post" action="join_proc.php" enctype="multipart/form-data">
- <input type="hidden" name="validate" id="validate" value=""/>
- <input type="hidden" name="ds_type" id="ds_type" value="A0"/>
- <input type="hidden" name="ds_level" id="ds_level" value="<?=$ds_level?>"/>
- <input type="hidden" name="cd_user" id="cd_user" value="<?=$cd_user?>"/>
- <input type="hidden" name="mode" id="mode" value="Add"/>
- <!--input type="hidden" name="PageNo" id="PageNo" value="<?=$PageNo?>"/-->
- <input type="hidden" name="idchkresult" id="idchkresult" value="N"/>
- <!-- <input type="hidden" name="nm_email" id="nm_email" value=""/>
- <input type="hidden" name="nm_hp" id="nm_hp" value=""/> -->
- <main class="normal--wrap">
- <section class="join--form--wrap">
- <div class="join--form--contents">
- <div class="join--form--inner">
- <h2>개인 정보 입력</h2>
- <div>
- <input type="text" class="form-control" name="nm_email" id="nm_email" maxlength="40" placeholder="아이디 (ex:이메일 형식으로 입력) ">
- <p id="id_chk_info" class="hide"></p>
- </div>
- <div>
- <input type="password" class="form-control" name="nm_pass" id="nm_pass" maxlength="20" placeholder="패스워드">
- </div>
- <div>
- <input type="password" class="form-control" name="nm_pass2" id="nm_pass2" maxlength="20" placeholder="패스워드 확인">
- </div>
- <div>
- <input type="text" class="form-control" name="nm_name" id="nm_name" maxlength="20" placeholder="이름">
- </div>
- <div>
- <input type="text" class="form-control" id="nm_hp" name="nm_hp" placeholder="핸드폰 번호">
- </div>
- <!-- <div>
- <input type="text" class="form-control" id="" placeholder="이메일">
- </div> -->
- <h2 class="mt45">지역</h2>
- <div>
- <select name="ds_area" id="ds_area" class="form-control"></select>
- </div>
- </div>
- <div class="agree--wrapper mt35 d-flex justify-content-end">
- <input type="checkbox" id="ds_agree1" class="ty2" hidden value="Y">
- <label for="ds_agree1">회원 이용약관 (필수)</label>
- <button type="button" class="info--btn btn" data-bs-toggle="modal" data-bs-target="#agreeModal1">약관보기</button>
- </div>
- <div class="agree--wrapper mt35 d-flex justify-content-end">
- <input type="checkbox" id="ds_agree2" class="ty2" hidden value="Y">
- <label for="ds_agree2">개인정보 수집 및 이용 동의 (필수)</label>
- <button type="button" class="info--btn btn" data-bs-toggle="modal" data-bs-target="#agreeModal2">약관보기</button>
- </div>
- <div class="col-12 d-flex justify-content-center join--btn--wrap floating--btn">
- <button type="button" class="btn btn-primary" id="btn_write">회원가입</button>
- </div>
- </div>
- </section>
- </main>
- </form>
- <!-- 회원이용약관 -->
- <div class="modal fade type2" id="agreeModal1" tabindex="-1" aria-labelledby="agree_lable1" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" style="max-width:calc(100vw - 40px);">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title" id="agree_lable1">회원 이용약관 동의</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
- </div>
- <div class="modal-body modal--body pt0">
- <div class="date--text" style="max-height:60vh; overflow-y: auto;">
- <?php include("../../include/clause_txt1.txt"); ?>
- </div>
- </div>
- <div class="modal-footer d-flex justify-content-center ty2 ty--2">
- <button type="button" class="btn btn-primary" data-bs-dismiss="modal" style="max-width:100px;">확인</button>
- </div>
- </div>
- </div>
- </div>
- <!-- 개인정보 수집이용 -->
- <div class="modal fade type2" id="agreeModal2" tabindex="-1" aria-labelledby="agree_lable2" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" style="max-width:calc(100vw - 40px);">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title" id="agree_lable2">개인정보 수집 및 이용 동의</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
- </div>
- <div class="modal-body modal--body pt0">
- <div class="date--text" style="max-height:60vh; overflow-y: auto;">
- <? include("../../include/clause_txt2.txt"); ?>
- </div>
- </div>
- <div class="modal-footer d-flex justify-content-center ty2 ty--2">
- <button type="button" class="btn btn-primary" data-bs-dismiss="modal" style="max-width:100px;">확인</button>
- </div>
- </div>
- </div>
- </div>
- <script laguage="javascript" type="text/javascript">
- function id_chk() {
- var nm_email = $("#nm_email").val();
- var custom_opts = {
- title : '',
- btn_close_show : false,
- }
- if($.trim(nm_email) == ""){
- return false;
- }
- $("#id_chk_info").removeClass("txt_red").removeClass("hide");
- $.post("join_proc.php", { mode: "IdChk", nm_email: nm_email},function(res) {
- if(res.CODE != "0000"){
- $("#idchkresult").val("N");
- id_chk_info = "사용불가능한 아이디 입니다.";
- $("#id_chk_info").addClass("txt_red").text(id_chk_info);
- }else {
- $("#idchkresult").val("Y");
- id_chk_info = "사용할 수 있는 아이디입니다.";
- $("#id_chk_info").removeClass("txt_red").text(id_chk_info);
- }
- }, "json");
- return false;
- }
- // function id_chk() {
- // var nm_email = "";
- // var fieldlist = [];
- // var custom_opts = {
- // title : '',
- // btn_close_show : false,
- // }
- // //
- // // if($("#nm_email3").val() == "") {
- // // fieldlist = [["nm_email1","아이디"], ["nm_email2","아이디"]];
- // // }else {
- // // fieldlist = [["nm_email1","아이디"], ["nm_email3","아이디"]];
- // // }
- //
- // if (!fnCheckForm(fieldlist)){
- // return false;
- // }
- //
- // var nm_email1 = $("#nm_email1").val();
- // var nm_email2 = $("#nm_email2").val();
- // var nm_email3 = $("#nm_email3").val();
- // nm_email = nm_email1+"@"+($.trim(nm_email3) ? nm_email3 : nm_email2);
- //
- //
- // $.post("join_proc.php", { mode: "IdChk", nm_email: nm_email},function(res) {
- // if(res.CODE != "0000") {
- // $("#idchkresult").val("N");
- // alert(res.MSG);
- // return false;
- // }
- //
- // custom_opts.title = '이용가능합니다. 아이디를 사용하시겠습니까?';
- // custom_modal_confirm(custom_opts, function(confirm) {
- // if(confirm) {
- // $("#idchkresult").val("Y");
- //
- // custom_modal_confirm_close();
- //
- // }
- // });
- //
- // // if(confirm("이용가능합니다. 아이디를 사용하시겠습니까?")){
- // // // $("#cd_userid").attr("readonly",true).css("background","#d2d3d5");
- // // $("#idchkresult").val("Y");
- // // }
- //
- // // if(data=="Y"){
- // // if(confirm("이용가능합니다. 아이디를 사용하시겠습니까?")){
- // // $("#cd_userid").attr("readonly",true).css("background","#d2d3d5");
- // // $("#idchkresult").val("Y");
- // // return;
- // // }
- // // }else{
- // // alert("사용불가능한 아이디 입니다.");
- // // $("#idchkresult").val("N");
- // // return;
- // // }
- // }, "json");
- // return false;
- // }
- $(document).ready(function() {
- // setCodeSelect("listPhone","nm_hp1","","","","선택","");
- // setCodeSelect("listEmail","nm_email3","","","","직접입력","");
- setCodeSelect("listcode","ds_area", "member_master","ds_area","","선택하세요","");
- $("#btn_back").on("click", function() {
- history.back(-1);
- });
- $("#nm_email").bind("keyup",function(){
- $("#idchkresult").val("N");
- $("#id_chk_info").removeClass("txt_red").addClass("hide").text("");
- });
- $("#nm_email3").on("change", function(){
- $("#idchkresult").val("N");
- if($(this).val() == ""){
- $("#nm_email2").show();
- }else{
- $("#nm_email2").hide();
- }
- });
- //아이디 체크
- $("#nm_email").bind("focusout", id_chk);
- //아이디 체크
- // $("#btn_idchk").on("click",function(){
- // id_chk();
- // });
- // $("#agree_all").bind("click",function(){
- // agreeChkAll();
- // });
- //
- // $("#agree_all").bind("keyup",function(){
- // agreeChkAll();
- // });
- $("#btn_write").bind("click",function(){
- var custom_opts = {
- title : '',
- btn_close_show : false,
- }
- var fieldlist = [["nm_email","아이디"],["nm_pass","패스워드"],["nm_pass2","패스워드"],["nm_name","이름"],["nm_hp","휴대번호"]
- ,["ds_area","지역"]]
- // var nm_email3 = $("#nm_email3").val();
- // if(nm_email3 == "") {
- // fieldlist.push(["nm_email2"]);
- // }
- if (!fnCheckForm(fieldlist)){
- return false;
- }
- /*아이디 관련 처리*/
- // var idReg1 = /[a-z]/g;
- // var idReg2 = /[0-9]/g;
- //
- // if( !(idReg1.test( $("#cd_userid").val() )) || !(idReg2.test( $("#cd_userid").val() )) ) {
- // // custom_opts.title = '아이디는 영문/숫자 조합으로 이루어져야 합니다.';
- // custom_opts.title = '아이디는 4글자 이상 영문/숫자 조합으로 이메일 형식으로 이루어져야 합니다.';
- //
- // custom_modal_alert(custom_opts);
- // return false;
- // }
- // var idReg = /^[a-z]+[a-z0-9]{3,19}$/g;
- // if( !idReg.test( $("#cd_userid").val() ) ) {
- // // custom_opts.title = '아이디는 영문자로 시작하는 4~20자 영문자 또는 숫자이어야 합니다.';
- // custom_opts.title = '아이디는 4글자 이상 영문/숫자 조합으로 이메일 형식으로 이루어져야 합니다.';
- //
- // custom_modal_alert(custom_opts);
- // return false;
- // }
- //
- // if(!fnCheckAlphaNumber($("#cd_userid").val())){
- // custom_opts.title = '아이디는 4글자 이상 영문/숫자 조합으로 이메일 형식으로 이루어져야 합니다.';
- //
- // custom_modal_alert(custom_opts);
- // return false;
- //
- // }
- /*
- if( !(idReg1.test( $("#cd_userid").val() )) || !(idReg2.test( $("#cd_userid").val() )) ) {
- alert("아이디는 영문/숫자 조합으로 이루어져야 합니다.");
- $("#cd_userid").focus();
- return false;
- }
- var idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
- if( !idReg.test( $("#cd_userid").val() ) ) {
- alert("아이디는 영문자로 시작하는 6~20자 영문자 또는 숫자이어야 합니다.");
- $("#cd_userid").focus();
- return false;
- }
- if(!fnCheckAlphaNumber($("#cd_userid").val())){
- alert('아이디는 영문/숫자 조합으로 이루어져야 합니다.');
- return false;
- }
- if($("#cd_userid").val().length <6){
- alert("6글자 이상 아이디를 입력하세요");
- $("#cd_userid").focus();
- return false;
- }
- */
- if($("#nm_email").val().length <4){
- // custom_opts.title = '아이디는4글자 이상 아이디를 입력하세요.';
- custom_opts.title = '아이디는 4글자 이상 영문/숫자 조합으로 이메일 형식으로 이루어져야 합니다.';
- custom_modal_alert(custom_opts);
- return false;
- }
- if($("#idchkresult").val() != "Y"){
- custom_opts.title = "아이디 중복확인을 해 주세요.";
- custom_modal_alert(custom_opts);
- return false;
- }
- /*패스워드 처리*/
- // if($("#nm_pass").val().length == 0 || $("#nm_pass2").val().length == 0){
- // alert("패스워드를 입력하세요");
- // $("#nm_pass").focus();
- // return false;
- // }
- if($("#nm_pass").val().length == 0 || $("#nm_pass2").val().length == 0){
- custom_opts.title = '패스워드를 입력하세요.';
- custom_modal_alert(custom_opts);
- return false;
- }
- if($("#nm_pass").val().length > 0){
- if($("#nm_email1").val()==$("#nm_pass").val()){
- custom_opts.title = '아이디와 패스워드는 다르게입력하세요.';
- custom_modal_alert(custom_opts);
- return false;
- }
- if($("#nm_pass").val()!=$("#nm_pass2").val()){
- custom_opts.title = '패스워드가 일치하지 않습니다.';
- custom_modal_alert(custom_opts);
- return false;
- }
- if(!fnCheckAlphaNumber($("#nm_pass").val())){
- custom_opts.title = '패스워드는 영문/숫자 조합으로 이루어져야 합니다.';
- custom_modal_alert(custom_opts);
- return false;
- }
- if($("#nm_pass").val().length <8){
- custom_opts.title = '8글자 이상 패스워드를 입력하세요.';
- custom_modal_alert(custom_opts);
- return false;
- }
- }
- var nm_email = $("#nm_email").val();
- if($.trim(nm_email) != "") {
- if(!isValid(nm_email,"regEmail")){
- custom_opts.title = '정확한 이메일을 입력하세요.';
- custom_modal_alert(custom_opts);
- return false;
- }
- }
- // var idReg = /^[a-z]+[a-z0-9]{3,19}$/g;
- // var idReg = /^[a-zA-Z]+[a-zA-Z0-9]{3,19}$/g;
- // // var idReg = /^[a-zA-Z](?=.*[a-zA-Z])(?=.*[0-9]).{4,12}$/g;
- // var idReg = /^[a-zA-Z](?=.*[a-zA-Z])(?=.*[0-9]).{3,19}$/g;
- // if( !idReg.test( $("#nm_email").val() ) ) {
- // // custom_opts.title = '아이디는 영문자로 시작하는 4~20자 영문자 또는 숫자이어야 합니다.';
- // custom_opts.title = '아이디는 영문자로 시작하는 4~20자 영문자/숫자 조합이어야 합니다';
- //
- // custom_modal_alert(custom_opts);
- // return false;
- // }
- // var nm_hp1 = $("#nm_hp1").val();
- // var nm_hp2 = $("#nm_hp2").val();
- // var nm_hp3 = $("#nm_hp3").val();
- // var nm_hp_test = nm_hp1+nm_hp2+nm_hp3;
- // var nm_hp = nm_hp1+"-"+nm_hp2+"-"+nm_hp3;
- // if(!ChkNum(nm_hp_test)){
- // custom_opts.title = "휴대폰 번호는 숫자만 입력하세요.";
- // custom_modal_alert(custom_opts);
- // return false;
- // // alert("휴대폰 번호는 숫자만 입력하세요.");
- // // $("#nm_hp").focus();
- // // return false;
- // }
- /*
- if($("#nm_hp_01").val() == ""){
- alert("휴대폰 번호를 입력하세요.");
- $("#nm_hp_01").focus();
- return false;
- }
- if($("#nm_hp_02").val() == ""){
- alert("휴대폰 번호를 입력하세요.");
- $("#nm_hp_02").focus();
- return false;
- }
- if($("#nm_hp_03").val() == ""){
- alert("휴대폰 번호를 입력하세요.");
- $("#nm_hp_03").focus();
- return false;
- }
- $("#nm_hp").val($("#nm_hp_01").val()+"-"+$("#nm_hp_02").val()+"-"+$("#nm_hp_03").val());
- if($("#nm_email1").val() == ""){
- alert("이메일을 입력하세요.");
- $("#nm_email1").focus();
- return false;
- }
- if($("#nm_email3").val() == ""){
- if($("#nm_email2").val() == ""){
- alert("이메일을 입력하세요.");
- $("#nm_email2").focus();
- return false;
- }
- $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
- }else{
- $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email3").val());
- }
- */
- // var nm_email1 = $("#nm_email1").val();
- // var nm_email2 = $("#nm_email2").val();
- // var nm_email3 = $("#nm_email3").val();
- // var nm_email = nm_email1+"@"+($.trim(nm_email3) ? nm_email3 : nm_email2);
- // $("#nm_email").val(nm_email);
- // $("#nm_hp").val(nm_hp);
- /*
- if($("#nm_addr").val() == ""){
- alert("주소를 입력하세요.");
- $("#nm_addr").focus();
- return false;
- }
- if($("#nm_addr_sub").val() == ""){
- alert("주소를 입력하세요.");
- $("#nm_addr_sub").focus();
- return false;
- }
- */
- if(!document.getElementById("ds_agree1").checked){
- custom_opts.title = "[필수] 회원 이용약관에 동의해 주세요.";
- custom_modal_alert(custom_opts);
- return false;
- }
- if(!document.getElementById("ds_agree2").checked){
- custom_opts.title = "[필수] 개인정보 수집이용 에 동의해 주세요.";
- custom_modal_alert(custom_opts);
- return false;
- }
- custom_opts.title = '회원가입 하시겠습니까?';
- custom_modal_confirm(custom_opts, function(confirm) {
- if(confirm) {
- $("#btn_join_proc").hide();
- var data = $("#frmMember").serialize();
- $.ajax({
- url : 'join_proc.php',
- type: 'POST',
- dataType : 'json',
- data: data,
- success: function(res) {
- custom_modal_confirm_close();
- $("#btn_join_proc").show();
- //세션 종료시 로그인 페이지로 이동
- if(res.CODE != "0000") {
- custom_opts.title = res.MSG;
- if(res.CODE == "4444") {
- window.location.href = res.DATAS.URL;
- }
- custom_modal_alert(custom_opts);
- return false;
- }
- custom_opts.title = '회원 등록이 완료되었습니다.';
- custom_opts.event_esc_key = false;
- custom_modal_alert(custom_opts, function() {
- link("login.php");
- });
- },
- error:function(request,status,error){
- $("#btn_join_proc").show();
- custom_modal_confirm_close();
- alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
- }
- });
- }else {
- $("#btn_join_proc").show();
- return false;
- }
- });
- // var c=confirm("정보를 등록하시겠습니까?");
- // if(c){
- // $("#btn_write").hide();
- // $("#frmMember").submit();
- // }else{
- // $("#btn_write").show();
- // return false;
- // }
- });
- });
- function agreeChkAll(){
- if(document.getElementById("agree_all").checked){
- document.getElementById("ds_agree1").checked = true;
- document.getElementById("ds_agree2").checked = true;
- }else{
- document.getElementById("ds_agree1").checked = false;
- document.getElementById("ds_agree2").checked = false;
- }
- }
- </script>
- <script language="javascript">
- <!--
- function sel_1(sltObj)
- {
- document.getElementById("nm_email2").value = sltObj;
- if (sltObj == "")
- {
- document.getElementById("nm_email2").readOnly = false;
- }else{
- document.getElementById("nm_email2").readOnly = true;
- }
- }
- //-->
- </script>
- <!-- s : footer -->
- <? include("../inc/inc_bottom.php"); ?>
- <!-- // e : footer -->
- <?
- mysql_close($connect);
- ?>
|