dealer_view3_detail.php 13 KB

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