/home/mjc1/public_html/emillennium/statement.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
<?php
$dir 
".";
include_once(
$dir."/_common.php");

//_pr($_POST);

$midx_list "";
foreach(
$code_idx as $key=>$val){
    
$midx_list .= "{$codes[$val]},";
}
$midx_list substr($midx_list,0,strlen($midx_list)-1);
//_pr($midx_list);

if($midx_list=='' && $midx!='' && count($seq_idx)>&& count($seqs)>0){
    
$midx_list $midx$seq_list "";
    foreach(
$seq_idx as $key=>$val){
        
$seq_list .= "{$seqs[$val]},";
    }
    
$seq_list substr($seq_list,0,strlen($seq_list)-1);
}

$sql "select * from offices where code = 1 ";
$res mysql_query($sql,$connect_e1000y);
while(
$minfo mysql_fetch_array($res)){
    
$code $minfo['code'];
    
$comp_sn $minfo['comp_sn'];
    
$telno1 $minfo['telno1'];
    
$hpno $minfo['hpno'];
    
$faxno $minfo['faxno'];
    
$sub_comp_sn $minfo['sub_comp_sn'];
    
$biz_status $minfo['biz_status'];
    
$biz_item $minfo['biz_item'];
    
$comp_name $minfo['comp_name'];
    
$ceo_name $minfo['ceo_name'];
    
$zipcode $minfo['zipcode'];
    
$addr_m $minfo['addr_m'];
    
$addr_d $minfo['addr_d'];

    
$tax_charge_name $minfo['tax_charge_name'];
    
$tax_charge_hpno $minfo['tax_charge_hpno'];
    
$tax_charge_email $minfo['tax_charge_email'];

    
$buy_array[] = $minfo;
}
?>
<style>
.sub-btn a { color:#fff; }
</style>
<form name='statement_reg_form' method='post' action=''>
<input type='hidden' name='qstr' value=''>
<input type='hidden' name='midx_list' value='<?php echo $midx_list;?>'>
<input type='hidden' name='seq_list' value='<?php echo $seq_list;?>'>
<input type='hidden' name='sendmode' value=''>
    <div id="sub-contents-area">
        <div class="sub-btn-area">
            <div class="sub-btn pop-btn" style=''>
                <a class="lignt-blue-btn" id='btn_state_comp'>내부발행</a><?php if($sel_mode==''){?><a class="blue-btn" id='btn_state_printer2'>발행</a><?php }?><a class="gray-btn" id='btn_state_email2'>메일전송</a><a class="black-btn" id='sel_cancel'>취소</a>
            </div>
        </div>
    </div>

<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;">
        </colgroup>

        <tbody>
        <tr>
            <th>용지선택</th>
            <td colspan=3>
                <select name='print_type' class='width_200'>
                    <option value='0' <?php if($_COOKIE['em_print_type']=='0'){ echo "selected"; }?>>A4 반장일반 양식지</option>
                    <option value='1' <?php if($_COOKIE['em_print_type']=='1'){ echo "selected"; }?>>A4 반장일반 백지(양식인쇄)</option>
                    <option value='2' <?php if($_COOKIE['em_print_type']=='2'){ echo "selected"; }?>>A4 21라인 일반 양식지</option>
                    <option value='3' <?php if($_COOKIE['em_print_type']=='3'){ echo "selected"; }?>>A4 21라인 일반 백지(양식인쇄)</option>
                </select>
            </td>
        </tr>
        <tr>
            <th>[도장] 인쇄</th>
            <td colspan=3>
                <input type='checkbox' name='seal_print' value='1'> 도장 : <img src='http://mjsoft.co/seal/<?php echo $comp_sn;?>.gif' onerror="this.style.display='none';" width=28>
            </td>
        </tr>
    </table>
</div>

</form>
<script>
$(function(){
    $(".pop-btn a").css("color","#fff");

    $("#sel_cancel").click(function(){ // 닫기
        $("#modal_member_box").dialog("close");
    });

    $("#btn_state_printer2").click(function(){ // 인쇄 발행
        window.open("","state_print", "width=800, height=800, scrollbars=yes");
        $("input[name='sendmode']").val("print");
        statement_reg_form.action='statement_print.php';
        statement_reg_form.target='state_print';
        statement_reg_form.submit();
    });

    $("#btn_state_email2").click(function(){ // 메일전송 발행
        window.open("","state_print", "width=800, height=800, scrollbars=yes");
        $("input[name='sendmode']").val("email");
        $("select[name='print_type']").val('3')
        statement_reg_form.action='statement_print.php';
        statement_reg_form.target='state_print';
        statement_reg_form.submit();
    });

    $("#btn_state_comp").click(function(){
        $("input[name='sendmode']").val("direct");
        var form_data = $("form[name='statement_reg_form']").serialize();

        $.ajax({type:"post", url:"ajax.state_cancel_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_file_name = $(xml).find("file_name").text();
                if(v_mode_ok!='Y'){
                    alert(v_msg);
                } else {
                    document.location.reload();
                }
            },
            error:function(rtn,status,error){    alert(error);        }
        });
    });
    
    $("select[name='print_type']").change(function(){ // 용지선택 쿠기저장 
        setsave("em_print_type",$(this).val(),365);
    });
});

</script>