/home/mjc1/public_html/emillennium/customer_reg.inc.php


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
<?php
$dir 
".";
include_once(
$dir."/_common.php");
if(
$code!=''){
    
$sql "select * from customers a left join customer_begin_balance b on a.code = b.ccode where 1=1 and a.code = '{$code}' ";
    
$res mysql_query($sql,$connect_e1000y);
    
$cinfo mysql_fetch_array($res);
    
$email explode("@",$cinfo["email"]);
    
$tax_charge_email explode("@",$cinfo["tax_charge_email"]);
}
?>

<form name='customer_reg_form' method='post' action=''>
<input type='hidden' name='qstr' value=''>
<input type='hidden' name='code' value='<?php echo $cinfo['code'];?>'>

<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:200px;">
            <col style="width:100px;"><col style="width:200px;">
        </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><?php echo biztype_select($cinfo['biztype']);?></td>
        </tr>
        <tr>
            <th>상호명</th>
            <td colspan=3><input type='text' name='comp_name' class='width_500' value='<?php echo $cinfo['comp_name'];?>'></td>
        </tr>
        <tr>
            <th>메모</th>
            <td colspan=3><input type='text' name='memo' class='width_500' value='<?php echo $cinfo['memo'];?>'></td>
        </tr>
    </table>
</div>

<div class='cust_modal2'>
    <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;">
        </colgroup>

        <tbody>
        <tr>
            <th>대표자</th>
            <td colspan=3><input type='text' name='ceo_name' class='' value='<?php echo $cinfo['ceo_name'];?>'></td>
        </tr>
        <tr>
            <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='' value='<?php echo $cinfo['sub_comp_sn'];?>' maxlength=4></td>
        </tr>
        <tr>
            <th>업태</th>
            <td><input type='text' name='biz_status' class='' value='<?php echo $cinfo['biz_status'];?>' ></td>
            <th>종목</th>
            <td><input type='text' name='biz_item' class='' value='<?php echo $cinfo['biz_item'];?>' ></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>
        </tr>
        <tr>
            <th>팩스</th>
            <td><input type='text' name='faxno' class='telno_class' value='<?php echo $cinfo['faxno'];?>' ></td>
            <th>우편번호</th>
            <td><input type='text' name='zipcode' id='zipcode' class='width_80' value='<?php echo $cinfo['zipcode'];?>' >&nbsp;<a class='zip_search'>[우편번호검색]</a></td>
        </tr>
        <tr>
            <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>주소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>
        <tr>
            <th>이메일</th>
            <td colspan=3>
                <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>
        </tr>
    </table>
</div>

<div class='cust_modal2 biztype0'>
    <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;">
        </colgroup>

        <tbody>
        <tr>
            <th>부가세구분</th>
            <td colspan=3><?php echo vattype_select2($cinfo['vattype']);?></td>
        </tr>
        <tr>
            <th>기초 미불금</th>
            <td><input type='text' name='begin_arrear' class='number_class' value='<?php echo number_format($cinfo['begin_arrear']);?>'></td>
            <th>현잔액</th>
            <td><input type='text' name='cur_arrear' class='input_readonly' value='<?php echo number_format($cinfo['cur_arrear']);?>'></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;">
        </colgroup>

        <tbody>
        <tr>
            <th>부가세구분</th>
            <td colspan=3><?php echo vattype_select2($cinfo['vattype']);?></td>
        </tr>
        <tr>
            <th>기초 미수금</th>
            <td><input type='text' name='begin_recvbl' class='number_class' value='<?php echo number_format($cinfo['begin_recvbl']);?>'></td>
            <th>현잔액</th>
            <td><input type='text' name='cur_recvbl' class='input_readonly' value='<?php echo number_format($cinfo['cur_recvbl']);?>'></td>
        </tr>        
    </table>
</div>

<div class='cust_modal2'>
    <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;">
        </colgroup>

        <tbody>
        <tr>
            <th>주담당자</th>
            <td><input type='text' name='tax_charge_name' class='' value='<?php echo $cinfo['tax_charge_name'];?>'></td>
            <th>핸드폰</th>
            <td><input type='text' name='tax_charge_hpno' class='telno_class' value='<?php echo $cinfo['tax_charge_hpno'];?>'></td>
        </tr>
        <tr>            
            <th>이메일</th>
            <td colspan=3>
                <input type='text' name='tax_charge_email1' class='width_80' value='<?php echo $tax_charge_email[0];?>'>@
                <input type='text' name='tax_charge_email2' id='tax_charge_email2' class='width_120' value='<?php echo $tax_charge_email[1];?>'>
                <select name="tax_charge_email22" id="emailtype2" onchange='$("#tax_charge_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>
        </tr>        
    </table>
</div>
</form>
<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();
    $("#shop_receiver_phone01").focus();
    $("#shop_receiver_address_").focus();
}

$(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());
    });

    setTimeout(function(){
        $("input[name='comp_name']").focus();        
    },500);
})
</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>