dealer_modify.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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. <section id="wrap">
  8. <section id="visual" class="visual_mypage">
  9. <h2>마이페이지</h2>
  10. <p>쉽고 간편한 내차팔기, 견적산출, 최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
  11. </section>
  12. <section id="content">
  13. <ul class="location">
  14. <li><a href="/" class="home">홈</a></li>
  15. <li><span class="depth1">마이페이지</span>
  16. <ul class="sub_depth">
  17. <li><a href="#">마이페이지</a></li>
  18. <li><a href="#">입찰정보</a></li>
  19. <li><a href="#">차량정보</a></li>
  20. <li><a href="#">문의내역</a></li>
  21. </ul>
  22. </li>
  23. <li><span class="depth2">딜러</span></li>
  24. </ul>
  25. <? include("./inc_menu_dealer.php") ?>
  26. <?
  27. // $_SESSION['s_cd_dealer']
  28. // $_SESSION['s_cd_dealer_p']
  29. $cd_dealer = $_SESSION['s_cd_dealer'];
  30. $s_ds_usertype = $_SESSION['s_ds_usertype'];
  31. $sql ="SELECT
  32. *
  33. , getCode('member_master','ds_company_bp',ds_company_bp1) as nm_company_bp1
  34. , getCode('member_master','ds_branch',ds_branch1) as nm_branch1
  35. , getCode('member_master','ds_company_bp',ds_company_bp2) as nm_company_bp2
  36. , getCode('member_master','ds_branch',ds_branch2) as nm_branch2
  37. , getCode('member_master','ds_company_bp',ds_company_bp3) as nm_company_bp3
  38. , getCode('member_master','ds_branch',ds_branch3) as nm_branch3
  39. FROM dealer_master
  40. WHERE cd_dealer='$cd_dealer' AND ds_delind='N'";
  41. $mode = "AddDealer";
  42. $col=mysql_fetch_array(mysql_query($sql));
  43. if (!empty($col[cd_dealer])){
  44. $cd_dealer = $col[cd_dealer];
  45. $cd_dealerid = $col[cd_dealerid];
  46. $cd_dealer_p = $col[cd_dealer_p];
  47. $nm_pass = $col[nm_pass];
  48. $ds_type = $col[ds_type];
  49. $ds_level = $col[ds_level];
  50. $nm_company = $col[nm_company];
  51. $nm_name = $col[nm_name];
  52. $nm_birth = $col[nm_birth];
  53. $nm_tel_01 = $col[nm_tel_01];
  54. $nm_tel_02 = $col[nm_tel_02];
  55. $nm_tel_03 = $col[nm_tel_03];
  56. $nm_hp_01 = $col[nm_hp_01];
  57. $nm_hp_02 = $col[nm_hp_02];
  58. $nm_hp_03 = $col[nm_hp_03];
  59. $nm_fax_01 = $col[nm_fax_01];
  60. $nm_fax_02 = $col[nm_fax_02];
  61. $nm_fax_03 = $col[nm_fax_03];
  62. $nm_email = $col[nm_email];
  63. $nm_zip = $col[nm_zip];
  64. $nm_addr = $col[nm_addr];
  65. $nm_addr_sub = $col[nm_addr_sub];
  66. $nm_etc_01 = $col[nm_etc_01];
  67. $nm_etc_02 = $col[nm_etc_02];
  68. $nm_etc_03 = $col[nm_etc_03];
  69. $ds_status = $col[ds_status];
  70. $nm_company_biz = $col[nm_company_biz];
  71. $nm_name_biz = $col[nm_name_biz];
  72. $nm_no_biz = $col[nm_no_biz];
  73. $nm_date_biz = $col[nm_date_biz];
  74. $nm_type_biz = $col[nm_type_biz];
  75. $nm_condition_biz = $col[nm_condition_biz];
  76. $nm_tel_biz_01 = $col[nm_tel_biz_01];
  77. $nm_tel_biz_02 = $col[nm_tel_biz_02];
  78. $nm_tel_biz_03 = $col[nm_tel_biz_03];
  79. $nm_hp_biz_01 = $col[nm_hp_biz_01];
  80. $nm_hp_biz_02 = $col[nm_hp_biz_02];
  81. $nm_hp_biz_03 = $col[nm_hp_biz_03];
  82. $nm_fax_biz_01 = $col[nm_fax_biz_01];
  83. $nm_fax_biz_02 = $col[nm_fax_biz_02];
  84. $nm_fax_biz_03 = $col[nm_fax_biz_03];
  85. $nm_email_biz = $col[nm_email_biz];
  86. $nm_zip_biz = $col[nm_zip_biz];
  87. $nm_addr_biz = $col[nm_addr_biz];
  88. $nm_addr_sub_biz = $col[nm_addr_sub_biz];
  89. $nm_company_bp1 = $col[nm_company_bp1];
  90. $nm_branch1 = $col[nm_branch1];
  91. $nm_company_bp2 = $col[nm_company_bp2];
  92. $nm_branch2 = $col[nm_branch2];
  93. $nm_company_bp3 = $col[nm_company_bp3];
  94. $nm_branch3 = $col[nm_branch3];
  95. $nm_area = $col[nm_area];
  96. $nm_title = $col[nm_title];
  97. $nm_file = $col[nm_file];
  98. $nm_etc = $col[nm_etc];
  99. $nm_deposit = $col[nm_deposit];
  100. $dt_insert = $col[dt_insert];
  101. $nm_insert = $col[nm_insert];
  102. $dt_update = $col[dt_update];
  103. $nm_update = $col[nm_update];
  104. $ds_delind = $col[ds_delind];
  105. $mode = "UpdateDealer";
  106. }else{
  107. AlertBack("지정되지 않은 요청입니다.");
  108. }
  109. ?>
  110. <h3>정보수정</h3>
  111. <form id="frmMember" name="frmMember" method="post" action="dealer_proc.php" enctype="multipart/form-data">
  112. <input type="hidden" name="validate" id="validate" value=""/>
  113. <input type="hidden" name="ds_type" id="ds_type" value="D0"/>
  114. <input type="hidden" name="ds_level" id="ds_level" value="<?=$ds_level?>"/>
  115. <input type="hidden" name="cd_dealer" id="cd_dealer" value="<?=$cd_dealer?>"/>
  116. <input type="hidden" name="mode" id="mode" value="<?=$mode?>"/>
  117. <input type="hidden" name="nm_email" id="nm_email" value="<?=$nm_email?>"/>
  118. <input type="hidden" name="nm_hp_01" id="nm_hp_01" value="<?=$nm_hp_01?>"/>
  119. <input type="hidden" name="nm_tel_01" id="nm_tel_01" value="<?=$nm_tel_01?>"/>
  120. <input type="hidden" name="nm_fax_01" id="nm_fax_01" value="<?=$nm_fax_01?>"/>
  121. <table class="tbl_h">
  122. <colgroup>
  123. <col width="16%">
  124. <col width="34%">
  125. <col width="16%">
  126. <col width="*">
  127. </colgroup>
  128. <tr>
  129. <th>아이디</th>
  130. <td>
  131. <? if ($mode == "AddDealer"){ ?>
  132. <input type="text" class="inp_txt" style="width:330px;" name="cd_dealerid" id="cd_dealerid">
  133. <? }else{ ?>
  134. <?=$cd_dealerid?>
  135. <? } ?>
  136. </td>
  137. <th>비밀번호</th>
  138. <td><input type="password" class="inp_txt" style="width:330px;" name="nm_pass" id="nm_pass"></td>
  139. </tr>
  140. <tr>
  141. <th>이름</th>
  142. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_name" id="nm_name" value="<?=$nm_name?>"></td>
  143. <th>핸드폰</th>
  144. <td>
  145. <span class="select" style="margin-right:5px;width:22%;" id="sel_nm_hp_01">
  146. <select>
  147. <option value="" >선택</option>
  148. <option value="010" <?if($nm_hp_01=="010"){?>selected="selected"<?}?> >010</option>
  149. <option value="011" <?if($nm_hp_01=="011"){?>selected="selected"<?}?> >011</option>
  150. <option value="016" <?if($nm_hp_01=="016"){?>selected="selected"<?}?> >016</option>
  151. <option value="017" <?if($nm_hp_01=="017"){?>selected="selected"<?}?> >017</option>
  152. <option value="018" <?if($nm_hp_01=="018"){?>selected="selected"<?}?> >018</option>
  153. <option value="019" <?if($nm_hp_01=="019"){?>selected="selected"<?}?> >019</option>
  154. <option value="070" <?if($nm_hp_01=="070"){?>selected="selected"<?}?> >070</option>
  155. </select>
  156. </span>
  157. <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?>">
  158. </td>
  159. </tr>
  160. <tr>
  161. <th>상호</th>
  162. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_company" id="nm_company" value="<?=$nm_company?>"></td>
  163. <th>연락처</th>
  164. <td>
  165. <span class="select" style="margin-right:5px;width:22%;" id="sel_nm_tel_01">
  166. <select>
  167. <option value="" >선택</option>
  168. <option value="02" <?if($nm_tel_01=="02"){?> selected="selected"<?}?> >02</option>
  169. <option value="031" <?if($nm_tel_01=="031"){?> selected="selected"<?}?> >031</option>
  170. <option value="032" <?if($nm_tel_01=="032"){?> selected="selected"<?}?> >032</option>
  171. <option value="033" <?if($nm_tel_01=="033"){?> selected="selected"<?}?> >033</option>
  172. <option value="041" <?if($nm_tel_01=="041"){?> selected="selected"<?}?> >041</option>
  173. <option value="042" <?if($nm_tel_01=="042"){?> selected="selected"<?}?> >042</option>
  174. <option value="043" <?if($nm_tel_01=="043"){?> selected="selected"<?}?> >043</option>
  175. <option value="044" <?if($nm_tel_01=="044"){?> selected="selected"<?}?> >044</option>
  176. <option value="051" <?if($nm_tel_01=="051"){?> selected="selected"<?}?> >051</option>
  177. <option value="052" <?if($nm_tel_01=="052"){?> selected="selected"<?}?> >052</option>
  178. <option value="053" <?if($nm_tel_01=="053"){?> selected="selected"<?}?> >053</option>
  179. <option value="054" <?if($nm_tel_01=="054"){?> selected="selected"<?}?> >054</option>
  180. <option value="055" <?if($nm_tel_01=="055"){?> selected="selected"<?}?> >055</option>
  181. <option value="061" <?if($nm_tel_01=="061"){?> selected="selected"<?}?> >061</option>
  182. <option value="062" <?if($nm_tel_01=="062"){?> selected="selected"<?}?> >062</option>
  183. <option value="063" <?if($nm_tel_01=="063"){?> selected="selected"<?}?> >063</option>
  184. <option value="064" <?if($nm_tel_01=="064"){?> selected="selected"<?}?> >064</option>
  185. </select>
  186. </span>
  187. <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?>">
  188. </td>
  189. </tr>
  190. <tr>
  191. <th>팩스번호</th>
  192. <td colspan="3">
  193. <span class="select" style="margin-right:5px;width:12%;" id="sel_nm_fax_01">
  194. <select>
  195. <option value="" >선택</option>
  196. <option value="02"<?if($nm_fax_01=="02"){?> selected="selected"<?}?>>02</option>
  197. <option value="031"<?if($nm_fax_01=="031"){?> selected="selected"<?}?>>031</option>
  198. <option value="032"<?if($nm_faxl_01=="032"){?> selected="selected"<?}?>>032</option>
  199. <option value="033"<?if($nm_fax_01=="033"){?> selected="selected"<?}?>>033</option>
  200. <option value="041"<?if($nm_fax_01=="041"){?> selected="selected"<?}?>>041</option>
  201. <option value="042"<?if($nm_fax_01=="042"){?> selected="selected"<?}?>>042</option>
  202. <option value="043"<?if($nm_fax_01=="043"){?> selected="selected"<?}?>>043</option>
  203. <option value="044"<?if($nm_fax_01=="044"){?> selected="selected"<?}?>>044</option>
  204. <option value="051"<?if($nm_fax_01=="051"){?> selected="selected"<?}?>>051</option>
  205. <option value="052"<?if($nm_fax_01=="052"){?> selected="selected"<?}?>>052</option>
  206. <option value="053"<?if($nm_fax_01=="053"){?> selected="selected"<?}?>>053</option>
  207. <option value="054"<?if($nm_fax_01=="054"){?> selected="selected"<?}?>>054</option>
  208. <option value="055"<?if($nm_fax_01=="055"){?> selected="selected"<?}?>>055</option>
  209. <option value="061"<?if($nm_fax_01=="061"){?> selected="selected"<?}?>>061</option>
  210. <option value="062"<?if($nm_fax_01=="062"){?> selected="selected"<?}?>>062</option>
  211. <option value="063"<?if($nm_fax_01=="063"){?> selected="selected"<?}?>>063</option>
  212. <option value="064"<?if($nm_fax_01=="064"){?> selected="selected"<?}?>>064</option>
  213. </select>
  214. </span>
  215. <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_03" id="nm_fax_03" value="<?=$nm_fax_03?>">
  216. </td>
  217. </tr>
  218. <tr>
  219. <th>주소</th>
  220. <td colspan="3" class="address">
  221. <input type="text" class="inp_txt" style="width:255px;" name="nm_zip" id="nm_zip" value="<?=$nm_zip?>" readonly="readonly"> <a href="#" class="td_btn ty2" onClick="execDaumPostcode('');">우편번호</a>
  222. <p><input type="text" class="inp_txt" style="width:100%;" name="nm_addr" id="nm_addr" value="<?=$nm_addr?>" readonly="readonly"></p>
  223. <p><input type="text" class="inp_txt" style="width:100%;" name="nm_addr_sub" id="nm_addr_sub" value="<?=$nm_addr_sub?>"></p>
  224. </td>
  225. </tr>
  226. <tr>
  227. <th>사진(필수입력)</th>
  228. <td colspan="3">
  229. <div class="filebox">
  230. <label for="nm_file">찾아보기</label>
  231. <input class="upload-name" value="">
  232. <input type="file" class="upload-hidden" name="nm_file" id="nm_file">
  233. </div>
  234. <? if(!empty($nm_file)){ ?>
  235. <span class="thumb"><img src="<?=UPLOAD_PATH?>dealer/nm_file/<?=$nm_file?>" alt="" width="100"></span>
  236. <? } ?>
  237. </td>
  238. </tr>
  239. </table>
  240. <h3>사업자정보</h3>
  241. <table class="tbl_h">
  242. <colgroup>
  243. <col width="16%">
  244. <col width="34%">
  245. <col width="16%">
  246. <col width="*">
  247. </colgroup>
  248. <tr>
  249. <th>상호</th>
  250. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_company_biz" id="nm_company_biz" value="<?=$nm_company_biz?>"></td>
  251. <th>사업자번호</th>
  252. <td><input type="password" class="inp_txt" style="width:330px;" name="nm_no_biz" id="nm_no_biz" value="<?=$nm_no_biz?>"></td>
  253. </tr>
  254. <tr>
  255. <th>대표자명</th>
  256. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_name_biz" id="nm_name_biz" value="<?=$nm_name_biz?>"></td>
  257. <th>종목</th>
  258. <td><input type="text" class="inp_txt" style="width:330px;" name="nm_type_biz" id="nm_type_biz" value="<?=$nm_type_biz?>"></td>
  259. </tr>
  260. <tr>
  261. <th>업태</th>
  262. <td colspan="3"><input type="text" class="inp_txt" style="width:330px;" name="nm_condition_biz" id="nm_condition_biz" value="<?=$nm_condition_biz?>"></td>
  263. </tr>
  264. <tr>
  265. <th>주소</th>
  266. <td colspan="3" class="address">
  267. <input type="text" class="inp_txt" style="width:255px;" name="nm_zip_biz" id="nm_zip_biz" value="<?=$nm_zip_biz?>" readonly="readonly"> <a href="#" class="td_btn ty2" onClick="execDaumPostcode('_biz');">우편번호</a>
  268. <p><input type="text" class="inp_txt" style="width:100%;" name="nm_addr_biz" id="nm_addr_biz" value="<?=$nm_addr_biz?>" readonly="readonly"></p>
  269. <p><input type="text" class="inp_txt" style="width:100%;" name="nm_addr_sub_biz" id="nm_addr_sub_biz" value="<?=$nm_addr_sub_biz?>"></p>
  270. </td>
  271. </tr>
  272. <? if($s_ds_usertype == "B0"){ ?>
  273. <tr>
  274. <th>지점</th>
  275. <td colspan="3">
  276. <? if($nm_branch1 != ""){ ?>
  277. 선인모터스 :
  278. <?=$nm_branch1?>
  279. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  280. <? } ?>
  281. <? if($nm_branch2 != ""){ ?>
  282. 고진모터스 :
  283. <?=$nm_branch2?>
  284. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  285. <? } ?>
  286. <? if($nm_branch3 != ""){ ?>
  287. 선진모터스 :
  288. <?=$nm_branch3?>
  289. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  290. <? } ?>
  291. </td>
  292. </tr>
  293. <? } ?>
  294. <tr>
  295. <th>지역</th>
  296. <td colspan="3" class="address">
  297. <?
  298. $sql = "SELECT cd_seq as seq, nm_code as code , nm_name as name , nm_pcode as pcode , nm_etc_01 as etc
  299. FROM code_master WHERE nm_table ='member_master' AND nm_column='ds_area' and ds_delind = 'N' order by name ";
  300. $rows = mysql_query($sql);
  301. $i=1;
  302. while($row = mysql_fetch_array($rows)) {
  303. ?>
  304. <span class="check_wrap" style="width:220px;"><input type="checkbox" name="nm_area[]" id="nm_area<?=$i?>" value="<?=$row[code]?>"<?if(strpos($nm_area,$row[code]) !== false){?> checked="checked"<?}?>><i></i><label for="nm_area<?=$i?>"><?=$row[name]?></label></span>
  305. <?
  306. $i++;
  307. }
  308. ?>
  309. </td>
  310. </tr>
  311. </table>
  312. </form>
  313. <div class="btn_right">
  314. <a href="#" class="button" id="btn_write">수정하기</a>
  315. </div>
  316. </section>
  317. </section>
  318. <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script>
  319. <script>
  320. function execDaumPostcode(arg) {
  321. new daum.Postcode({
  322. oncomplete: function(data) {
  323. // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
  324. // 각 주소의 노출 규칙에 따라 주소를 조합한다.
  325. // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
  326. var fullAddr = ''; // 최종 주소 변수
  327. var extraAddr = ''; // 조합형 주소 변수
  328. // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
  329. if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
  330. fullAddr = data.roadAddress;
  331. } else { m
  332. fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
  333. }
  334. // 우편번호와 주소 정보를 해당 필드에 넣는다.
  335. document.getElementById('nm_zip'+arg).value = data.zonecode; //5자리 새우편번호 사용
  336. document.getElementById('nm_addr'+arg).value = fullAddr;
  337. // 커서를 상세주소 필드로 이동한다.
  338. document.getElementById('nm_addr_sub'+arg).focus();
  339. }
  340. }).open();
  341. }
  342. </script>
  343. <script laguage="javascript" type="text/javascript">
  344. $(document).ready(function() {
  345. $("#sel_nm_hp_01 div.jq_sel ul li a").bind("click",function(){
  346. $("#nm_hp_01").val($("#sel_nm_hp_01 option:selected").val());
  347. });
  348. $("#sel_nm_tel_01 div.jq_sel ul li a").bind("click",function(){
  349. $("#nm_tel_01").val($("#sel_nm_tel_01 option:selected").val());
  350. });
  351. $("#sel_nm_fax_01 div.jq_sel ul li a").bind("click",function(){
  352. $("#nm_fax_01").val($("#sel_nm_fax_01 option:selected").val());
  353. });
  354. $("#btn_write").bind("click",function(){
  355. <? if ($mode == "AddDealer"){ ?>
  356. var fieldlist = [["cd_dealerid","아이디"],["nm_pass","비밀번호"],["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"]]
  357. <? }else{ ?>
  358. var fieldlist = [["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"]]
  359. <? } ?>
  360. if (!fnCheckForm(fieldlist)){
  361. return false;
  362. }else{
  363. /*패스워드 처리*/
  364. if($("#nm_pass").val().length > 0){
  365. if($("#cd_dealerid").val()==$("#nm_pass").val()){
  366. alert("아이디와 변경할 패스워드를 다르게입력하세요");
  367. $("#nm_pass").focus();
  368. return false;
  369. }
  370. if($("#nm_pass").val().length <8){
  371. alert("8글자 이상 변경할 패스워드를 입력하세요");
  372. $("#nm_pass").focus();
  373. return false;
  374. }
  375. if(!isStrongValidFormPassword($("#nm_pass").val())){
  376. return false;
  377. }
  378. }
  379. var c=confirm("정보를 등록하시겠습니까?");
  380. if(c){
  381. $("#btn_write").hide();
  382. $("#frmMember").submit();
  383. }else{
  384. $("#btn_write").show();
  385. return false;
  386. }
  387. }
  388. });
  389. });
  390. </script>
  391. <? include("../include/inc_footer.php") ?>
  392. <? include("../include/inc_bottom.php") ?>
  393. <?
  394. mysql_close($connect);
  395. ?>