/home/mjc1/public_html/manage/easytax_stats.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
 <?
    
include("./include/admin_include_header.php");

if(isset(
$_SESSION['ADMINID']) && ($_SESSION['ADMINID'] == "lys")){ 
    echo 
"
        <script>
            alert('Á¢±ÙÇÒ ¼ö Àִ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.');
            history.go(-1);
        </script>"
;
}

    
$app_codes['97'] = 'õ³â°æ¿µCS';
    
$app_codes['99'] = 'õ³â°æ¿µII';
    
$app_codes['98'] = 'õ³â°æ¿µLite';
    
$app_codes['53'] = 'õ³â°æ¿µCS3';
    
$app_codes['40'] = 'ÀÌÁöÅØ½ºCS';
    
$app_codes['39'] = 'ÀÌÁöÅØ½ºII';
    
$app_codes['41'] = 'ÀÌÁöÅØ½ºlite';
    
$app_codes['80'] = 'ÀÌÁöÅØ½º(À¥)';
    
$app_codes['81'] = '½º¸¶Æ®TAX';


    
/*include("./category/mscommon.php");
    $sql = "select * from app where app_active = 1 order by app_name";
    $res = mysql_query($sql);
    while($info= mysql_fetch_array($res)){
        $app_array[] = $info;
        $app_name[$info['app_id']] = $info['app_name'];
    }

    include("./category/common2.php");*/
    
    
$cm_nCount          =      10;
    
$cm_item_nCount     =      30;  

    if(
$sdate==''){ $sdate date("Y-m-d",time()-(60*60*24*7)); }
    if(
$edate==''){ $edate date("Y-m-d",time()); }

    
$sdate2 str_replace("-","",$sdate);
    
$edate2 str_replace("-","",$edate);
    
?>

<script> 
    
function Search(){
    $.get("ajax_date_diff_time.php?sdate="+$("input[name='sdate']").val()+"&edate="+$("input[name='edate']").val(),function(rtn){
        if(rtn>2678400){
            alert('DBºÎÇϷΠÀÎÇØ¼­ °Ë»ö±â°£Àº ÇÑ´Þ(31ÀÏ)À» ³ÑÀ»¼ö ¾ø½À´Ï´Ù.');
        } else {
            document.getElementById('search_mode').value = "Y"; 
            searchFrm.submit();
        }
    });    
}
 
function develWrite(){
    location.href = "eventWrite.php?menu=4&sub=8";

   
function CheckAll() {
 
    if( document.develFrm.all.value == 1){
        document.chkImg.src = "bt_allcheck_not.gif";
    
    
        for (var i=0;i<document.develFrm.elements.length;i++){
            if (document.develFrm.elements[i].name == 'develForm[]'){
                document.develFrm.elements[i].checked = true;
            }
        }
        
        document.develFrm.all.value = '0'; 
        
    } else {
        document.chkImg.src = "bt_allcheck.gif";
    
        for (var i=0;i<document.develFrm.elements.length;i++){
            if (document.develFrm.elements[i].name == 'develForm[]'){
                document.develFrm.elements[i].checked = false;
            }
        }

        document.develFrm.all.value = '1'; 
    }



function allDel(){
    var cnt=0;
    
    for (var i=0;i<document.develFrm.elements.length;i++){
        if (document.develFrm.elements[i].name == 'develForm[]'){
                if( document.develFrm.elements[i].checked == true ) cnt++;
            }
        }
        
        if(cnt>0){ 
        
            if(confirm("¼±ÅÃÇϽŠ"+ cnt +" °³ÀÇ °Ô½Ã¹° Á¤º¸¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?") ){
                document.develFrm.action = "eventBoardProcess.php" ;
                document.getElementById("develFrm").target="hidden_frame_mijin";           
                document.develFrm.submit();
            }
            
        } else {
        alert("»èÁ¦ÇÒ Ç׸ñÀ» ¼±ÅÃÇϼ¼¿ä.")
        return;
    }   
}     

$(function(){
    $("#status").change(function(){
        var v_status = $(this).val();
        var tr_obj = $(this).closest('tr');
        var v_uid = $(tr_obj).find("#develForm_uid").val();

        if(confirm('ÇØ´ç ¶óÀÎÀÇ »óŰªÀ» º¯°æÇϽðڽÀ´Ï±î?')){
            $("#status_change_form input[name='uid']").val(v_uid);
            $("#status_change_form input[name='status']").val(v_status);
            
            $("#status_change_form").submit();
        }

    });
    $("#searchCode1").change(function(){
        $("#searchFrm").submit();
    });
});
</script>
<link rel='stylesheet' type='text/css' href='./css/new.css'>

<div class="container">
    <div class="border_contents">
        <div class="admin_table">
            <h3 class="list_ttl">
                ÀÌÁöÅØ½º Åë°è
                <span class="list_sub_ttl bgpi">ÀüÀÚ¼¼±Ý°è»ê¼­ ¹ßÇà Åë°è ÆäÀÌÁö ÀÔ´Ï´Ù.</span>
                <span id="idcheck"></span>
            </h3>

            <form name='searchFrm' id='searchFrm' method=get>
                <input type="hidden" name="search_mode" id="search_mode">
                <input type="hidden" name="menu" value='<?php echo $menu;?>'>
                <input type="hidden" name="sub" value='<?php echo $sub;?>'>
                <div class="searchArea searchAreaPlus">
                    <span class="searchAreaL"></span>
                    <span class="searchAreaR"></span>
                    <dl class="search_tender requestSearchArea" style="width:620px;">
                        <dd>
                            ¿¥Á¦À̹ßÇà Á¦¿ÜÇϱâ <input type='checkbox' class='nobuy_mem' name='inner_exp' value='1' <?if($inner_exp=='1'){ echo "checked"; }?>
                            <!--<input type='text' name='keyword' size=20 value='<?=$keyword;?>' onKeyDown="javascript:if(event.keyCode == 13) Search();">-->
                        </dd>
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='searchCode' class="nonearrow">
                                <option value='' <? if($searchCode == $key){ echo "selected"; } ?>>Àüü »óǰÁ¾·ù</option>
<?
foreach($app_codes as $key=>$val){
?>
                                <option value=<?=$key?>  <? if($searchCode == $key){ echo "selected"; } ?>><?=$val?></option>        
<?
}
?>
                            </select>
                        </dd>
                        <dd><input type='text' name='sdate' id='sdate' value='<?=$sdate?>' style='width:70px;height:29px;text-align:center;'></dd>
                        <dd>~</dd>
                        <dd><input type='text' name='edate' id='edate' value='<?=$edate?>' style='width:70px;height:29px;text-align:center;'></dd>
                        
                        <!--<dd>
                            <input type='text' name='keyword' size=20 value='<?=$keyword;?>' onKeyDown="javascript:if(event.keyCode == 13) Search();">
                        </dd>-->
                        <dd class="searchbtnarea">
                            <a href='javascript:Search();' class="searchBtn bgpi" style="right: -30px;">°Ë»ö</a>
                            <input type='hidden' name='mode' value='search'>
                        </dd>
                    </dl><!--search_tender-->
                </div><!-- //searchArea1-->
            </form>
            <!-- //°Ë»ö¹Ú½º -->
<script>
    $(function(){
        $( "#sdate" ).datepicker({
            showOn: "button",
            buttonImage: "./images/common/calendar.png",
            buttonImageOnly: true,
            buttonText: "Select date",
            dateFormat: "yy-mm-dd",
            changeMonth: true,
            changeYear: true,
            prevText: 'ÀÌÀü ´Þ',
            nextText: '´ÙÀ½ ´Þ',
            monthNames: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'],
            monthNamesShort: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'],
            dayNames: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'],
            dayNamesShort: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'],
            dayNamesMin: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'],
            showMonthAfterYear: true,
            yearSuffix: '³â'
        });

        $( "#edate" ).datepicker({
            showOn: "button",
            buttonImage: "./images/common/calendar.png",
            buttonImageOnly: true,
            buttonText: "Select date",
            dateFormat: "yy-mm-dd",
            changeMonth: true,
            changeYear: true,
            monthNames: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'],
            monthNamesShort: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'],
            dayNames: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'],
            dayNamesShort: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'],
            dayNamesMin: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'],
            showMonthAfterYear: true,
            yearSuffix: '³â'
        });
    });
</script>
            <form name='develFrm' id='develFrm'>
                <input type=hidden name=all value=1>
                <input type=hidden name=exCode value=alldel>
                <input type="hidden" name="menu" value="<?=$menu?>">
                <input type="hidden" name="sub" value="<?=$sub?>">
                <div class="borderWarp">
                    <table class="borderTable requestarea">
                        <tr class="bgpi">
                            <!--<th><img src="./images/common/bt_allcheck_all.gif" alt="¸ðµÎ¼±ÅÃ" style="cursor:pointer;" name='chkImg' onClick="CheckAll();"></th>-->
                            <th width=150>»óǰÁ¾·ù</th>
                            <th>¹ßÇà°Ç¼ö</th>
                            <th>SMS¹ßÇà¼ö</th>
                            <th class="last">¹ßÇà±Ý¾×</th>
                        </tr>
<?php
    
include("./category/taxcommon.php");

    
$sql "select * from mj_codes where 1=1";
    
$res mysql_query($sql);
    while(
$info=mysql_fetch_array($res)){
        
$app_array[$info['cde']] = $info['cde_nm'];
    }
    
$app_array['00'] = '±¸¹öÁ¯¾Û';
    
$app_array['85'] = '¾Èµå·ÎÀ̵å';
    
$sum_row 0$sum_sms 0$sum_val 0;
    
//_pr(date("Y-m-d H:i:s",time()));
    
$time1 time();

    if(
$inner_exp=='1'){
        
$mj_sn " and a.SUPLER_BUSNID_ID not in (SELECT BUSNID_ID from tn_aaaa where BUSNID = '5021894746') ";
    }

    if(
$searchCode!=''){
        
$app_code_where " and a.app_code in ('$searchCode') ";
    }

    
$sql "select app_code, sum(num1) as num1, sum(num2) as num2 from (
                select ifnull(b.APP_CODE,'00') as app_code,  
                       1 as num1,
                         case when substring(a.BUSN_MGMT_NO,13,1) = 'T' then 1 else 0 end as num2
                         from tn_eaaa as a
                left join tn_eaaa_mjdata as b on a.ETAXBIL_APPV_NO = b.ETAXBIL_APPV_NO
                where
                a.WRITE_DT between '
{$sdate2}' and '$edate2$mj_sn ) as a
                where
                a.app_code not in ('85') 
$app_code_where
                group by app_code
                order by app_code desc;"
;
    
$res mysql_query($sql);
    while(
$info=mysql_fetch_array($res)){
        
$row_cnt $info['num1'];
        
$sms_cnt $info['num2'];
        
$row_val = ($row_cnt*150)+($sms_cnt*20);
        
$sum_row += $row_cnt$sum_sms += $sms_cnt$sum_val += $row_val;
?>
                        <tr>
                            <!--<td><input name="develForm[]" id='develForm_uid' type="checkbox" value="<?=$row['uid'];?>"></td>-->
                            <th style="background-color: #F189C2 !important;"><?=$app_array[$info['app_code']]." ({$info['app_code']})";?></td>
                            <td class="family"><?=number_format($row_cnt)?></td>
                            <td class="family"><?=number_format($sms_cnt);?></td>
                            <td class="family last"><?=number_format($row_val);?></td>
                        </tr>  
<?
        
//break;
    
}
    
//_pr(date("Y-m-d H:i:s",time()));
    
$time2 time();
?>
                        <tr>
                            <td colspan="1" class="bottom" style="padding:5px 0;">ÇÕ°è</td>
                            <td colspan="1" class="bottom" style="padding:5px 0;"><?=number_format($sum_row)?></td>
                            <td colspan="1" class="bottom" style="padding:5px 0;"><?=number_format($sum_sms)?></td>
                            <td colspan="1" class="bottom last"><?=number_format($sum_val)?></td>
                        </tr>
                    </table><!-- //borderTable -->
                </div><!-- //borderWarp -->
                <br>¡Ø DBºÎÇϷΠÀÎÇØ¼­ °Ë»ö±â°£Àº ÇÑ´Þ(31ÀÏ)À» ³ÑÀ»¼ö ¾ø½À´Ï´Ù.
                        
                <div class="btn1Warp">
                    <font style='color:#fff !important;'>
                        <?echo ($time2-$time1)."ÃÊ";?>
                    </font>
                    <!--<a href="javascript:develWrite();"><span class="btn1">±Ûµî·Ï</span></a>-->
                </div>
            </form>

            <? echo pageListing($pg$nPage$cm_nCount"?menu=7&sub=4&search_mode=$search_mode&searchCode=$searchCode&keyword=$keyword&mode=$mode&pg=" $mode$SearchMdiv ,$SearchMup,$SearchMper,$searchCode ,$keyword ,$SearchMsw1 $cm_nCount$menu$sub)?>
            <?//print_r($_REQUEST)?>

            <iframe id='hidden_frame_mijin' name='hidden_frame_mijin' style="display:none;"></iframe>

        </div><!-- //admin_table -->
        
        <p class="navi">°ü¸®ÀÚ¸ðµå > ÀÏ¹Ý°Ô½ÃÆÇ > °³¹ßÇöȲ</p>

        <div class="footer">
            <?    include("./include/admin_include_footer.php"); ?>
        </div><!-- //footer -->

        <form name='status_change_form' id='status_change_form' method='get' action='eventBoardStatus.php'>
            <input type='hidden2' name='mode' value='mod'>
            <input type='hidden2' name='pg' value='<?php echo $pg;?>'>
            <input type='hidden2' name='menu' value='<?php echo $menu;?>'>
            <input type='hidden2' name='sub' value='<?php echo $sub;?>'>

            <input type='hidden2' name='uid' value=''>
            <input type='hidden2' name='status' value=''>
        </form>

    </div><!-- //border_contents -->
</div><!-- //container -->
</div><!-- //wrap -->

</body>
</html>