join.test.php 13 KB

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