/home/mjc1/public_html/emillennium/sms_send.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
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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
<?php
$dir 
".";
include_once(
$dir."/_common.php");
include(
'./include/header.php'); 

if(
$eid==''){
    
alert('e천년경영 로그인 후에 이용가능합니다.',"index.php"); exit;
}

if(
$sms_id==''){
    
alert('SMS 로그인하신 후에 이용가능합니다.',"sms.php"); exit;
}
/*$sql = "select * from customers ";
$res = mysql_query($sql,$connect_e1000y);
while($info=mysql_fetch_array($res)){
    $sql = "insert into customers_u set code = '{$info['code']}', Mid = 'ryunen' ";    
    _pr($sql);
    //mysql_query($sql,$connect_e1000y);
}*/

if($order_key==''){ 
    if(
$_COOKIE['ok_customer']!=''){
        
$order_key $_COOKIE['ok_customer']; 
    } else {
        
$order_key 'comp_name'
    }
}

$where " ";
if(
$biztype=='' || $biztype=='1'){
    
$where .= " and biztype = '1' "$biztype "1";
} else if(
$biztype=='0'){
    
$where .= " and biztype = '0' ";
} else if(
$biztype=='2'){
    
$where .= " and biztype = '2' ";
}

if(
$stx!=''){
    
$where .= " and {$sti} like '%{$stx}%' ";
}

$sql  =   "select count(*) as cnt from customers a WHERE 1=1 $where ";
$result      =    mysql_query($sql,$connect_e1000y);
$row mysql_fetch_array($result);
$total_count $row['cnt'];

$list_num 15;
if(
$_COOKIE['page_line']!=''){ $list_num $_COOKIE['page_line']; }
$total_page  ceil($total_count $list_num);  // 전체 페이지 계산
if ($page 1) { $page 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page 1) * $list_num// 시작 열을 구함

$sql "select * from customers a WHERE 1=1 $where order by $order_key limit $from_record$list_num";
$result      =    mysql_query($sql,$connect_e1000y);

//_pr($sql);
while($cus_info=mysql_fetch_array($result)){
    
$list_array[] = $cus_info;
}

$qstr $_SERVER['QUERY_STRING'];
?>

<!--<div id="contents" style="background:#999"><img src="http://placehold.it/960x150" alt="롤링배너"></div>-->
<div id="contents" style="height:2px;border-bottom:1px solid #eee;background:#2f6ba9">
    <span class="screen_out">header 하단 선</span>
</div>

<div id="wrap" class='container_wrap'>
    <div id="sub-title">
        <h2>문자 보내기</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>
    <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'>
    <div id="sub-contents-area">
        
    </div>
    <div class="item_tab">
        <div class="item_tab_navi">
            <a value='0' class="on"><span>문자 보내기</span></a>
            <a value='1'><span>문자 전송집계</span></a>
            <!--<a value='2'><span>매입.매출처 관리</span></a>-->
        </div>
    </div><!--//item_tab-->

<!-- 이부분에 SMS 넣으면 됩니다. -->

<style>
.sms-area {float:left;width:300px;height:570px;background:url('./images/sms/sms_bg.png') no-repeat;}
.sms-data {float:right;width:900px;height:570px;/*background:url('./images/sms/right.png') no-repeat;*/}
.sms_type {margin:0 auto;width:183px;}
.sms_type > a { display:inline-block;width:90px;height:28px;margin-right:3px;line-height:28px;color:#FFF;font-size:13px;font-weight:600;text-align:center;border-radius:3px;}
.sms_type > a:last-child {margin:0px;}
.sms_comment {margin:10px 0 30px;text-align:center;}
.sms-contents {margin:0 auto;width:210px;/*border:1px solid #ff669b;*/}
.sms_header_menu {position:relative;display:block;height:24px;}
.sms_header_menu a:last-child {position:absolute;top:-5px;right:0px;}
.sms_header_menu a {padding:5px;line-height:24px;font-size:13px;font-weight:600;}
.sms_header_btn a,
.sms_footer_btn a {display:inline-block;margin-right:10px;width:100px;height:24px;line-height:24px;color:#FFF;text-align:center;border-radius:24px;}
.sms_header_btn a:last-child,
.sms_footer_btn a:last-child {margin:0px;}
.sms_write {margin:7px 0;border:1px solid #999;border-radius:3px;background:#FFF;}
.sender, .receiver {display:block;width:207px;padding:5px;border-bottom:1px solid #DDD;background:#f8f8f8;}
.sender select {height:18px;}
.sender a, .receiver a {float:right;}
.receiver input[type=text] {display:block;margin:5px 0 0;padding:0 10px;width:90%;border-radius:30px;}
.receiver .num {display:block;margin:5px 0 0;padding:5px;height:70px;border:1px solid #DDD;background:#FFF;}
.txt_length {padding:5px;line-height:20px;}
.txt_length label {display:inline-block;color:#FFF;padding:0 10px;height:20px;border-radius:20px;background:#2f6ba9;}
.txt_length span {display:inline-block;width:76%;text-align:right;}
.sms-txt {display:block;margin:0 0 5px 5px;}
.sms-txt textarea {padding:5px;width:185px;height:120px;font-size:13px;border-radius:7px;}
.remainder {padding:0 5px;line-height:24px;text-align:center;border-top:1px solid #DDD;background:#f8f8f8;}
.remainder .refresh {margin:0 0 0 5px;}

.sms_cust_search{width:270px; background:; height:555px;float:left;padding:5px; border:1px solid #f0f0f0; border-right:0px; }
.sms_cust_list{width:330px; background:; height:565px;float:left;overflow-y:scroll; border:1px solid #f0f0f0; border-left:0px;}
.sms_freq_cont{width:275px; background:; overflow-y:scroll; height:565px;margin-left:615px;border:1px solid #f0f0f0; border-left:0px;}

.smssearch_div { border:0px solid #e1e1e1;padding:10px;font-size:13px}
.smssearch_div h4 { position:relative;top:-5px;font-size:14px;font-weight:bold; }
.smssearch_div table td { line-height:45px; }
.sub-btn-class {text-align:center;padding-top:15px;}
#dealdate {font-size:0.84em;}
</style>
<div class="sub-write-area" style="margin:20px 0 0;">
    <h4 class="sound_only">문자전송</h4>
<form name='sms_send_form' method='post' onsubmit='return false;'>
    <input type='hidden' name='sms_types' value='sms'>
    <input type='hidden' name='sms_cur_length' value='0'>
    <input type='hidden' name='sms_max_length' value='80'>
    <input type='hidden' name='send_tel_list' value=''>
    <div class="sms-area">
        <div class="sms_type">
            <a class="lignt-blue-btn sms_type_change">단문SMS</a><a class="blue-btn lms_type_change">장문SMS</a>
        </div>
        <p class="sms_comment">(단문 : 1건 차감/장문 : 3건 차감)</p>
        <div class="sms-contents">
            <div class="sms_header"> 
                <div class="sms_header_menu"><a class='sms_pwd_ch'>비밀번호 변경</a><a class='sms_feq_add'>문자함에 추가</a></div>
                <div class="sms_header_btn"><a class="gray-btn adver_sms">광고문자</a><a class="gray-btn simp_sms">일반문자</a></div>
            </div>
            <div class="sms_write">
                <div class="sender">
                    <label>보내는사람</label>
                    <select name='send_hp' id='send_hp'>
                        
                    </select>
                    <a class='send_reg_info'><img src="./images/sms/question_icon.png" alt="등록방법"></a>
                </div>
                <div class="receiver">
                    <label>받는사람</label>
                    <a class='all_del_hp'>전체삭제</a><a>&nbsp;/&nbsp;</a><a class='sel_del_hp'>선택삭제</a>
                    <!--<img src="./images/sms/cancel_icon.png" alt="전체삭제">-->
                    <input type="text" name='other_hp' value="">
                    <div class="num">
                        <select name='send_tel' id='send_tel' style='border:0px;width:100%; height:100%;' multiple='multiple'>
                            
                        </select>
                    </div>
                </div>
                <div class="txt_length"><label class='sms_type_title'>SMS</label><span><a class='cur_txt_length' id="sms_bytes">30</a> / <a class='max_txt_length'>80</a>byte</span></div>
                <div class="sms-txt">
<textarea name='send_content' id='send_content' onkeyup="byte_check('send_content', 'sms_bytes');">
(광고)무료수신거부
080XXXXXXXX
</textarea>
                </div>
                <div class="remainder"><label>잔여건수 : </label><span class='sms_pt_class'><?php echo $sms_pt;?></span> 건<a class="refresh"><img src="./images/sms/refresh_icon.png" alt="새로고침"></a></div>
            </div>
            <div class="sms_footer">
                <div class="sms_footer_btn" style='padding-left:50px;'>
                    <a class="gray-btn btn-sms_send_class">전송</a>
                </div>
            </div>
        </div><!--//sms-contents-->
    </div>
</form>
    <div class="sms-data">
        <div class='sms_cust_search'>
<form name='sms_cust_search' method='get'>
    <input type='hidden' name='search_form_name' id='search_form_name' value='sms_cust_search'> <!-- 거래처 검색에서 리턴폼 명칭 정의-->
            <input type='hidden' name='sms_cont_type' value='my'>
            <div class='smssearch_div'>
                <h4>거래처 구분</h4>
                <table class="order-sheet table-top-border">
                    <caption class="screen_out">기본정보</caption>
                    <colgroup>
                        <col style="width:80px;"><col style="width:170px;">
                    </colgroup>

                    <tbody>
                    <tr>
                        <th>거래구분</th>
                        <td class='linetxt'>
                            <?php echo biztype_radio($biztype); ?>
                        </td>
                    </tr>
                    <tr>
                        <th>거래처검색</th>
                        <td class='linetxt'>
                            <input type='text' name='stx' value='' class='width_80'>
                            <!--<input type='text' name='stc' value='<?php echo $stc;?>' class='input_readonly width_40'>
                            <input type='text' name='stc_search' value='<?php echo $stc_search;?>' class='cust_search_class width_60'>&nbsp;<input type='button' value='?' class='group-add-btn customer-sel-btn'>-->
                        </td>
                    </tr>
                    <tr>
                        <th class='misu_mibul'>미수금</th>
                        <td class='linetxt'>
                            <input type='text' name='misu' value='' class='width_80'> 원 이상
                        </td>
                    </tr>
                    <tr>
                        <th>거래일</th>
                        <td class='linetxt'>
                            <input type='text' name='sdate' id='sdate' value='' class='width_80'> ~
                            <input type='text' name='edate' id='edate' value='' class='width_80'>
                        </td>
                    </tr>
                    <tr>
                        <th>거래일 이후</th>
                        <td class='linetxt'>
                            <input type='text' name='dealdate' id='dealdate' value='' class='width_60'> 이후 무거래
                    </tr>
                </table>
                <div class="sub-btn sub-btn-class">
                    <!--라인수 <?php echo paging_select($list_num);?>-->
                    <a class="lignt-blue-btn" id='btn_cust_search'>검색</a>
                </div>
                <div class="sub-btn sub-btn-class">
                    <!--라인수 <?php echo paging_select($list_num);?>-->
                    <a class="blue-btn" id='btn_cust_add' style='width:200px;'>◀◀◀◀ 번호추가 ◀◀◀◀</a>
                </div>
            </div>
</form>
        </div>
        <div class='sms_cust_list'></div>
        <div class='sms_freq_cont'></div>
    </div>

</div><!--//sub-write-area-->

<!-- 이부분에 SMS 넣으면 됩니다.끝 -->
</div><!--//wrap-->
<script>
$(function(){
    $(".item_tab_navi a").click(function(){ //네비게이션 탭 처리
        v = $(this).attr("value");
        if(v==0){
            document.location.href="./sms_send.php";
        } else {
            document.location.href="./sms_list.php";
        }
    });
    /*$(".customer-sel-btn").click(function(){ // 거래처 ? 검색일경우
        customer_search('',1);
    });

    $(".cust_search_class").keypress(function(){ // 거래처명란에서 엔터로 검색일경우
        if(event.keyCode==13){
            var v_cn = $(".cust_search_class").val()
            customer_search(encodeURI(v_cn),1);
        }
    }).change(function(){
        $("input[name='stc']").val("");
    });    */

    $(".biztype_class").click(function(){ // 거래구분 변경시
        var v = $(this).val();
        if(v==0){
            $(".misu_mibul").html("미불금");
        } else {
            $(".misu_mibul").html("미수금");
        }
    });

    $("input[name='stx'], input[name='misu']").keypress(function(){ // 거래처 넣고 엔터처리
        if(event.keyCode==13){
            customer_sms_search("",1);    
        }
    });
    $("#btn_cust_search").click(function(){ // 검색버턴 처리
        customer_sms_search("",1);
    });

    $("#btn_cust_add").click(function(){ // 번호추가 버튼 처리
        $("input[name='code_idx[]']").each(function(){
            if($(this).is(":checked")){
                $tr_obj = $(this).closest("tr");
                $tr_obj.find(".click_edit").click();
            }
        })
    });

    $("input[name='other_hp']").keypress(function(){ // 받는사람 추가 처리
        if(event.keyCode==13){
            add_hp($(this).val());
        }
    });

    $(".sel_del_hp").click(function(){ // 선택삭제
        $("#send_tel option").each(function(){
            if($(this).is(":selected")){ $(this).remove(); }
        });
    });

    $(".all_del_hp").click(function(){ // 전체삭제
        $("#send_tel option").remove();
    });

    $(".refresh").click(function(){ // 잔여건수 리프레시
        $.ajax({type:"post", url:"ajax.sms_pt.php",  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_pt = $(xml).find("pt").text();

                if(v_mode_ok=='Y'){
                    $(".sms_pt_class").text(v_pt);
                } else {
                    alert(v_msg);
                }
            },
            error:function(rtn,status,error){    alert(error);        }
        });
    });

    $(".send_reg_info").click(function(){ // 발신번호등록 동의서 클릭
        $("#modal_member_box2").dialog({
            resizable: true, height:450, width:500, modal: true, title: "발신번호등록 [동의서]",
            buttons: {
                "예": function() {
                    window.open("http://mjsoft.co/download/agree_sms.pdf","","");
                    $( this ).dialog( "close" );
                },
                "아니요": function() {
                    $( this ).dialog( "close" );
                }
            }
        });
    });

    $(".sms_pwd_ch").click(function(){ // sms 비밀번호 변경
        $(".change-smspwd-container #pwd").val('');
        $(".change-smspwd-container #pwd-new1").val('');
        $(".change-smspwd-container #pwd-new2").val('');
        $(".change-smspwd-container").fadeIn();
    });

    $(".pop_pwsave_class").click(function(){
        if($("#smschgpassword #pwd").val()==''){ alert('이전 비밀번호를 입력하세요.'); return; }
        if($("#smschgpassword #pwd-new1").val()==''){ alert('신규 비밀번호를 입력하세요.'); return; }
        if($("#smschgpassword #pwd-new2").val()==''){ alert('신규 비밀번호 확일을 입력하세요.'); return; }
        if($("#smschgpassword #pwd-new1").val()!=$("#smschgpassword #pwd-new2").val()){ alert('신규 비밀번호가 일치하지 않습니다.'); return; }

        var form_data =     $("form[name='smschgpassword']").serialize();
        //alert(form_data);
        $.ajax({ type:"post", url:"ajax.sms.chgpassProcess.php",data:form_data, dataType : "xml", 
            success:function(xml){     
                var v_mode_ok = $(xml).find("mode_ok").text();
                var v_msg = $(xml).find("msg").text();
                if(v_mode_ok=='Y'){ 
                    alert(v_msg);
                    document.location.href='sms.php'
                } else { 
                    alert(v_msg);
                }

            },
            error:function(rtn,status,error){ 

            }
        });
    });

    $(".adver_sms").click(function(){
        $("#send_content").val("(광고)무료수신거부\n080XXXXXXXX");
    });

    $(".simp_sms").click(function(){
        if(confirm("광고성 정보 전송과 관련하여 표기 의무 위반 시\n\n법률에 따라 최대 3,000만원의 과태료가 부과될 수 있습니다.\n\n지속적인 광고 표기법 위반 시 과태료 부과 대상이 될 수 있으니\n\n각별한 주의 부탁드립니다.\n\n자세한 내용은 화면 하단의 [광고문자 표기의무]를 참고바랍니다.")){
            $("#send_content").val("");
        }
    });

    $(".sms_type_change").click(function(){
        $(".sms_type_title").text("SMS");
        $("input[name='sms_types']").val("sms");
        $("input[name='sms_max_length']").val("80");
        $(".max_txt_length").text("80");
    });
    $(".lms_type_change").click(function(){
        $(".sms_type_title").text("LMS");
        $("input[name='sms_types']").val("lms");
        $("input[name='sms_max_length']").val("2000");
            $(".max_txt_length").text("2000");
    });

    $(".sms_feq_add").click(function(){ // 문자함에 추가 버튼
        if($("#send_content").val().trim()!=''){
            if(confirm('문자함에 추가하시겠습니까?')){
                var form_data = $("form[name='sms_send_form']").serialize();
                $.ajax({ type:"post", url:"ajax.sms_freq_cont.php",data:form_data, dataType : "xml", 
                    success:function(xml){     
                        var v_mode_ok = $(xml).find("mode_ok").text();
                        var v_msg = $(xml).find("msg").text();
                        if(v_mode_ok=='Y'){ 
                            sms_cont_search(1);
                        } else { 
                            alert(v_msg);
                        }

                    },
                    error:function(rtn,status,error){ 

                    }
                });
            }
        }
    });

    $(".btn-sms_send_class").click(function(){ // SMS 전송버튼
        var send_cnt = $("#send_hp option").size();
        if(send_cnt==0){ 
            alert("보내는 사람이 선택되지 않거나 등록되지 않았습니다."+send_cnt); 
            $(".send_reg_info").click();
            return; 
        }
        var hp_cnt = $("#send_tel option").size();
        if(hp_cnt==0){ alert('전송받을 번호를 추가하시기 바랍니다.'); return; }

        var tel_no_list = "";
        $("#send_tel option").each(function(){
            tel_no_list = tel_no_list+$(this).val()+",";
        });
        if(confirm('정말로 전송하시겠습니까?')){
            $("#modal_member_box").html("문자전송이 진행중입니다.<br><br>완료가되면 전송 결과값이 표시됩니다.").dialog({
                resizable: true, height:250, width:500, modal: true, title: "문자 전송 [진행중]"
            });
            $("input[name='send_tel_list']").val(tel_no_list);
            form_data = $("form[name='sms_send_form']").serialize();
            $.ajax({ type:"post", url:"ajax.sms_send.php",data:form_data, dataType : "xml", 
                success:function(xml){     
                    var v_mode_ok = $(xml).find("mode_ok").text();
                    var v_msg = $(xml).find("msg").text();
                    var v_cnt_do = $(xml).find("cnt_do").text();
                    var v_cnt_fail = $(xml).find("cnt_fail").text();
                    var v_cnt = $(xml).find("cnt").text();
                    if(v_mode_ok=='Y'){ 
                        var r_msg = "문자 전송 총:"+v_cnt+"건, 성공:"+v_cnt_do+", 실패:"+v_cnt_fail;
                        alert(r_msg);
                        $("#modal_member_box").dialog("close");
                        $(".refresh").click();
                    } else { 
                        alert(v_msg);
                        $("#modal_member_box").dialog("close");
                        $(".refresh").click();
                    }

                },
                error:function(rtn,status,error){ 
                    alert(error);
                }
            });
        }
    });

    $("#dealdate").change(function(){
        $("#sdate").val(""); $("#edate").val("");
    });

    $("#sdate, #edate").change(function(){
        $("#dealdate").val("");
    });

    customer_sms_search("",1);
    sms_cont_search();
    send_hp_init();
});

function customer_search(v_cn,v_page){
    var sti_val = $("form[name='customer_search_form'] select[name='sti'] option:selected").val();
    if(sti_val==undefined){ sti_val = "comp_name"; }
    $.get("customer_list.inc.php?biztype=0&modetype=sms&sti="+sti_val+"&stx="+v_cn+"&page="+v_page,function(rtn){
        $("#modal_member_box").html(rtn).dialog({
            resizable: true, height:780, width:1100, modal: true, title: "거래처 [검색]",
            buttons: {
                닫기: function() {
                    $( this ).dialog( "close" );
                }
            }
        });
    });    
}

function customer_sms_search(v_cn,v_page){
    var form_data = $("form[name='sms_cust_search']").serialize();
    $.get("customer_list2.inc.php?"+form_data+"&page="+v_page,function(rtn){
        $(".sms_cust_list").html(rtn);
    });    
}

function sms_cont_search(v_page){
    var form_data = $("form[name='sms_cust_search']").serialize();
    $.get("sms_freq_cont.inc.php?"+form_data+"&page="+v_page,function(rtn){
        $(".sms_freq_cont").html(rtn);
    });    
}

function add_hp(v){
    var v = hp_number_ch(v); 
    var vv = "Y";
    $("#send_tel option").each(function(){
        if(v==$(this).val()){ vv = "N"; }
    });
    if(v!='' && vv=="Y"){
        $("#send_tel").append("<option value='"+v+"'>"+v+"</option>");
    }
}

function send_hp_init(){ // 보내는사람 받아오기
    $.ajax({type:"post", url:"ajax.sms_sender.php",  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_telno = $(xml).find("telno");

            if(v_mode_ok=='Y'){
                for(i=0;i<v_telno.length;i++){
                    $("#send_hp").append("<option value='"+v_telno.eq(i).text()+"'>"+v_telno.eq(i).text()+"</option>");                    
                }
            } else {
                alert(v_msg);
            }
        },
        error:function(rtn,status,error){    alert(error);        }
    });
}

function byte_check(wr_message, sms_bytes)
{
    var conts = document.getElementById(wr_message);
    var bytes = document.getElementById(sms_bytes);

    var i = 0;
    var cnt = 0;
    var exceed = 0;
    var ch = '';

    for (i=0; i<conts.value.length; i++)
    {
        ch = conts.value.charAt(i);
        if (escape(ch).length > 4) {
            cnt += 2;
        } else {
            cnt += 1;
        }
    }

    bytes.innerHTML = cnt;

    max_byte = $("input[name='sms_max_length']").val();

    if (cnt > max_byte)
    {
        exceed = cnt - max_byte;
        alert('메시지 내용은 '+max_byte+'바이트를 넘을수 없습니다.\n\n작성하신 메세지 내용은 '+ exceed +'byte가 초과되었습니다.\n\n초과된 부분은 자동으로 삭제됩니다.');
        var tcnt = 0;
        var xcnt = 0;
        var tmp = conts.value;
        for (i=0; i<tmp.length; i++)
        {
            ch = tmp.charAt(i);
            if (escape(ch).length > 4) {
                tcnt += 2;
            } else {
                tcnt += 1;
            }

            if (tcnt > max_byte) {
                tmp = tmp.substring(0,i);
                break;
            } else {
                xcnt = tcnt;
            }
        }
        conts.value = tmp;
        bytes.innerHTML = xcnt;
        return;
    }
}
</script>
<?php include('./include/footer.php'); ?>
<div id="modal_member_box" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>
<div id="modal_member_box2" title="2차모달" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;">
<pre>
    --- 발신번호 사전등록제 시행 ---

    전기통신사업법 개정에 따라 보이스피싱, 스미싱 등 전기통신금융사기의 
    피해를 방지하기 위해 송신인의 전화번호를 다른 전화번호로 
    임의로 변경하는 등 발신번호를 변작한 문자 메시지에 대한
    차단조치가 시행되면서 사전에 등록된 발신번호만 사용이 가능합니다.


    <발신번호 사전등록 절차>
    1. 가입 통신사(SKT, KT, LG등)에 문의하여 '통신 서비스 이용 증명원'을 
    발급 받습니다.

    2. 발급받은 서류와 당사에서 제공하는 '발신번호등록 동의서' 양식을 
    작성하여 당사 고객센터에 팩스(053-744-1120)로 전송후 
    유선(1566-8680)으로 접수합니다.

    3. 심사를 거친후 등록이 됩니다.

    문의: 1566-8680
    지금 '발신번호등록 동의서' 양식을 다운로드 하시겠습니까?
</pre>
</div>