dealer_manager_form.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].'/common/dealer_chk.php';
  4. ?>
  5. <? include("../include/inc_top.php") ?>
  6. <? include("../include/inc_header.php") ?>
  7. <?
  8. $cd_dealer = $_REQUEST["cd_dealer"];
  9. $ds_type = "D1";
  10. $sql ="SELECT
  11. *
  12. FROM dealer_master
  13. WHERE cd_dealer='$cd_dealer' AND ds_delind='N'";
  14. $mode = "Add";
  15. $ds_usertype = $_SESSION['s_ds_usertype'];
  16. $ds_company_bp1 = $_SESSION['s_ds_company_bp1'];
  17. $ds_branch1 = $_SESSION['s_ds_branch1'];
  18. $ds_company_bp2 = $_SESSION['s_ds_company_bp2'];
  19. $ds_branch2 = $_SESSION['s_ds_branch2'];
  20. $ds_company_bp3 = $_SESSION['s_ds_company_bp3'];
  21. $ds_branch3 = $_SESSION['s_ds_branch3'];
  22. $col=mysql_fetch_array(mysql_query($sql));
  23. if (!empty($col[cd_dealer])){
  24. $cd_dealer = $col[cd_dealer];
  25. $cd_dealerid = $col[cd_dealerid];
  26. $cd_dealer_p = $col[cd_dealer_p];
  27. $nm_pass = $col[nm_pass];
  28. $ds_type = $col[ds_type];
  29. $ds_usertype = $col[ds_usertype];
  30. $ds_level = $col[ds_level];
  31. $nm_company = $col[nm_company];
  32. $nm_name = $col[nm_name];
  33. $nm_birth = $col[nm_birth];
  34. $nm_tel_01 = $col[nm_tel_01];
  35. $nm_tel_02 = $col[nm_tel_02];
  36. $nm_tel_03 = $col[nm_tel_03];
  37. $nm_hp_01 = $col[nm_hp_01];
  38. $nm_hp_02 = $col[nm_hp_02];
  39. $nm_hp_03 = $col[nm_hp_03];
  40. $nm_fax_01 = $col[nm_fax_01];
  41. $nm_fax_02 = $col[nm_fax_02];
  42. $nm_fax_03 = $col[nm_fax_03];
  43. $nm_email = $col[nm_email];
  44. $nm_zip = $col[nm_zip];
  45. $nm_addr = $col[nm_addr];
  46. $nm_addr_sub = $col[nm_addr_sub];
  47. $nm_etc_01 = $col[nm_etc_01];
  48. $nm_etc_02 = $col[nm_etc_02];
  49. $nm_etc_03 = $col[nm_etc_03];
  50. $ds_status = $col[ds_status];
  51. $nm_company_biz = $col[nm_company_biz];
  52. $nm_name_biz = $col[nm_name_biz];
  53. $nm_no_biz = $col[nm_no_biz];
  54. $nm_date_biz = $col[nm_date_biz];
  55. $nm_type_biz = $col[nm_type_biz];
  56. $nm_condition_biz = $col[nm_condition_biz];
  57. $nm_tel_biz_01 = $col[nm_tel_biz_01];
  58. $nm_tel_biz_02 = $col[nm_tel_biz_02];
  59. $nm_tel_biz_03 = $col[nm_tel_biz_03];
  60. $nm_hp_biz_01 = $col[nm_hp_biz_01];
  61. $nm_hp_biz_02 = $col[nm_hp_biz_02];
  62. $nm_hp_biz_03 = $col[nm_hp_biz_03];
  63. $nm_fax_biz_01 = $col[nm_fax_biz_01];
  64. $nm_fax_biz_02 = $col[nm_fax_biz_02];
  65. $nm_fax_biz_03 = $col[nm_fax_biz_03];
  66. $nm_email_biz = $col[nm_email_biz];
  67. $nm_zip_biz = $col[nm_zip_biz];
  68. $nm_addr_biz = $col[nm_addr_biz];
  69. $nm_addr_sub_biz = $col[nm_addr_sub_biz];
  70. $ds_company_bp1 = $col[ds_company_bp1];
  71. $ds_branch1 = $col[ds_branch1];
  72. $ds_company_bp2 = $col[ds_company_bp2];
  73. $ds_branch2 = $col[ds_branch2];
  74. $ds_company_bp3 = $col[ds_company_bp3];
  75. $ds_branch3 = $col[ds_branch3];
  76. $nm_area = $col[nm_area];
  77. $nm_title = $col[nm_title];
  78. $nm_file = $col[nm_file];
  79. $nm_etc = $col[nm_etc];
  80. $nm_deposit = $col[nm_deposit];
  81. $dt_insert = $col[dt_insert];
  82. $nm_insert = $col[nm_insert];
  83. $dt_update = $col[dt_update];
  84. $nm_update = $col[nm_update];
  85. $ds_delind = $col[ds_delind];
  86. /*
  87. $arr_nm_info1 = explode("-",$nm_info1);
  88. if(count($arr_nm_info1) == 3){
  89. $nm_info11 = $arr_nm_info1[0];
  90. $nm_info12 = $arr_nm_info1[1];
  91. $nm_info13 = $arr_nm_info1[2];
  92. }else{
  93. $nm_info11 = "";
  94. $nm_info12 = "";
  95. $nm_info13 = "";
  96. }
  97. $arr_nm_info3 = explode("@",$nm_info3);
  98. if(count($arr_nm_info3) == 2){
  99. $nm_info31 = $arr_nm_info3[0];
  100. $nm_info32 = $arr_nm_info3[1];
  101. }else{
  102. $nm_info31 = "";
  103. $nm_info32 = "";
  104. }
  105. $nm_info3 = $col[nm_info3];
  106. */
  107. $mode = "Update";
  108. }else{
  109. $ds_level = "1";
  110. }
  111. ?>
  112. <section id="wrap">
  113. <section id="visual" class="visual_mypage">
  114. <h2>마이페이지</h2>
  115. <p>쉽고 간편한 내차팔기, 견적산출, 최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
  116. </section>
  117. <section id="content">
  118. <ul class="location">
  119. <li><a href="/" class="home">홈</a></li>
  120. <li><span class="depth1">마이페이지</span>
  121. <ul class="sub_depth">
  122. <li><a href="#">마이페이지</a></li>
  123. <li><a href="#">입찰정보</a></li>
  124. <li><a href="#">차량정보</a></li>
  125. <li><a href="#">문의내역</a></li>
  126. </ul>
  127. </li>
  128. <li><span class="depth2">딜러</span></li>
  129. </ul>
  130. <? include("./inc_menu_dealer.php") ?>
  131. <h3>관리자 등록</h3>
  132. <form id="frmMember" name="frmMember" method="post" action="dealer_proc.php" enctype="multipart/form-data">
  133. <input type="hidden" name="validate" id="validate" value=""/>
  134. <input type="hidden" name="ds_type" id="ds_type" value="D1"/>
  135. <input type="hidden" name="ds_usertype" id="ds_usertype" value="<?=$ds_usertype?>"/>
  136. <input type="hidden" name="ds_company_bp1" id="ds_company_bp1" value="<?=$ds_company_bp1?>"/>
  137. <input type="hidden" name="ds_branch1" id="ds_branch1" value="<?=$ds_branch1?>"/>
  138. <input type="hidden" name="ds_company_bp2" id="ds_company_bp2" value="<?=$ds_company_bp2?>"/>
  139. <input type="hidden" name="ds_branch2" id="ds_branch2" value="<?=$ds_branch2?>"/>
  140. <input type="hidden" name="ds_company_bp3" id="ds_company_bp3" value="<?=$ds_company_bp3?>"/>
  141. <input type="hidden" name="ds_branch3" id="ds_branch3" value="<?=$ds_branch3?>"/>
  142. <input type="hidden" name="ds_level" id="ds_level" value="<?=$ds_level?>"/>
  143. <input type="hidden" name="cd_dealer" id="cd_dealer" value="<?=$cd_dealer?>"/>
  144. <input type="hidden" name="mode" id="mode" value="<?=$mode?>"/>
  145. <input type="hidden" name="nm_email" id="nm_email" value="<?=$nm_email?>"/>
  146. <input type="hidden" name="nm_hp_01" id="nm_hp_01" value="<?=$nm_hp_01?>"/>
  147. <? if ($mode == "Add"){ ?>
  148. <input type="hidden" name="idchkresult" id="idchkresult" value="N"/>
  149. <? }else{ ?>
  150. <input type="hidden" name="idchkresult" id="idchkresult" value="Y"/>
  151. <? } ?>
  152. <table class="tbl_h">
  153. <colgroup>
  154. <col width="16%">
  155. <col width="*">
  156. </colgroup>
  157. <tr>
  158. <th>아이디</th>
  159. <td>
  160. <? if ($mode == "Add"){ ?>
  161. <input type="text" class="inp_txt" style="width:330px;" name="cd_dealerid" id="cd_dealerid">
  162. <input type="submit" class="td_btn ty2" title="아이디 확인" value="확인" id="btn_idchk">
  163. <? }else{ ?>
  164. <?=$cd_dealerid?>
  165. <? } ?>
  166. </td>
  167. </tr>
  168. <tr>
  169. <th>비밀번호</th>
  170. <td><input type="password" class="inp_txt" style="width:330px;" name="nm_pass" id="nm_pass"> <span class="td_txt">8자~15자 영문, 숫자, 특수문자 조합</span></td>
  171. </tr>
  172. <tr>
  173. <th>이름</th>
  174. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_name" id="nm_name" value="<?=$nm_name?>"></td>
  175. </tr>
  176. <tr>
  177. <th>휴대번호</th>
  178. <td>
  179. <span class="select" style="margin-right:5px;width:22%;" id="sel_nm_hp_01">
  180. <select>
  181. <option value="" >선택</option>
  182. <option value="010" <?if($nm_hp_01=="010"){?>selected="selected"<?}?> >010</option>
  183. <option value="011" <?if($nm_hp_01=="011"){?>selected="selected"<?}?> >011</option>
  184. <option value="016" <?if($nm_hp_01=="016"){?>selected="selected"<?}?> >016</option>
  185. <option value="017" <?if($nm_hp_01=="017"){?>selected="selected"<?}?> >017</option>
  186. <option value="018" <?if($nm_hp_01=="018"){?>selected="selected"<?}?> >018</option>
  187. <option value="019" <?if($nm_hp_01=="019"){?>selected="selected"<?}?> >019</option>
  188. <option value="070" <?if($nm_hp_01=="070"){?>selected="selected"<?}?> >070</option>
  189. </select>
  190. </span>
  191. <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?>">
  192. </td>
  193. </tr>
  194. <tr>
  195. <th>부서</th>
  196. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_title" id="nm_title" value="<?=$nm_title?>"></td>
  197. </tr>
  198. <tr>
  199. <th>사진(필수입력)</th>
  200. <td>
  201. <div class="filebox">
  202. <label for="nm_file">찾아보기</label>
  203. <input class="upload-name" value="">
  204. <input type="file" class="upload-hidden" name="nm_file" id="nm_file">
  205. </div>
  206. <? if(!empty($nm_file)){ ?>
  207. <span class="thumb"><img src="<?=UPLOAD_PATH?>dealer/nm_file/<?=$nm_file?>" alt="" width="100"></span>
  208. <? } ?>
  209. </td>
  210. </tr>
  211. </table>
  212. <div class="btn_right">
  213. <a href="#" class="button" id="btn_write">관리자 등록</a>
  214. </div>
  215. </section>
  216. </section>
  217. <script laguage="javascript" type="text/javascript">
  218. $(document).ready(function() {
  219. setCodeSelect("listcode","ds_area", "dealer_master","ds_area","<?=$ds_area?>","선택하세요","");
  220. $("#sel_nm_hp_01 div.jq_sel ul li a").bind("click",function(){
  221. $("#nm_hp_01").val($("#sel_nm_hp_01 option:selected").val());
  222. });
  223. $("#cd_dealerid").bind("keyup",function(){
  224. $("#idchkresult").val("N");
  225. });
  226. $("#btn_idchk").bind("click",function(){
  227. if($("#cd_dealerid").val() == ""){
  228. alert("아이디를 입력하세요.");
  229. $("#cd_dealerid").focus();
  230. return false;
  231. }
  232. if($("#cd_dealerid").val().length <6){
  233. alert("6글자 이상 아이디를 입력하세요");
  234. $("#cd_dealerid").focus();
  235. return false;
  236. }
  237. $.post("dealer_proc.php", { mode: "IdChk", cd_dealerid: $("#cd_dealerid").val()},function(data) {
  238. if(data=="Y"){
  239. if(confirm("이용가능합니다. 아이디를 사용하시겠습니까?")){
  240. $("#cd_dealerid").attr("readonly",true).css("background","#d2d3d5");
  241. $("#idchkresult").val("Y");
  242. return;
  243. }
  244. }else{
  245. alert("사용불가능한 아이디 입니다.");
  246. $("#idchkresult").val("N");
  247. return;
  248. }
  249. });
  250. return false;
  251. });
  252. $("#btn_write").bind("click",function(){
  253. <? if ($mode == "Add"){ ?>
  254. var fieldlist = [["cd_dealerid","아이디"],["nm_pass","비밀번호"],["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"],["nm_title","부서"],["nm_file","사진"]]
  255. <? }else{ ?>
  256. var fieldlist = [["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"],["nm_title","부서"]]
  257. <? } ?>
  258. if (!fnCheckForm(fieldlist)){
  259. return false;
  260. }else{
  261. /*아이디 관련 처리*/
  262. <? if ($mode == "Add"){ ?>
  263. var idReg1 = /[a-z]/g;
  264. var idReg2 = /[0-9]/g;
  265. // if( !(idReg1.test( $("#cd_dealerid").val() )) || !(idReg2.test( $("#cd_dealerid").val() )) ) {
  266. // alert("아이디는 영문/숫자 조합으로 이루어져야 합니다.");
  267. // $("#cd_dealerid").focus();
  268. // return false;
  269. // }
  270. var idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
  271. if( !idReg.test( $("#cd_dealerid").val() ) ) {
  272. alert("아이디는 영문자로 시작하는 6~20자 영문자 또는 숫자이어야 합니다.");
  273. $("#cd_dealerid").focus();
  274. return false;
  275. }
  276. if(!fnCheckAlphaNumber($("#cd_dealerid").val())){
  277. alert('아이디는 영문/숫자 조합으로 이루어져야 합니다.');
  278. return false;
  279. }
  280. if($("#cd_dealerid").val().length <6){
  281. alert("6글자 이상 아이디를 입력하세요");
  282. $("#cd_dealerid").focus();
  283. return false;
  284. }
  285. if($("#idchkresult").val() != "Y"){
  286. alert("아이디 중복확인을 해 주세요.");
  287. $("#idchkresult").focus();
  288. return false;
  289. }
  290. <? } ?>
  291. if($("#nm_pass").val().length > 0){
  292. if($("#cd_dealerid").val()==$("#nm_pass").val()){
  293. alert("아이디와 변경할 패스워드를 다르게입력하세요");
  294. $("#nm_pass").focus();
  295. return false;
  296. }
  297. if($("#nm_pass").val().length <8){
  298. alert("8글자 이상 변경할 패스워드를 입력하세요");
  299. $("#nm_pass").focus();
  300. return false;
  301. }
  302. if(!isStrongValidFormPassword($("#nm_pass").val())){
  303. return false;
  304. }
  305. }
  306. var c=confirm("정보를 등록하시겠습니까?");
  307. if(c){
  308. $("#btn_write").hide();
  309. $("#frmMember").submit();
  310. }else{
  311. $("#btn_write").show();
  312. return false;
  313. }
  314. }
  315. });
  316. });
  317. </script>
  318. <? include("../include/inc_footer.php") ?>
  319. <? include("../include/inc_bottom.php") ?>
  320. <?
  321. mysql_close($connect);
  322. ?>