join02.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. $nav_title = "일반 회원가입";
  4. // $show_btn_back = true;
  5. ?>
  6. <?php include("include/header.php") ?>
  7. <style>
  8. .txt_red{color:#be0606;}
  9. </style>
  10. <main class="normal--wrap" style="padding-bottom:90px;">
  11. <section class="join--form--wrap">
  12. <div class="join--form--contents">
  13. <form id="frmMember" name="frmMember" method="post" action="join_proc.php" enctype="multipart/form-data">
  14. <input type="hidden" name="mode" id="mode" value="Add"/>
  15. <input type="hidden" name="idchkresult" id="idchkresult" value="N"/>
  16. <input type="hidden" name="ds_agree1" id="ds_agree1" value="Y"/>
  17. <input type="hidden" name="ds_agree2" id="ds_agree2" value="Y"/>
  18. <input type="hidden" name="ds_agree3" id="ds_agree3" value="Y"/>
  19. <input type="hidden" name="ds_agree4" id="ds_agree4" value="Y"/>
  20. <!-- <input type="hidden" name="nm_hp" id="nm_hp" value=""/> -->
  21. <!-- <input type="hidden" name="nm_email" id="nm_email" value=""/> -->
  22. <div class="join--form--inner">
  23. <h2>개인 정보 입력</h2>
  24. <div>
  25. <input type="text" class="form-control" name="cd_userid" id="cd_userid" placeholder="아이디">
  26. <p id="id_chk_info" class="hide"></p>
  27. </div>
  28. <div>
  29. <input type="password" class="form-control" name="nm_pass" id="nm_pass" maxlength="20" placeholder="패스워드">
  30. </div>
  31. <div>
  32. <input type="password" class="form-control" name="nm_pass2" id="nm_pass2" maxlength="20" placeholder="패스워드 확인">
  33. </div>
  34. <div>
  35. <input type="text" class="form-control" name="nm_name" id="nm_name" maxlength="20" placeholder="이름">
  36. </div>
  37. <div>
  38. <input type="text" class="form-control" id="nm_hp" name="nm_hp" placeholder="핸드폰 번호">
  39. </div>
  40. <div>
  41. <input type="text" class="form-control" id="nm_email" name="nm_email" placeholder="이메일">
  42. </div>
  43. <div class="agree--wrapper mt35 d-flex justify-content-end">
  44. <input type="checkbox" id="ds_agree10" class="ty2" hidden>
  45. <label for="ds_agree10">회원 이용약관 (필수)</label>
  46. <button type="button" class="info--btn btn" data-bs-toggle="modal" data-bs-target="#agreeModal1">약관보기</button>
  47. </div>
  48. <div class="agree--wrapper mt35 d-flex justify-content-end">
  49. <input type="checkbox" id="ds_agree20" class="ty2" hidden>
  50. <label for="ds_agree20">개인정보 수집 및 이용 동의 (필수)</label>
  51. <button type="button" class="info--btn btn" data-bs-toggle="modal" data-bs-target="#agreeModal2">약관보기</button>
  52. </div>
  53. <div class="col-12 d-flex justify-content-center join--btn--wrap floating--btn">
  54. <button type="button" class="btn btn-primary" id="btn_join_proc">회원가입</button>
  55. </div>
  56. </form>
  57. </div>
  58. </section>
  59. </main>
  60. <!-- 회원이용약관 -->
  61. <div class="modal fade type2" id="agreeModal1" tabindex="-1" aria-labelledby="agree_lable1" aria-hidden="true">
  62. <div class="modal-dialog modal-dialog-centered" style="max-width:calc(100vw - 40px);">
  63. <div class="modal-content">
  64. <div class="modal-header">
  65. <h1 class="modal-title" id="agree_lable1">회원 이용약관 동의</h1>
  66. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  67. </div>
  68. <div class="modal-body modal--body pt0">
  69. <div class="date--text" style="max-height:60vh; overflow-y: auto;">
  70. <?php include("../../include/clause_txt1.txt"); ?>
  71. </div>
  72. </div>
  73. <div class="modal-footer d-flex justify-content-center ty2 ty--2">
  74. <button type="button" class="btn btn-primary" data-bs-dismiss="modal" style="max-width:100px;">확인</button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <!-- 개인정보 수집이용 -->
  80. <div class="modal fade type2" id="agreeModal2" tabindex="-1" aria-labelledby="agree_lable2" aria-hidden="true">
  81. <div class="modal-dialog modal-dialog-centered" style="max-width:calc(100vw - 40px);">
  82. <div class="modal-content">
  83. <div class="modal-header">
  84. <h1 class="modal-title" id="agree_lable2">개인정보 수집 및 이용 동의</h1>
  85. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  86. </div>
  87. <div class="modal-body modal--body pt0">
  88. <div class="date--text" style="max-height:60vh; overflow-y: auto;">
  89. <? include("../../include/clause_txt2.txt"); ?>
  90. </div>
  91. </div>
  92. <div class="modal-footer d-flex justify-content-center ty2 ty--2">
  93. <button type="button" class="btn btn-primary" data-bs-dismiss="modal" style="max-width:100px;">확인</button>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <script>
  99. function id_chk() {
  100. var cd_userid = $("#cd_userid").val();
  101. var custom_opts = {
  102. title : '',
  103. btn_close_show : false,
  104. }
  105. if($.trim(cd_userid) == ""){
  106. return false;
  107. }
  108. $("#id_chk_info").removeClass("txt_red").removeClass("hide");
  109. $.post("join_proc.php", { mode: "IdChk", cd_userid: cd_userid},function(res) {
  110. if(res.CODE != "0000"){
  111. $("#idchkresult").val("N");
  112. id_chk_info = "사용불가능한 아이디 입니다.";
  113. $("#id_chk_info").addClass("txt_red").text(id_chk_info);
  114. }else {
  115. $("#idchkresult").val("Y");
  116. id_chk_info = "사용할 수 있는 아이디입니다.";
  117. $("#id_chk_info").removeClass("txt_red").text(id_chk_info);
  118. }
  119. }, "json");
  120. return false;
  121. }
  122. $(function() {
  123. setCodeSelect("listPhone","nm_hp1","","","","선택","");
  124. setCodeSelect("listEmail","nm_email3","","","","직접입력","");
  125. setCodeSelect("listcode","ds_company_bp", "sa_master","ds_company_bp","","관계사를 선택하세요","");
  126. setCodeSelect("listcode","ds_branch", "sa_master","ds_branch","","지점을 선택하세요","-1");
  127. //아이디 체크
  128. $("#cd_userid").bind("focusout", id_chk);
  129. $("#btn_login_page").on("click", function() {
  130. link("login.php");
  131. });
  132. $("#ds_company_bp").change(function(){
  133. setCodeSelect("listcode","ds_branch", "sa_master","ds_branch","","선택하세요",$(this).val());
  134. });
  135. $("#cd_userid").bind("keyup",function(){
  136. $("#idchkresult").val("N");
  137. $("#id_chk_info").removeClass("txt_red").addClass("hide").text("");
  138. });
  139. $("#nm_email3").on("change", function(){
  140. if($(this).val() == ""){
  141. $("#nm_email2").show();
  142. }else{
  143. $("#nm_email2").hide();
  144. }
  145. });
  146. $("#btn_join_proc").on('click', function() {
  147. var custom_opts = {
  148. title : '',
  149. btn_close_show : false,
  150. }
  151. var fieldlist = [["cd_userid","아이디"],["nm_pass","패스워드"],["nm_pass2","패스워드 확인"],["nm_name","이름"],["nm_hp","휴대번호"]
  152. ,["ds_company_bp","관계사"], ["ds_branch", "지점"]]
  153. var nm_email3 = $("#nm_email3").val();
  154. if(nm_email3 == "") {
  155. fieldlist.push(["nm_email2"]);
  156. }
  157. if (!fnCheckForm(fieldlist)){
  158. return false;
  159. }
  160. var idReg1 = /[a-z]/g;
  161. var idReg2 = /[0-9]/g;
  162. if( !(idReg1.test( $("#cd_userid").val() )) || !(idReg2.test( $("#cd_userid").val() )) ) {
  163. custom_opts.title = '아이디는 영문/숫자 조합으로 이루어져야 합니다.';
  164. custom_modal_alert(custom_opts);
  165. return false;
  166. }
  167. // var idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
  168. // if( !idReg.test( $("#cd_userid").val() ) ) {
  169. // custom_opts.title = '아이디는 영문자로 시작하는 6~20자 영문자 또는 숫자이어야 합니다.';
  170. //
  171. // custom_modal_alert(custom_opts);
  172. // return false;
  173. // }
  174. var idReg = /^[a-z]+[a-z0-9]{3,19}$/g;
  175. if( !idReg.test( $("#cd_userid").val() ) ) {
  176. custom_opts.title = '아이디는 영문자로 시작하는 4~20자 영문자 또는 숫자이어야 합니다.';
  177. custom_modal_alert(custom_opts);
  178. return false;
  179. }
  180. if(!fnCheckAlphaNumber($("#cd_userid").val())){
  181. custom_opts.title = '아이디는 영문/숫자 조합으로 이루어져야 합니다.';
  182. custom_modal_alert(custom_opts);
  183. return false;
  184. }
  185. // if($("#cd_userid").val().length <6){
  186. // custom_opts.title = '아이디는6글자 이상 아이디를 입력하세요.';
  187. //
  188. // custom_modal_alert(custom_opts);
  189. // return false;
  190. // }
  191. if($("#cd_userid").val().length <4){
  192. custom_opts.title = '아이디는4글자 이상 아이디를 입력하세요.';
  193. custom_modal_alert(custom_opts);
  194. return false;
  195. }
  196. if($("#idchkresult").val() != "Y"){
  197. custom_opts.title = '아이디 중복확인을 해 주세요.';
  198. custom_modal_alert(custom_opts);
  199. return false;
  200. }
  201. /*패스워드 처리*/
  202. if($("#nm_pass").val().length == 0 || $("#nm_pass2").val().length == 0){
  203. custom_opts.title = '패스워드를 입력하세요.';
  204. custom_modal_alert(custom_opts);
  205. return false;
  206. }
  207. if($("#nm_pass").val().length > 0){
  208. if($("#nm_email1").val()==$("#nm_pass").val()){
  209. custom_opts.title = '아이디와 패스워드는 다르게입력하세요.';
  210. custom_modal_alert(custom_opts);
  211. return false;
  212. }
  213. if($("#nm_pass").val()!=$("#nm_pass2").val()){
  214. custom_opts.title = '패스워드가 일치하지 않습니다.';
  215. custom_modal_alert(custom_opts);
  216. return false;
  217. }
  218. if(!fnCheckAlphaNumber($("#nm_pass").val())){
  219. custom_opts.title = '패스워드는 영문/숫자 조합으로 이루어져야 합니다.';
  220. custom_modal_alert(custom_opts);
  221. return false;
  222. }
  223. if($("#nm_pass").val().length <8){
  224. custom_opts.title = '8글자 이상 패스워드를 입력하세요.';
  225. custom_modal_alert(custom_opts);
  226. return false;
  227. }
  228. }
  229. /*연락처*/
  230. // $("#nm_hp").val($("#nm_hp1").val()+"-"+$("#nm_hp2").val()+"-"+$("#nm_hp3").val());
  231. //
  232. // /*이메일 체크*/
  233. // var nm_email3 = $("#nm_email3").val();
  234. // if($.trim(nm_email3) == "") {
  235. // $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
  236. // }else {
  237. // $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email3").val());
  238. // }
  239. var nm_email = $("#nm_email").val();
  240. if($.trim(nm_email) != "") {
  241. if(!isValid(nm_email,"regEmail")){
  242. custom_opts.title = '정확한 이메일을 입력하세요.';
  243. custom_modal_alert(custom_opts);
  244. return false;
  245. }
  246. }
  247. if(!document.getElementById("ds_agree10").checked){
  248. custom_opts.title = "[필수] 회원 이용약관에 동의해 주세요.";
  249. custom_modal_alert(custom_opts);
  250. return false;
  251. }
  252. if(!document.getElementById("ds_agree20").checked){
  253. custom_opts.title = "[필수] 개인정보 수집이용 에 동의해 주세요.";
  254. custom_modal_alert(custom_opts);
  255. return false;
  256. }
  257. custom_opts.title = '회원가입 하시겠습니까?';
  258. custom_modal_confirm(custom_opts, function(confirm) {
  259. if(confirm) {
  260. $("#btn_join_proc").hide();
  261. var data = $("#frmMember").serialize();
  262. $.ajax({
  263. url : 'join_proc.php',
  264. type: 'POST',
  265. dataType : 'json',
  266. data: data,
  267. success: function(res) {
  268. custom_modal_confirm_close();
  269. $("#btn_join_proc").show();
  270. //세션 종료시 로그인 페이지로 이동
  271. if(res.CODE != "0000") {
  272. custom_opts.title = res.MSG;
  273. if(res.CODE == "4444") {
  274. window.location.href = res.DATAS.URL;
  275. }
  276. custom_modal_alert(custom_opts);
  277. return false;
  278. }
  279. custom_opts.title = '회원 등록이 완료되었습니다.';
  280. custom_opts.event_esc_key = false;
  281. custom_modal_alert(custom_opts, function() {
  282. link("login.php");
  283. });
  284. },
  285. error:function(request,status,error){
  286. $("#btn_join_proc").show();
  287. custom_modal_confirm_close();
  288. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  289. }
  290. });
  291. }else {
  292. $("#btn_join_proc").show();
  293. return false;
  294. }
  295. });
  296. });
  297. })
  298. </script>
  299. <?php include("include/bottom.php") ?>