/home/mjc1/public_html/j3demo/adm/sms_list.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
<?php
$sub_menu 
"700300";
include(
"./_common.php");
include(
"./auth_check.php"); // 관리자 권한 체크
include($j3_adm_path."/shop_header.php");

if(
$sms_id==''){
    
alert('SMS 로그인하신 후에 이용가능합니다.',"sms.php"); exit;
}

$sms_userid $sms_id;
$sms_pswd $sms_pw;
$cttime date("YmdHis",time());
$usign sha1($cttime.sha1($sms_pswd));

if(
$s_date!=''){
    if(
$s_date=='1'){
        
$date_fr_to "&date_fr=".date("Ymd",time())."&date_to=".date("Ymd",time());
        
$pre_date "&pre_date=".date("Ymd",time());
        
$p_date "어제남은";
    } else if(
$s_date=='2'){
        
$date_fr_to "&date_fr=".date("Ymd",time()-(60*60*24*5))."&date_to=".date("Ymd",time());
        
$pre_date "&pre_date=".date("Ymd",time()-(60*60*24*5));
        
$p_date date("Ymd",time()-(60*60*24*5))."일 이전남은";
    } else if(
$s_date=='3'){
        
$date_fr_to "&date_fr=".date("Ym",time())."01&date_to=".date("Ymd",time());
        
$pre_date "&pre_date=".date("Ym",time())."01";
        
$p_date "지난달 남은";
    } else if(
$s_date=='4'){
        
$vdate2 date("Y-m-d",time());
        
$v strtotime("-1 month {$vdate2}");
        
$vdate1 date("Ym",$v);
        
$date_fr_to "&date_fr=".$vdate1."01&date_to=".$vdate1."31";
        
$pre_date "&pre_date=".$vdate1."01";
        
$p_date "지지난달(2개월) 남은";
    }
    if(
$fail_do=='Y'){
        
$loginUrl "http://psms.mjsoft.co/api/rpt_sent2.php"// 일별 전송 결과 집계
    
} else {
        
$loginUrl "http://psms.mjsoft.co/api/rpt_sent1.php"// 일별 전송 결과 집계
    
}
    
$login_data "&uid=$sms_userid&ctime=$cttime&usign=$usign".$date_fr_to;
    
$result curl_call($loginUrl,$login_data);
    
$json_data_list json_decode($result);
    
//_pr($json_data_list);

    
$loginUrl "http://psms.mjsoft.co/api/rpt_charge1.php"// 충전 내역 집계
    
$login_data "&uid=$sms_userid&ctime=$cttime&usign=$usign".$date_fr_to;
    
$result curl_call($loginUrl,$login_data);
    
$json_data_charge json_decode($result);
    
//_pr($json_data_charge);

    
$loginUrl "http://psms.mjsoft.co/api/get_pre_point.php"// 기준일자 잔액 구하기
    
$login_data "&uid=$sms_userid&ctime=$cttime&usign=$usign".$pre_date;
    
//echo $login_data;
    
$result curl_call($loginUrl,$login_data);
    
$json_data_pre json_decode($result);
    
//_pr($json_data_pre);
}
?>
<!--<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>
<form name='sms_search_form' method='get'>
    <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'>
    <div id="sub-contents-area">
        <div class="sub-btn-area">
            <div class="sub-btn sub-btn-search">
                <input type='radio' name='s_date' id='s_date1' value='1' <?php if($s_date=='' || $s_date=='1'){?>checked<?php }?>> <label for='s_date1'>오늘</label> &nbsp;&nbsp;
                <input type='radio' name='s_date' id='s_date2' value='2' <?php if($s_date=='2'){?>checked<?php }?>> <label for='s_date2'>최근5일</label> &nbsp;&nbsp;
                <input type='radio' name='s_date' id='s_date3' value='3' <?php if($s_date=='3'){?>checked<?php }?>> <label for='s_date3'>이번달</label> &nbsp;&nbsp;
                <input type='radio' name='s_date' id='s_date4' value='4' <?php if($s_date=='4'){?>checked<?php }?>> <label for='s_date4'>지난달</label> &nbsp;&nbsp;
                <input type='checkbox' name='fail_do' id='id_fail_do' value='Y' <?php if($fail_do=='Y'){?>checked<?php }?>> <label for='id_fail_do'>실패건 집계</label>
                &nbsp;<a href="#" class="black-btn" id='search_btn_press'>검색</a>
            </div>
        </div>
    </div>
</form>
    <div class="item_tab">
        <div class="item_tab_navi">
            <a value='0'><span>문자 보내기</span></a>
            <a value='1' class="on"><span>문자 전송집계</span></a>
        </div>
    </div>

<form name='sms_list_form' method='post'>
<input type='hidden' name='sel_del' value=''>
    <div class="div-list-area">
        <div class="cust-list-area" style='border:1px solid #e0e0e0;padding:5px; width:53%;height:600px;overflow-y:scroll;float:left;margin-right:10px;'>
            <table class="order-sheet2" style='border-top:1px solid #e0e0e0;'>
                <caption class="screen_out">발신내역조회<caption>
                <colgroup>
                <col style="width:80px;"><col style="width:80px;"><col style="width:80px;">
                <col style="width:80px;"><col style="width:235px;"><col style="width:60px;">
                </colgroup>

                <thead>
                    <tr>
                        <th scope="col" colspan=6>[ 발 신 내 역 ]</th>
                    </tr>
                    <tr>
                        <th scope="col">일자</th><th scope="col">상태</th><th scope="col">건수</th>
                        <th scope="col">차감</th><th scope="col">비고</th><th scope="col">상세</th>
                    </tr>
                </thead>
                <tbody>
<?php 
    
foreach($json_data_list->table as $key=>$info){
?>
                    <tr>
                        <td class="tcenter ">
                            <input type='hidden' name='dealdate[]' value='<?php echo $info->dealdate;?>'>
                            <input type='hidden' name='RSLT_VAL[]' value='<?php echo $info->RSLT_VAL;?>'>
                            <input type='hidden' name='S[]' value='<?php echo $info->S;?>'>
                            <?php echo $info->dealdate;?>
                        </td>
                        <td class="tcenter "><?php echo $info->sendstat;?></td>
                        <td class="cost "><?php echo number_format($info->cnt);?></td>
                        <td class="cost"><?php echo number_format($info->usept);?></td>
                        <td class="linetxt "><?php echo $info->bigo;?></td>
                        <td class="tcenter click_edit">[상세]</td>
                    </tr>
<?php 
    

?>
                </tbody>
            </table>
        </div>
        <div class="cust-list-area" style='border:1px solid #e0e0e0;padding:5px; width:43%;height:600px;overflow-y:scroll;float:left;'>
            <table class="order-sheet2" style='border-top:1px solid #e0e0e0;'>
                <caption class="screen_out">발신내역조회<caption>
                <colgroup>
                <col style="width:80px;"><col style="width:80px;"><col style="width:80px;">
                <col style="width:255px;">
                </colgroup>

                <thead>
                    <tr>
                        <th scope="col" colspan=4>[ 충 전 내 역 ]</th>
                    </tr>
                    <tr>
                        <th scope="col">일자</th><th scope="col">구분</th><th scope="col">건수</th>
                        <th scope="col">비고</th>
                    </tr>
                </thead>
                <tbody>
<?php 
    
foreach($json_data_charge->table as $key=>$info){
?>
                    <tr>
                        <td class="tcenter ">
                            <?php echo $info->dealdate;?>
                        </td>
                        <td class="tcenter "><?php echo $info->regname;?></td>
                        <td class="cost "><?php echo number_format($info->cnt);?></td>
                        <td class="linetxt"><?php echo $info->bigo;?></td>
                    </tr>
<?php 
    

?>
                    <tr>
                        <td class="tcenter "></td>
                        <td class="tcenter ">이월</td>
                        <td class="cost "><?php echo number_format($json_data_pre->pt);?></td>
                        <td class="linetxt"><?php echo $p_date." 남은 건수";?></td>
                    </tr>
<?php 
?>
                </tbody>
            </table>
        </div>
    </div>
</form>

</div><!--//wrap-->

<script>
var qstr = '<?php echo $qstr;?>';
$(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";
        }
    });

    $("#search_btn_press").click(function(){ // 검색버튼을 누를때
        $("form[name='sms_search_form']").submit();
    });

    $(".click_edit").css("cursor","pointer").click(function(){ // 상세 버튼
        var v_dealdate = $(this).closest("tr").find("input[name='dealdate[]']").val();
        var v_RSLT_VAL = $(this).closest("tr").find("input[name='RSLT_VAL[]']").val();
        var v_S = $(this).closest("tr").find("input[name='S[]']").val();
        $.get("sms_list_detail.inc.php?dealdate="+v_dealdate+"&ty_code="+v_RSLT_VAL+"&msg_type="+v_S,function(rtn){
            $("#modal_member_box").html(rtn).dialog({
                resizable: true, height:700, width:540, modal: true, title:"문자전송 [상세]",
                buttons: {
                    닫기: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });

});
</script>
<?php include($j3_adm_path."/shop_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>