1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
<?php $sub_menu = "200100"; include("./_common.php"); include("./auth_check.php"); // 관리자 권한 체크 include($j3_adm_path."/shop_header.php");
if($code!=''){ customers_s_check($code); // customer_s 레코드가 없으면 생성함 cust_cur_point_cal($code); // 쇼핑몰 포인트 재계산
$cinfo = customer_info_get($code); $email = explode("@",$cinfo["email"]); $tax_charge_email = explode("@",$cinfo["tax_charge_email"]); }
//if($app_id=='ryunen' || $app_id=='lulucosmetic'){ // 루루코스매틱만 단가등급 보임 $configshop['danganame_view'] = "1"; //} ?> <div id="wrap" class='container_wrap'> <div id="sub-title"> <h2>거래처 <?php if($code==''){?>신규<?php } else {?>수정<?php }?></h2> <div class="sub-location"> <a href="./index.php" class="home"><span class="screen_out">홈</span></a> <span class="location-gt"></span> <a>거래처관리</a> <span class="location-gt"></span> <a>거래처관리</a> </div> </div>
<form name='customer_reg_form' method='post' action=''> <input type='hidden' name='qstr' value=''> <input type='hidden' name='code' value='<?php echo $cinfo['code'];?>'> <input type='hidden' name='biztype' value='1'>
<div class='cust_modal1'> <h4>기본 정보</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">기본정보</caption> <colgroup> <col style="width:100px;"><col style="width:230px;"> <col style="width:100px;"><col style="width:230px;"> <col style="width:100px;"><col style="width:230px;"> </colgroup>
<tbody> <tr> <th>코드</th> <td> <input type='text' name='code1' class='input_readonly width_80' value='<?php echo $cinfo['code1'];?>' maxlength=6> <?php if($code==''){ echo "<input type='checkbox' name='code_auto' value='1' checked> 코드자동"; } ?> </td> <th>상호명</th> <td colspan=3><input type='text' name='comp_name' class='width_200' value='<?php echo $cinfo['comp_name'];?>'></td> </tr> <tr> <th>아이디</th> <td><input type='text' name='login_id' class='<?php if($code!=''){?>input_readonly<?php }?> width_200' value='<?php echo $cinfo['login_id'];?>'></td> <th>비밀번호</th> <td><input type='password' name='login_passwd' class='width_200' value=''></td> <th>관리안함(숨김)</th> <td><input type='radio' name='hidden' value='0' <?php if($cinfo['hidden'] == '0' || $cinfo['hidden']==''){?>checked<?php }?>> 관리함 <input type='radio' name='hidden' value='1' <?php if($cinfo['hidden'] == '1'){?>checked<?php }?>> 숨김</td> </tr> <tr> <th>메모</th> <td colspan=5> <textarea name='memo' style='width:786px;height:100px;margin-top:5px;'><?php echo $cinfo['memo'];?></textarea> </td> </tr> </table> </div>
<div class='cust_modal1'> <h4>사업자 등록 정보</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">사업자 등록 정보</caption> <colgroup> <col style="width:110px;"><col style="width:310px;"> <col style="width:100px;"><col style="width:190px;"> <col style="width:100px;"><col style="width:190px;"> </colgroup>
<tbody> <tr> <th>회원구분</th> <td colspan=5> <input type='radio' name='per_biz_type' value='0' <?php if($cinfo['per_biz_type']=='0'){ echo "checked"; }?>> 개인 <input type='radio' name='per_biz_type' value='1' <?php if($cinfo['per_biz_type']=='1' || $cinfo['per_biz_type']==''){ echo "checked"; }?>> 기업 </td> </tr> <tr> <th>이름(대표자)</th> <td><input type='text' name='ceo_name' class='' value='<?php echo $cinfo['ceo_name'];?>'></td> <th>사업자번호</th> <td><input type='text' name='comp_sn' class='comp_sn_class' value='<?php echo $cinfo['comp_sn'];?>' maxlength=14></td> <th>종사업자번호</th> <td><input type='text' name='sub_comp_sn' class='width_80' value='<?php echo $cinfo['sub_comp_sn'];?>' maxlength=4></td> </tr> <tr> <th>전화번호</th> <td><input type='text' name='telno' class='telno_class' value='<?php echo $cinfo['telno'];?>' ></td> <th>핸드폰</th> <td><input type='text' name='hpno' class='telno_class' value='<?php echo $cinfo['hpno'];?>' ></td> <th>팩스</th> <td><input type='text' name='faxno' class='telno_class' value='<?php echo $cinfo['faxno'];?>' ></td> </tr> <tr> <th>업태</th> <td><input type='text' name='biz_status' class='' value='<?php echo $cinfo['biz_status'];?>' ></td> <th>종목</th> <td colspan=3><input type='text' name='biz_item' class='' value='<?php echo $cinfo['biz_item'];?>' ></td> </tr> <tr> <th>우편번호</th> <td><input type='text' name='zipcode' id='zipcode' class='width_80' value='<?php echo $cinfo['zipcode'];?>' > <a class='zip_search'>[우편번호검색]</a></td>
<th>주소1</th> <td colspan=3><input type='text' name='addr_m' id='addr_m' class='width_500' value='<?php echo $cinfo['addr_m'];?>'></td> </tr> <tr> <th>이메일</th> <td> <input type='text' name='email1' class='width_80' value='<?php echo $email[0];?>'>@ <input type='text' name='email2' id='email2' class='width_120' value='<?php echo $email[1];?>'> <select name="email22" id="emailtype" onchange='$("#email2").val(this.value)'> <option value="" selected>직접입력</option> <option value="chol.com" <?php if ($email[1] == "chol.com") echo "selected"; ?> >chol.com</option> <option value="daum.net" <?php if ($$email[1] == "daum.net") echo "selected"; ?> >daum.net</option> <option value="dreamwiz.com" <?php if ($$email[1] == "dreamwiz.com") echo "selected"; ?> >dreamwiz.com</option> <option value="freechal.com" <?php if ($$email[1] == "freechal.com") echo "selected"; ?> >freechal.com</option> <option value="gmail.com" <?php if ($$email[1] == "gmail.com") echo "selected"; ?> >gmail.com</option> <option value="hotmail.com" <?php if ($$email[1] == "hotmail.com") echo "selected"; ?> >hotmail.com</option> <option value="kebi.com" <?php if ($$email[1] == "kebi.com") echo "selected"; ?> >kebi.com</option> <option value="korea.com" <?php if ($$email[1] == "korea.com") echo "selected"; ?> >korea.com</option> <option value="msn.com" <?php if ($$email[1] == "msn.com") echo "selected"; ?> >msn.com</option> <option value="nate.com" <?php if ($$email[1] == "nate.com") echo "selected"; ?> >nate.com</option> <option value="naver.com" <?php if ($$email[1] == "naver.com") echo "selected"; ?> >naver.com</option> <option value="netian.com" <?php if ($$email[1] == "netian.com") echo "selected"; ?> >netian.com</option> <option value="paran.com" <?php if ($$email[1] == "paran.com") echo "selected"; ?> >paran.com</option> <option value="unitel.co.kr" <?php if ($$email[1] == "unitel.com") echo "selected"; ?> >unitel.co.kr</option> <option value="yahoo.co.kr" <?php if ($$email[1] == "yahoo.com") echo "selected"; ?> >yahoo.co.kr</option> </select> </td> <th>주소2</th> <td colspan=3><input type='text' name='addr_d' id='addr_d' class='width_500' value='<?php echo $cinfo['addr_d'];?>'></td> </tr> </table> </div>
<div class='cust_modal2 biztype1'> <h4>기타 정보</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">기타 정보</caption> <colgroup> <col style="width:100px;"><col style="width:230px;"> <col style="width:100px;"><col style="width:230px;"> <col style="width:100px;"><col style="width:230px;"> </colgroup>
<tbody> <tr> <th>회원가입일</th> <td><?php echo $cinfo['data_created'];?></td> <th>최근접속일</th> <td><?php echo $cinfo['last_datetime'];?></td> <th>최근접속IP</th> <td><?php echo $cinfo['last_ip'];?></td> </tr> <tr> <th>sms수신여부</th> <td> <input type='radio' name='sms_ok' value='0' <?php if($cinfo['sms_ok'] == '0' || $cinfo['sms_ok']==''){?>checked<?php }?>> 수신안함 <input type='radio' name='sms_ok' value='1' <?php if($cinfo['sms_ok'] == '1'){?>checked<?php }?>> 수신함 </td> <th>email수신여부</th> <td colspan=3> <input type='radio' name='mail_ok' value='0' <?php if($cinfo['mail_ok'] == '0' || $cinfo['mail_ok']==''){?>checked<?php }?>> 수신안함 <input type='radio' name='mail_ok' value='1' <?php if($cinfo['mail_ok'] == '1'){?>checked<?php }?>> 수신함 </td> </tr> <tr> <th>무료배송 여부</th> <td colspan=3><input type='radio' name='deli_free' value='0' <?php if($cinfo['deli_free'] == '0' || $cinfo['deli_free']==''){?>checked<?php }?>> 쇼핑몰설정에 따른 배송비 책정 <input type='radio' name='deli_free' value='1' <?php if($cinfo['deli_free'] == '1'){?>checked<?php }?>> 해당거래처 무료배송</td> <th>회원권한</th> <td> <select name='mb_lv'> <option value='1' <?php if($cinfo['mb_lv']=='1'){?>selected<?php }?>>1 (비회원)</option> <option value='2' <?php if($cinfo['mb_lv']=='2'){?>selected<?php }?>>2 (회원)</option> <option value='3' <?php if($cinfo['mb_lv']=='3'){?>selected<?php }?>>3 (회원)</option> <option value='4' <?php if($cinfo['mb_lv']=='4'){?>selected<?php }?>>4 (회원)</option> <option value='5' <?php if($cinfo['mb_lv']=='5'){?>selected<?php }?>>5 (회원)</option> </select> </td> </tr> <?php if($config['recom_name_use']=='1'){?> <tr> <th>추천인 아이디</th> <td colspan=5><input type='text' name='recom_name' class='' value='<?php echo $cinfo['recom_name'];?>' ></td> </tr> <?php } else {?> <input type='hidden' name='recom_name' class='' value='<?php echo $cinfo['recom_name'];?>' > <?php } ?> </table> </div>
<div class='cust_modal2 biztype1'> <h4>포인트/매출 정보</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">포인트 정보</caption> <colgroup> <col style="width:100px;"><col style="width:230px;"> <col style="width:100px;"><col style="width:230px;"> <col style="width:100px;"><col style="width:230px;"> </colgroup>
<tbody> <tr> <th>기초 포인트</th> <td><!--<input type='text' name='begin_pt' class='number_class' value='<?php echo number_format($cinfo['begin_pt']);?>'>--><?php echo number_format($cinfo['begin_pt']);?></td> <th>쇼핑몰 포인트</th> <td><?php echo number_format($cinfo['cur_point']);?></td> <th>포인트 적용법</th> <td> <select name='pt_index'> <option value='0' <?php if($cinfo['pt_index']=='0'){ echo "selected"; }?>>적용안함</option> <option value='1' <?php if($cinfo['pt_index']=='1'){ echo "selected"; }?>>거래처별</option> <option value='2' <?php if($cinfo['pt_index']=='2'){ echo "selected"; }?>>상품별</option> </select> </td> </tr> <tr> <th>현금 포인트율</th> <td> <input type='text' name='pt_cash' class='' value='<?php echo $cinfo['pt_cash'];?>' maxlength=3> <span class='help_info'>무통장입금시</span> </td> <th>카드 포인트율</th> <td colspan=3> <input type='text' name='pt_card' class='' value='<?php echo $cinfo['pt_card'];?>' maxlength=3> <span class='help_info'>PG사를 이용하는 카드/가상/계좌이체 등</span> </td> </tr> <tr> <th>매출 할인율</th> <td> <input type='text' name='sale_dcrate' class='width_60' value='<?php echo $cinfo['sale_dcrate'];?>'> % </td> <th>부가세 구분</th> <td colspan=1> <select name='vat_type'> <option value='0' <?php if($cinfo['vattype']=='0'){ echo "selected"; }?>>안함</option> <option value='1' <?php if($cinfo['vattype']=='1' || $cinfo['vattype']==''){ echo "selected"; }?>>부가세포함</option> <option value='2' <?php if($cinfo['vattype']=='2'){ echo "selected"; }?>>부가세별도</option> <option value='3' <?php if($cinfo['vattype']=='3'){ echo "selected"; }?>>영세율</option> </select> </td> <?php if($configshop['danganame_view']=='1'){ ?> <th>단가 등급</th> <td colspan=1> <?php echo get_multi_price_name($cinfo['ccode']);?> </td> <?php } ?> <?php if($config['cust_sell']=='1'){ ?> <tr> <th>회원 판매 기능</th> <td colspan=5><input type='radio' name='seller_yn' value='0' <?php if($cinfo['seller_yn'] == '0' || $cinfo['seller_yn']==''){?>checked<?php }?>> 판매불가 <input type='radio' name='seller_yn' value='1' <?php if($cinfo['seller_yn'] == '1'){?>checked<?php }?>> 판매가능</td> </tr> <?php }?> </tr> </table> </div> </form> <div id="sub-contents-area" style='padding-left:500px;padding-top:20px;'> <div class="sub-btn-area"> <div class="sub-btn"> <a class="lignt-blue-btn" id='btn_customer_save'>저장</a> <a class="gray-btn" id='btn_cancel_save'>취소</a> </div> </div> </div> </div> <!-- wrap end--> <script> function postSearch3(zip1,zip2,addr1){ new daum.Postcode({ oncomplete: function(data) { // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분입니다. // 예제를 참고하여 다양한 활용법을 확인해 보세요. zoncode1 = data.zonecode.substring(0,3); zoncode2 = data.zonecode.substring(3,5);
if(1==1){ // 5자리 우편번호 사용 이전꺼 사용시엔 1==2로 세팅 $("#"+zip1).val(data.zonecode); } else { $("#"+zip1).val(data.postcode1+"-"+data.postcode2); }
// 각 주소의 노출 규칙에 따라 주소를 조합한다. // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다. var fullAddr = ''; // 최종 주소 변수 var extraAddr = ''; // 조합형 주소 변수
// 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다. if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우 fullAddr = data.roadAddress;
} else { // 사용자가 지번 주소를 선택했을 경우(J) fullAddr = data.jibunAddress; }
// 사용자가 선택한 주소가 도로명 타입일때 조합한다. if(data.userSelectedType === 'R'){ //법정동명이 있을 경우 추가한다. if(data.bname !== ''){ extraAddr += data.bname; } // 건물명이 있을 경우 추가한다. if(data.buildingName !== ''){ extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName); } // 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다. extraAddr = (extraAddr !== '' ? ' ('+ extraAddr +')' : ''); }
$("#"+addr1).val(fullAddr+" "+extraAddr+" "); post_close(); }, width : '100%', height : '100%' }).embed("daum_juso_rayer");
$("#daum_juso_rayer").show();
}
function post_close(){ $('#daum_juso_rayer').hide(); $("#addr_d").focus(); }
function form_save(){ // 거래처 저장/수정 var form_obj = $("form[name='customer_reg_form']"); if($(form_obj).find("input[name='code']").val()==''){ if($(form_obj).find("input[name='code_auto']").is(":checked")==false){ if($(form_obj).find("input[name='code1']").val()==''){ alert('코드를 입력하세요.'); return; } } } if($(form_obj).find("input[name='per_biz_type']").eq(0).is(":checked")){ if($(form_obj).find("input[name='ceo_name']").val()==''){ alert('이름을 입력하세요.'); return; } } else { if($(form_obj).find("input[name='comp_name']").val()==''){ alert('상호명을 입력하세요.'); return; } } if($(form_obj).find("input[name='login_id']").val()==''){ alert('로그인 아이디를 입력하세요.'); return; } if($(form_obj).find("input[name='login_password']").val()==''){ alert('로그인 비밀번호를 입력하세요.'); return; }
$(form_obj).find("input[name='qstr']").val('<?php echo $qstr;?>'); if(confirm('저장하시겠습니까?')){ var form_data = $(form_obj).serialize();
$.ajax({type:"post", url:"ajax.customer_reg_process.php", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_msg = $(xml).find("msg").text(); var v_code = $(xml).find("code").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { document.location.href='?<?php echo $qstr."&time=".time();?>&code='+v_code; } }, error:function(rtn,status,error){ alert(error); } }); } //$(form_obj).submit(); }
$(function(){ if('<?php echo $cinfo['biztype']?>'=='0'){ $(".biztype0").show(); $(".biztype1").hide(); } if('<?php echo $cinfo['biztype']?>'=='1' || '<?php echo $cinfo['biztype']?>'==''){ $(".biztype0").hide(); $(".biztype1").show(); } $(".input_readonly").attr("readonly",true); $("input[name='comp_name']").focus();
$("input[name='email1']").change(function(){ $("input[name='tax_charge_email1']").val($(this).val()); }); $("input[name='email2']").change(function(){ $("input[name='tax_charge_email2']").val($(this).val()); });
$(document).on("click","input[name='code_auto']",function(){ // 코드자동 선택시 if($(this).is(":checked")){ $("input[name='code1']").addClass("input_readonly").attr("readonly",true).val("");
} else { $("input[name='code1']").removeClass("input_readonly").attr("readonly",false); } });
$("#btn_customer_save").click(function(){ form_save(); });
$("#btn_cancel_save").click(function(){ // 취소 버튼 document.location.href='customer_list.php?<?php echo $_COOKIE['qstr'];?>'; });
$(document).on("click",".zip_search",function(){ // 주소오픈 postSearch3("zipcode","","addr_m"); });
setTimeout(function(){ $("input[name='comp_name']").focus(); },500); }) </script> <?php include($j3_adm_path."/shop_footer.php"); ?> <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script> <div id="daum_juso_rayer" style="background:#fff;border: 5px solid currentColor; left: 50%; top: 50%; width: 300px; height: 460px; overflow: hidden; margin-top: -235px; margin-left: -155px; display:none ; position: fixed; z-index: 10000; -webkit-overflow-scrolling: touch;"><input type='button' onclick="$('#daum_juso_rayer').hide();" value='close' style='top:0px;width:40px;height:20px;right:0px;padding:0px;'> <iframe src="about:blank" frameborder="0" style="margin: 0px;margin-top:30px; padding: 0px; border: 0px currentColor; left: 0px; top: 0px; width: 100%; height: 90%; overflow: hidden; position: absolute; min-width: 300px;"></iframe> </div>
|