dealer_form.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $mp = "21"; //set top nav
  5. ?>
  6. <? include("../inc/inc_top.php") ?>
  7. <? include("../inc/inc_header.php") ?>
  8. <?
  9. $cd_dealer = $_REQUEST["cd_dealer"];
  10. $cd_dealer_p = $_REQUEST["cd_dealer_p"];
  11. $sql ="SELECT
  12. *
  13. FROM dealer_master
  14. WHERE cd_dealer='$cd_dealer' AND ds_delind='N'";
  15. $mode = "Add";
  16. $col=mysql_fetch_array(mysql_query($sql));
  17. if (!empty($col['cd_dealer'])){
  18. $cd_dealer = $col['cd_dealer'];
  19. $cd_dealerid = $col['cd_dealerid'];
  20. $cd_dealer_p = $col['cd_dealer_p'];
  21. $nm_pass = $col['nm_pass'];
  22. $ds_type = $col['ds_type'];
  23. $ds_level = $col['ds_level'];
  24. $nm_company = $col['nm_company'];
  25. $nm_name = $col['nm_name'];
  26. $nm_birth = $col['nm_birth'];
  27. $nm_tel_01 = $col['nm_tel_01'];
  28. $nm_tel_02 = $col['nm_tel_02'];
  29. $nm_tel_03 = $col['nm_tel_03'];
  30. $nm_hp_01 = $col['nm_hp_01'];
  31. $nm_hp_02 = $col['nm_hp_02'];
  32. $nm_hp_03 = $col['nm_hp_03'];
  33. $nm_fax_01 = $col['nm_fax_01'];
  34. $nm_fax_02 = $col['nm_fax_02'];
  35. $nm_fax_03 = $col['nm_fax_03'];
  36. $nm_email = $col['nm_email'];
  37. $nm_zip = $col['nm_zip'];
  38. $nm_addr = $col['nm_addr'];
  39. $nm_addr_sub = $col['nm_addr_sub'];
  40. $nm_etc_01 = $col['nm_etc_01'];
  41. $nm_etc_02 = $col['nm_etc_02'];
  42. $nm_etc_03 = $col['nm_etc_03'];
  43. $ds_status = $col['ds_status'];
  44. $nm_company_biz = $col['nm_company_biz'];
  45. $nm_name_biz = $col['nm_name_biz'];
  46. $nm_no_biz = $col['nm_no_biz'];
  47. $nm_date_biz = $col['nm_date_biz'];
  48. $nm_type_biz = $col['nm_type_biz'];
  49. $nm_condition_biz = $col['nm_condition_biz'];
  50. $nm_tel_biz_01 = $col['nm_tel_biz_01'];
  51. $nm_tel_biz_02 = $col['nm_tel_biz_02'];
  52. $nm_tel_biz_03 = $col['nm_tel_biz_03'];
  53. $nm_hp_biz_01 = $col['nm_hp_biz_01'];
  54. $nm_hp_biz_02 = $col['nm_hp_biz_02'];
  55. $nm_hp_biz_03 = $col['nm_hp_biz_03'];
  56. $nm_fax_biz_01 = $col['nm_fax_biz_01'];
  57. $nm_fax_biz_02 = $col['nm_fax_biz_02'];
  58. $nm_fax_biz_03 = $col['nm_fax_biz_03'];
  59. $nm_email_biz = $col['nm_email_biz'];
  60. $nm_zip_biz = $col['nm_zip_biz'];
  61. $nm_addr_biz = $col['nm_addr_biz'];
  62. $nm_addr_sub_biz = $col['nm_addr_sub_biz'];
  63. $nm_area = $col['nm_area'];
  64. $nm_title = $col['nm_title'];
  65. $nm_file = $col['nm_file'];
  66. $nm_etc = $col['nm_etc'];
  67. $nm_deposit = $col['nm_deposit'];
  68. $dt_insert = $col['dt_insert'];
  69. $nm_insert = $col['nm_insert'];
  70. $dt_update = $col['dt_update'];
  71. $nm_update = $col['nm_update'];
  72. $ds_delind = $col['ds_delind'];
  73. /*
  74. $arr_nm_info1 = explode("-",$nm_info1);
  75. if(count($arr_nm_info1) == 3){
  76. $nm_info11 = $arr_nm_info1[0];
  77. $nm_info12 = $arr_nm_info1[1];
  78. $nm_info13 = $arr_nm_info1[2];
  79. }else{
  80. $nm_info11 = "";
  81. $nm_info12 = "";
  82. $nm_info13 = "";
  83. }
  84. $arr_nm_info3 = explode("@",$nm_info3);
  85. if(count($arr_nm_info3) == 2){
  86. $nm_info31 = $arr_nm_info3[0];
  87. $nm_info32 = $arr_nm_info3[1];
  88. }else{
  89. $nm_info31 = "";
  90. $nm_info32 = "";
  91. }
  92. $nm_info3 = $col[nm_info3];
  93. */
  94. $mode = "Update";
  95. }else{
  96. $ds_level = "1";
  97. }
  98. ?>
  99. <section id="contents">
  100. <h2>딜러 회원관리</h2>
  101. <h3><em>▶</em> 딜러 회원등록</h3>
  102. <div class="tbl_wrap">
  103. <form id="frmMember" name="frmMember" method="post" action="dealer_proc.php" enctype="multipart/form-data">
  104. <input type="hidden" name="validate" id="validate" value=""/>
  105. <input type="hidden" name="ds_type" id="ds_type" value="D0"/>
  106. <input type="hidden" name="ds_level" id="ds_level" value="<?=$ds_level?>"/>
  107. <input type="hidden" name="cd_dealer" id="cd_dealer" value="<?=$cd_dealer?>"/>
  108. <input type="hidden" name="cd_dealer_p" id="cd_dealer_p" value="<?=$cd_dealer_p?>"/>
  109. <input type="hidden" name="mode" id="mode" value="<?=$mode?>"/>
  110. <!--input type="hidden" name="PageNo" id="PageNo" value="<?=$PageNo?>"/-->
  111. <input type="hidden" name="nm_email" id="nm_email" value="<?=$nm_email?>"/>
  112. <input type="hidden" name="nm_hp_01" id="nm_hp_01" value="<?=$nm_hp_01?>"/>
  113. <input type="hidden" name="nm_tel_01" id="nm_tel_01" value="<?=$nm_tel_01?>"/>
  114. <input type="hidden" name="nm_fax_01" id="nm_fax_01" value="<?=$nm_fax_01?>"/>
  115. <table class="tbl_list2">
  116. <colgroup>
  117. <col width="12%">
  118. <col width="32%">
  119. <col width="12%">
  120. <col width="*">
  121. </colgroup>
  122. <tr>
  123. <th>아이디</th>
  124. <td>
  125. <? if ($mode == "Add"){ ?>
  126. <input type="text" class="inp_txt" style="width:80%;" name="cd_dealerid" id="cd_dealerid">
  127. <? }else{ ?>
  128. <?=$cd_dealerid?>
  129. <? } ?>
  130. </td>
  131. <th>비밀번호</th>
  132. <td><input type="password" class="inp_txt" style="width:60%;" name="nm_pass" id="nm_pass"></td>
  133. </tr>
  134. <tr>
  135. <th>이름</th>
  136. <td><input type="text" class="inp_txt" style="width:80%;" name="nm_name" id="nm_name" value="<?=$nm_name?>"></td>
  137. <th>핸드폰</th>
  138. <td>
  139. <span class="select2" style="margin-right:5px;width:22%;" id="sel_nm_hp_01">
  140. <select>
  141. <option value="" >선택</option>
  142. <option value="010" <?if($nm_hp_01=="010"){?>selected="selected"<?}?> >010</option>
  143. <option value="011" <?if($nm_hp_01=="011"){?>selected="selected"<?}?> >011</option>
  144. <option value="016" <?if($nm_hp_01=="016"){?>selected="selected"<?}?> >016</option>
  145. <option value="017" <?if($nm_hp_01=="017"){?>selected="selected"<?}?> >017</option>
  146. <option value="018" <?if($nm_hp_01=="018"){?>selected="selected"<?}?> >018</option>
  147. <option value="019" <?if($nm_hp_01=="019"){?>selected="selected"<?}?> >019</option>
  148. <option value="070" <?if($nm_hp_01=="070"){?>selected="selected"<?}?> >070</option>
  149. </select>
  150. </span>
  151. <input type="text" class="inp_txt" style="width:22%;" name="nm_hp_02" id="nm_hp_02" value="<?=$nm_hp_02?>"> - <input type="text" class="inp_txt" style="width:22%;" name="nm_hp_03" id="nm_hp_03" value="<?=$nm_hp_03?>">
  152. </td>
  153. </tr>
  154. <tr>
  155. <th>상호</th>
  156. <td><input type="text" class="inp_txt" style="width:80%;" name="nm_company" id="nm_company" value="<?=$nm_company?>"></td>
  157. <th>연락처</th>
  158. <td>
  159. <span class="select2" style="margin-right:5px;width:22%;" id="sel_nm_tel_01">
  160. <select>
  161. <option>선택</option>
  162. <option value="02"<?if($nm_tel_01=="02"){?> selected="selected"<?}?>>02</option>
  163. <option value="031"<?if($nm_tel_01=="031"){?> selected="selected"<?}?>>031</option>
  164. <option value="032"<?if($nm_tel_01=="032"){?> selected="selected"<?}?>>032</option>
  165. <option value="033"<?if($nm_tel_01=="033"){?> selected="selected"<?}?>>033</option>
  166. <option value="041"<?if($nm_tel_01=="041"){?> selected="selected"<?}?>>041</option>
  167. <option value="042"<?if($nm_tel_01=="042"){?> selected="selected"<?}?>>042</option>
  168. <option value="043"<?if($nm_tel_01=="043"){?> selected="selected"<?}?>>043</option>
  169. <option value="044"<?if($nm_tel_01=="044"){?> selected="selected"<?}?>>044</option>
  170. <option value="051"<?if($nm_tel_01=="051"){?> selected="selected"<?}?>>051</option>
  171. <option value="052"<?if($nm_tel_01=="052"){?> selected="selected"<?}?>>052</option>
  172. <option value="053"<?if($nm_tel_01=="053"){?> selected="selected"<?}?>>053</option>
  173. <option value="054"<?if($nm_tel_01=="054"){?> selected="selected"<?}?>>054</option>
  174. <option value="055"<?if($nm_tel_01=="055"){?> selected="selected"<?}?>>055</option>
  175. <option value="061"<?if($nm_tel_01=="061"){?> selected="selected"<?}?>>061</option>
  176. <option value="062"<?if($nm_tel_01=="062"){?> selected="selected"<?}?>>062</option>
  177. <option value="063"<?if($nm_tel_01=="063"){?> selected="selected"<?}?>>063</option>
  178. <option value="064"<?if($nm_tel_01=="064"){?> selected="selected"<?}?>>064</option>
  179. </select>
  180. </span>
  181. <input type="text" class="inp_txt" style="width:22%;" name="nm_tel_02" id="nm_tel_02" value="<?=$nm_tel_02?>"> - <input type="text" class="inp_txt" style="width:22%;" name="nm_tel_03" id="nm_tel_03" value="<?=$nm_tel_03?>">
  182. </td>
  183. </tr>
  184. <tr>
  185. <th>팩스번호</th>
  186. <td colspan="3">
  187. <span class="select2" style="margin-right:5px;width:12%;" id="sel_nm_fax_01">
  188. <select>
  189. <option value="" >선택</option>
  190. <option value="02"<?if($nm_fax_01=="02"){?> selected="selected"<?}?>>02</option>
  191. <option value="031"<?if($nm_fax_01=="031"){?> selected="selected"<?}?>>031</option>
  192. <option value="032"<?if($nm_fax_01=="032"){?> selected="selected"<?}?>>032</option>
  193. <option value="033"<?if($nm_fax_01=="033"){?> selected="selected"<?}?>>033</option>
  194. <option value="041"<?if($nm_fax_01=="041"){?> selected="selected"<?}?>>041</option>
  195. <option value="042"<?if($nm_fax_01=="042"){?> selected="selected"<?}?>>042</option>
  196. <option value="043"<?if($nm_fax_01=="043"){?> selected="selected"<?}?>>043</option>
  197. <option value="044"<?if($nm_fax_01=="044"){?> selected="selected"<?}?>>044</option>
  198. <option value="051"<?if($nm_fax_01=="051"){?> selected="selected"<?}?>>051</option>
  199. <option value="052"<?if($nm_fax_01=="052"){?> selected="selected"<?}?>>052</option>
  200. <option value="053"<?if($nm_fax_01=="053"){?> selected="selected"<?}?>>053</option>
  201. <option value="054"<?if($nm_fax_01=="054"){?> selected="selected"<?}?>>054</option>
  202. <option value="055"<?if($nm_fax_01=="055"){?> selected="selected"<?}?>>055</option>
  203. <option value="061"<?if($nm_fax_01=="061"){?> selected="selected"<?}?>>061</option>
  204. <option value="062"<?if($nm_fax_01=="062"){?> selected="selected"<?}?>>062</option>
  205. <option value="063"<?if($nm_fax_01=="063"){?> selected="selected"<?}?>>063</option>
  206. <option value="064"<?if($nm_fax_01=="064"){?> selected="selected"<?}?>>064</option>
  207. </select>
  208. </span>
  209. <input type="text" class="inp_txt" style="width:12%;" name="nm_fax_02" id="nm_fax_02" value="<?=$nm_fax_02?>"> - <input type="text" class="inp_txt" style="width:12%;" name="nm_fax_02" id="nm_fax_02" value="<?=$nm_fax_02?>">
  210. </td>
  211. </tr>
  212. <tr>
  213. <th>주소</th>
  214. <td colspan="3">
  215. <input type="text" class="inp_txt" style="margin-right:5px;width:15%;" name="nm_zip" id="nm_zip" value="<?=$nm_zip?>" readonly="readonly">
  216. <a href="#" class="rnd_btn ty3 gray" style="width:80px;" onClick="execDaumPostcode('');">우편번호</a>
  217. <p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr" id="nm_addr" value="<?=$nm_addr?>" readonly="readonly"></p>
  218. <p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr_sub" id="nm_addr_sub" value="<?=$nm_addr_sub?>"></p>
  219. </td>
  220. </tr>
  221. <tr>
  222. <th>승인상태</th>
  223. <td colspan="3">
  224. <div class="radio_chk">
  225. <span class="check_wrap"><input type="radio" name="ds_status" id="radio1" value="Z0"<?if($ds_status=="Z0"){?> checked="checked"<?}?>><i></i><label for="radio1">승인</label></span>
  226. <span class="check_wrap"><input type="radio" name="ds_status" id="radio2" value="A0"<?if($ds_status!="Z0"){?> checked="checked"<?}?>><i></i><label for="radio2">미승인</label></span>
  227. </div>
  228. </td>
  229. </tr>
  230. </table>
  231. </div>
  232. <h3><em>▶</em> 사업자 정보</h3>
  233. <div class="tbl_wrap">
  234. <table class="tbl_list2">
  235. <colgroup>
  236. <col width="12%">
  237. <col width="32%">
  238. <col width="12%">
  239. <col width="*">
  240. </colgroup>
  241. <tr>
  242. <th>상호</th>
  243. <td><input type="text" class="inp_txt" style="width:80%;" name="nm_company_biz" id="nm_company_biz" value="<?=$nm_company_biz?>"></td>
  244. <th>사업자번호</th>
  245. <td><input type="text" class="inp_txt" style="width:60%;" name="nm_no_biz" id="nm_no_biz" value="<?=$nm_no_biz?>"></td>
  246. </tr>
  247. <tr>
  248. <th>대표자명</th>
  249. <td><input type="text" class="inp_txt" style="width:80%;" name="nm_name_biz" id="nm_name_biz" value="<?=$nm_name_biz?>"></td>
  250. <th>종목</th>
  251. <td><input type="text" class="inp_txt" style="width:60%;" name="nm_type_biz" id="nm_type_biz" value="<?=$nm_type_biz?>"></td>
  252. </tr>
  253. <tr>
  254. <th>업태</th>
  255. <td colspan="3"><input type="text" class="inp_txt" style="width:28%;" name="nm_condition_biz" id="nm_condition_biz" value="<?=$nm_condition_biz?>"></td>
  256. </tr>
  257. <tr>
  258. <th>주소</th>
  259. <td colspan="3">
  260. <input type="text" class="inp_txt" style="margin-right:5px;width:15%;" name="nm_zip_biz" id="nm_zip_biz" value="<?=$nm_zip_biz?>" readonly="readonly">
  261. <a href="#" class="rnd_btn ty3 gray" style="width:80px;" onClick="execDaumPostcode('_biz');">우편번호</a>
  262. <p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr_biz" id="nm_addr_biz" value="<?=$nm_addr_biz?>" readonly="readonly"></p>
  263. <p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr_sub_biz" id="nm_addr_sub_biz" value="<?=$nm_addr_sub_biz?>"></p>
  264. </td>
  265. </tr>
  266. </table>
  267. </div>
  268. <div class="btn_right">
  269. <a href="#" class="rnd_btn ty2 gray" onclick="location.replace('<?=ADMIN_PATH?>member/dealer.php?PageNo=<?=$PageNo?>');">목록</a>
  270. <a href="#" class="rnd_btn ty2 black" id="btn_write">저장</a>
  271. </div>
  272. </section>
  273. <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script>
  274. <script>
  275. function execDaumPostcode(arg) {
  276. new daum.Postcode({
  277. oncomplete: function(data) {
  278. // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
  279. // 각 주소의 노출 규칙에 따라 주소를 조합한다.
  280. // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
  281. var fullAddr = ''; // 최종 주소 변수
  282. var extraAddr = ''; // 조합형 주소 변수
  283. // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
  284. if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
  285. fullAddr = data.roadAddress;
  286. } else { m
  287. fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
  288. }
  289. // 우편번호와 주소 정보를 해당 필드에 넣는다.
  290. document.getElementById('nm_zip'+arg).value = data.zonecode; //5자리 새우편번호 사용
  291. document.getElementById('nm_addr'+arg).value = fullAddr;
  292. // 커서를 상세주소 필드로 이동한다.
  293. document.getElementById('nm_addr_sub'+arg).focus();
  294. }
  295. }).open();
  296. }
  297. </script>
  298. <script laguage="javascript" type="text/javascript">
  299. $(document).ready(function() {
  300. setCodeSelect("listcode","ds_area", "dealer_master","ds_area","<?=$ds_area?>","선택하세요","");
  301. //$('select').jqTransSelectRefresh();
  302. // $("#sel_ds_area div.jq_sel span").html($("#sel_ds_area option:selected").text()); //select box 대신 보이는 span 에 select value의 텍스트를 setting
  303. /*
  304. $("#cd_dealerid").bind("keyup",function(){
  305. $("#idchkresult").val("N");
  306. });
  307. $("#nm_email3").on("change", function(){
  308. if($(this).val() == ""){
  309. $("#nm_email2").show();
  310. }else{
  311. $("#nm_email2").hide();
  312. }
  313. });
  314. $("#btn_idchk").bind("click",function(){
  315. if($("#nm_email1").val() == ""){
  316. alert("이메일을 입력하세요.");
  317. $("#nm_email1").focus();
  318. return false;
  319. }
  320. if($("#nm_email3").val() == ""){
  321. if($("#nm_email2").val() == ""){
  322. alert("이메일을 입력하세요.");
  323. $("#nm_email2").focus();
  324. return false;
  325. }
  326. $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
  327. }else{
  328. $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email3").val());
  329. }
  330. $.post("dealer_proc.php", { mode: "IdChk", nm_email: $("#nm_email").val()},function(data) {
  331. if(data=="Y"){
  332. if(confirm("이용가능합니다. 아이디를 사용하시겠습니까?")){
  333. $("#cd_dealerid").attr("readonly",true).css("background","#d2d3d5");
  334. $("#idchkresult").val("Y");
  335. return;
  336. }
  337. }else{
  338. alert("사용불가능한 아이디 입니다.");
  339. $("#idchkresult").val("N");
  340. return;
  341. }
  342. });
  343. return false;
  344. });
  345. $("#btn_delete").bind("click",function(){
  346. if(confirm("삭제하시겠습니까?")){
  347. $("#mode").val("Delete");
  348. $("#frmMember").submit();
  349. }
  350. });
  351. $("#agree_all").bind("click",function(){
  352. agreeChkAll();
  353. });
  354. $("#agree_all").bind("keyup",function(){
  355. agreeChkAll();
  356. });
  357. */
  358. $("#sel_nm_hp_01 div.jq_sel ul li a").bind("click",function(){
  359. $("#nm_hp_01").val($("#sel_nm_hp_01 option:selected").val());
  360. });
  361. $("#sel_nm_tel_01 div.jq_sel ul li a").bind("click",function(){
  362. $("#nm_tel_01").val($("#sel_nm_tel_01 option:selected").val());
  363. });
  364. $("#sel_nm_fax_01 div.jq_sel ul li a").bind("click",function(){
  365. $("#nm_fax_01").val($("#sel_nm_fax_01 option:selected").val());
  366. });
  367. $("#btn_write").bind("click",function(){
  368. <? if ($mode == "Add"){ ?>
  369. var fieldlist = [["cd_dealerid","아이디"],["nm_pass","비밀번호"],["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"]]
  370. <? }else{ ?>
  371. var fieldlist = [["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"]]
  372. <? } ?>
  373. if (!fnCheckForm(fieldlist)){
  374. return false;
  375. }else{
  376. /*아이디 관련 처리*/
  377. var idReg1 = /[a-z]/g;
  378. var idReg2 = /[0-9]/g;
  379. /*
  380. if( !(idReg1.test( $("#cd_dealerid").val() )) || !(idReg2.test( $("#cd_dealerid").val() )) ) {
  381. alert("아이디는 영문/숫자 조합으로 이루어져야 합니다.");
  382. $("#cd_dealerid").focus();
  383. return false;
  384. }
  385. var idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
  386. if( !idReg.test( $("#cd_dealerid").val() ) ) {
  387. alert("아이디는 영문자로 시작하는 6~20자 영문자 또는 숫자이어야 합니다.");
  388. $("#cd_dealerid").focus();
  389. return false;
  390. }
  391. if(!fnCheckAlphaNumber($("#cd_dealerid").val())){
  392. alert('아이디는 영문/숫자 조합으로 이루어져야 합니다.');
  393. return false;
  394. }
  395. if($("#cd_dealerid").val().length <6){
  396. alert("6글자 이상 아이디를 입력하세요");
  397. $("#cd_dealerid").focus();
  398. return false;
  399. }
  400. if($("#idchkresult").val() != "Y"){
  401. alert("아이디 중복확인을 해 주세요.");
  402. $("#idchkresult").focus();
  403. return false;
  404. }
  405. */
  406. <? if ($mode == "Add"){ ?>
  407. /*패스워드 처리*/
  408. // if($("#nm_pass").val().length == 0 || $("#nm_pass2").val().length == 0){
  409. // alert("패스워드를 입력하세요");
  410. // $("#nm_pass").focus();
  411. // return false;
  412. // }
  413. if($("#nm_pass").val().length > 0){
  414. if($("#cd_dealerid").val()==$("#nm_pass").val()){
  415. alert("아이디와 변경할 패스워드를 다르게입력하세요");
  416. $("#nm_pass").focus();
  417. return false;
  418. }
  419. if($("#nm_pass").val().length <6){
  420. alert("6글자 이상 변경할 패스워드를 입력하세요");
  421. $("#nm_pass").focus();
  422. return false;
  423. }
  424. if(!isStrongValidFormPassword($("#nm_pass").val())){
  425. return false;
  426. }
  427. }
  428. <? } ?>
  429. /*
  430. if(!ChkNum($("#nm_hp").val())){
  431. alert("휴대폰 번호는 숫자만 입력하세요.");
  432. $("#nm_hp").focus();
  433. return false;
  434. }
  435. if($("#nm_hp_01").val() == ""){
  436. alert("휴대폰 번호를 입력하세요.");
  437. $("#nm_hp_01").focus();
  438. return false;
  439. }
  440. if($("#nm_hp_02").val() == ""){
  441. alert("휴대폰 번호를 입력하세요.");
  442. $("#nm_hp_02").focus();
  443. return false;
  444. }
  445. if($("#nm_hp_03").val() == ""){
  446. alert("휴대폰 번호를 입력하세요.");
  447. $("#nm_hp_03").focus();
  448. return false;
  449. }
  450. */
  451. /*
  452. $("#nm_hp").val($("#nm_hp_01").val()+"-"+$("#nm_hp_02").val()+"-"+$("#nm_hp_03").val());
  453. if($("#nm_email1").val() == ""){
  454. alert("이메일을 입력하세요.");
  455. $("#nm_email1").focus();
  456. return false;
  457. }
  458. if($("#nm_email3").val() == ""){
  459. if($("#nm_email2").val() == ""){
  460. alert("이메일을 입력하세요.");
  461. $("#nm_email2").focus();
  462. return false;
  463. }
  464. $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
  465. }else{
  466. $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email3").val());
  467. }
  468. */
  469. <? if ($mode == "Add"){ ?>
  470. // $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
  471. <? } ?>
  472. /*
  473. if($("#nm_addr").val() == ""){
  474. alert("주소를 입력하세요.");
  475. $("#nm_addr").focus();
  476. return false;
  477. }
  478. if($("#nm_addr_sub").val() == ""){
  479. alert("주소를 입력하세요.");
  480. $("#nm_addr_sub").focus();
  481. return false;
  482. }
  483. if(!document.getElementById("ds_agree1").checked){
  484. alert('[필수] 회원 이용약관에 동의해 주세요.');
  485. $("#ds_agree1").focus();
  486. return false;
  487. }
  488. if(!document.getElementById("ds_agree2").checked){
  489. alert('[필수] 개인정보 수집이용 에 동의해 주세요.');
  490. $("#ds_agree2").focus();
  491. return false;
  492. }
  493. */
  494. var c=confirm("정보를 등록하시겠습니까?");
  495. if(c){
  496. $("#btn_write").hide();
  497. $("#frmMember").submit();
  498. }else{
  499. $("#btn_write").show();
  500. return false;
  501. }
  502. }
  503. });
  504. });
  505. /*
  506. function agreeChkAll(){
  507. if(document.getElementById("agree_all").checked){
  508. document.getElementById("ds_agree1").checked = true;
  509. document.getElementById("ds_agree2").checked = true;
  510. document.getElementById("ds_agree3").checked = true;
  511. document.getElementById("ds_agree4").checked = true;
  512. }else{
  513. document.getElementById("ds_agree1").checked = false;
  514. document.getElementById("ds_agree2").checked = false;
  515. document.getElementById("ds_agree3").checked = false;
  516. document.getElementById("ds_agree4").checked = false;
  517. }
  518. }
  519. */
  520. </script>
  521. <script language="javascript">
  522. <!--
  523. function sel_1(sltObj)
  524. {
  525. document.getElementById("nm_email2").value = sltObj;
  526. if (sltObj == "")
  527. {
  528. document.getElementById("nm_email2").readOnly = false;
  529. }else{
  530. document.getElementById("nm_email2").readOnly = true;
  531. }
  532. }
  533. //-->
  534. </script>
  535. <? include("../inc/inc_footer.php") ?>
  536. <? include("../inc/inc_bottom.php") ?>
  537. <?
  538. mysql_close($connect);
  539. ?>