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

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

    if(
$ord_type==''){ $ord_type 1; }

    if( isset(
$keyword) && $keyword !== ""){
          if( 
$searchCode == '1')  $Code =  " and r.idx = '$keyword' ";
          if( 
$searchCode == '2')  $Code =  " and r.user_id = '$keyword' ";
          if( 
$searchCode == '3')  $Code =  " and r.user_name like '%$keyword%' ";
          if( 
$searchCode == '4')  $Code =  " and r.cdkey = '$keyword' ";
          if( 
$searchCode == '5')  $Code =  " and r.bigo like '%$keyword%' ";
         
// if( $searchCode == '6')  $Code =  " and d.mac_addr like '%$keyword%' "; //20130906 MacÁÖ¼Ò
          
if( $searchCode == '6')  $Code =  " and (replace(replace(d.mac_addr,':',''),'-','') like '%$keyword%'  or d.mac_addr like '%$keyword%') "//20190215 :Çϰí -Á¦¿Ü½ÃÄѼ­ °Ë»öÇϰԠº¯°æ
        
}

        if (
$SearchMdiv == 0){
             
$mCode " "
        } else {
            
$mCode " AND r.app_code = '$SearchMdiv' ";    //ÀÚ»ê°ü¸®Pro
        
}

   
$cm_nCount                    =     20;
   
$cm_item_nCount        =    30;

    function 
pageListing($cur_page$total_page$n$url$mode$SearchMdiv ,$SearchMup,$SearchMper,$searchCode ,$keyword ,$SearchMsw1 $cm_nCount$menu$sub  ) {

        
$retValue "<div class='paging'>";
        if (
$cur_page 1) {

            
$retValue .= "<a href='" $url . ($cur_page-1) ."' class='page'><span class='next'>ÀÌÀü</span></a>";
        } else {
            
$retValue .= "";
            
$retValue .= "";
        }

        
$retValue .= "";

        
$start_page = ( ( (int)( ($cur_page ) / 10 ) ) * 10 ) + 1;

        
$end_page $start_page 9;
        if (
$end_page >= $total_page$end_page $total_page;
            if (
$start_page 1$retValue .= "<a href='" $url . ($start_page-1) . "' class='page'><span class='next10'>ÀÌÀü 10°³</span></a>";

                if (
$total_page 1)
                    for (
$k=$start_page;$k<=$end_page;$k++)
                if (
$cur_page != $k$retValue .= "<a href='$url$k'>$k</a>";
                    else 
$retValue .= "<a href='$url$k' class='on'>$k</a>";

        if (
$total_page $end_page$retValue .= "<a href='" $url . ($end_page+1) . "' class='page'><span class='pro10'>´ÙÀ½ 10°³</span></a>";

        
$retValue .= "";

        if (
$cur_page $total_page) {
            
$retValue .= "<a href='$url. ($cur_page+1) ."' class='page'><span class='pro'>´ÙÀ½</span></a>";

        } else {
            
$retValue .= "";
            
$retValue .= "";
        }

    
$retValue .= "</div>";
    return 
$retValue;
}

    
$total_sql  =   "SELECT e.edit_date,r.idx, r.user_id, r.cdkey, r.user_name, r.enddate, r.license_pc, r.license_pda, r.sale_amount,
                                    r.bigo, r.rgst_dtm, r.rgster, c.cde_nm, 
                                    COUNT(d.cdkey) AS use_cdkey
                                    FROM regist_user r 
                                    left join regist_user_edate e on r.idx = e.idx
                                    LEFT JOIN mac_detail d ON (d.cdkey = r.cdkey)
                                    LEFT JOIN codes c ON (r.app_code = c.cde and c.cdiv='01')
                                    where r.idx > 0 
{$Code} {$mCode} GROUP BY r.idx, r.user_id, r.cdkey, r.user_name, r.enddate, r.license_pc, r.license_pda, r.sale_amount, r.bigo, r.rgst_dtm, r.rgster, c.cde_nm ";
    
    
$result      mysql_query($total_sql) or die (mysql_error());
    
$nTotalCount mysql_num_rows($result);
    
$nPage       ceil($nTotalCount $cm_nCount);
    if (
$pg == ""$pg 1;
    if(!isset(
$_POST['search_mode'])) $_POST['search_mode'] = "";
    if (
$_POST['search_mode'] == "Y"){ // °Ë»ö ½Ã ÆäÀÌ¡³Ñ¹ö ³¯¸®±â À§ÇØ ¾Æ·§ÂÊ hidden °ª Æ÷ÇÔÇÏ¿© ¼±¾ð 2013.12.02 by.jyh
        
$pg 1;      
    }
    
    
$nFrom = ($pg 1) * $cm_nCount;
    if(
$ord_type=='1'){
        
$sql    $total_sql "  order by e.edit_date desc, r.idx DESC limit $nFrom$cm_nCount ";
    } else {
        
$sql    $total_sql "  order by r.idx DESC limit $nFrom$cm_nCount ";
    }
    
//echo $sql;
    
$result mysql_query($sql) or die (mysql_error());
?>

<script> 
    
function Search(){
    document.getElementById('search_mode').value = "Y";
    searchFrm.submit();
}

function pro_storeWrite(){
    location.href = "pro_storeWrite.php";

   
function CheckAll() {

    if( document.pro_storeFrm.all.value == 1){
    document.chkImg.src = "bt_allcheck_not.gif";

        for (var i=0;i<document.pro_storeFrm.elements.length;i++){
            if (document.pro_storeFrm.elements[i].name == 'pro_storeForm[]'){
                document.pro_storeFrm.elements[i].checked = true;
            }
        }
        
        document.pro_storeFrm.all.value = '0';
         
    } else {
        document.chkImg.src = "bt_allcheck.gif";

        for (var i=0;i<document.pro_storeFrm.elements.length;i++){
            if (document.pro_storeFrm.elements[i].name == 'pro_storeForm[]'){
                document.pro_storeFrm.elements[i].checked = false;
            }
        }

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



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

  
function delnum(idx){
    if(confirm("ÇØ´çÁ¤º¸¸¦ »èÁ¦ ÇϽðڽÀ´Ï±î?")){
        var delidx = "dellnumProcess.php?idx="+idx+"";
        var delwin = window.open( delidx, "ifrm");
        
    } else {
        
        return;
    }
}

function editnum2(idx){
    var oldwin = window.open( "newwinedit.php?idx="+idx+"", "newpop", "status=0,toolbar=0,resizable=0,scrollbars=yes,width=680,height=650" );
}

function newadd(){
    var oldwin = window.open( "./newwinadd.php", "newpop", "status=0,toolbar=0,resizable=0,scrollbars=no,width=480,height=350" );
}

function orderby_change(){
    Search();
}
</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">
                MacAddress Á¤Ç°ÀÎÁõ
                <span class="list_sub_ttl bgygr">MacAddress Á¤Ç°ÀÎÁõ °ü¸® ÆäÀÌÁöÀÔ´Ï´Ù.</span>
            </h3>
                    
            <div class="originalArea">
                <ul class="search_tender">

<?
    $sql 
"SELECT cde, cde_alias, flag4 FROM codes WHERE flag4 != '' ORDER BY flag4";
    
$res mysql_query($sql);
    while(
$info mysql_fetch_array($res)){
        
$code_array[$info['cde']] = $info;
    }

    foreach(
$code_array as $key=>$val){
        
$sql "select count(*) as cnt, sum(license_pc) as sum_lic, sum(license_pda) as sum_pda from regist_user where app_code = '{$val['cde']}';";
        
$res mysql_query($sql);
        
$info mysql_fetch_array($res);
        
//if($info['sum_pda']=='0'){
        
if($val['cde']=='090' || $val['cde']=='085'){
        
$sum_lic $info['sum_lic']-$info['sum_pda'];
            
$cnt "{$info['cnt']}/{$sum_lic}/{$info['sum_pda']}";
        } else {
            
$sum_lic $info['sum_lic'];
            
$cnt "{$info['cnt']}/{$sum_lic}";
        }
        echo 
"<li><em>{$val['cde_alias']} :</em><span>{$cnt}</span></li>";
    }
?>

                </ul><!--//search_tender-->
            </div><!-- //originalArea -->


            <!-- °Ë»ö¹Ú½º -->
            <form name='searchFrm' method="post" action="">
                <input type="hidden" name="search_mode" id="search_mode">
                <div class="searchArea searchAreaPlus" style="margin:5px 0;">
                    <span class="searchAreaL"></span>
                    <span class="searchAreaR"></span>
                    <dl class="search_tender requestSearchArea" style="width:800px;">
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='ord_type' id="ord_type" class="nonearrow" onchange="orderby_change()">
                                <option value='0' <?php if($ord_type=='0'){?>selected<?php }?>>ÃÖ±Ùµî·Ï¼ø</option>
                                <option value='1' <?php if($ord_type=='1' || $ord_type==''){?>selected<?php }?>>ÃÖÁ¾¼öÁ¤Àϼø</option>
                            </select>
                        </dd>
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='SearchMdiv' id="program" class="nonearrow">
                                <option value=0  <? if($SearchMdiv == '0'){ echo "selected"; } ?>>¼±ÅÃÇϼ¼¿ä</option>
    <? 
        $osql 
"SELECT cde, cde_alias, flag4 FROM codes WHERE flag4 != '' ORDER BY flag4";
        
$oresult mysql_query($osql);

        while(
$orow mysql_fetch_array($oresult)){
    
?>
                                <option value="<?=$orow['cde']?><? if($SearchMdiv == $orow['cde']){ echo "selected"; } ?> ><?=$orow['cde_alias']?></option>
    <? ?>
                            </select>
                        </dd>
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='searchCode' class="nonearrow">
                                <option value="2"  <? if($searchCode == '2'){ echo "selected"; } ?>>ȸ¿øID</option>
                                <option value="3"  <? if($searchCode == '3'){ echo "selected"; } ?>>»óÈ£[ȸ¿ø¸í]</option>
                                <option value="6"  <? if($searchCode == '6'){ echo "selected"; } ?>>MacÁÖ¼Ò</option> 
                                <option value="1"  <? if($searchCode == '1'){ echo "selected"; } ?>>µî·Ï¹øÈ£</option>
                                <option value="4"  <? if($searchCode == '4'){ echo "selected"; } ?>>¾¾µðŰ</option>
                                <option value="5"  <? if($searchCode == '5'){ echo "selected"; } ?>>ºñ°í</option>
                            </select>
                        </dd>
                        <dd>
                            <input type='text' name='keyword' class='keyword' size='20' value='<?=$keyword;?>' onKeyDown="javascript:if(event.keyCode == 13) Search();" style="width:143px;height:29px;">
                        </dd>
                        <dd class="searchbtnarea">
                            <a href='javascript:Search();' class="searchBtn bgygr">°Ë»ö</a>
                            <input type='hidden' name='mode' value='search'>
                        </dd>
                        <a class="count_btn" style="display:inline-block; background:#677E3D;" onclick="newadd();">½Å±Ôµî·Ï</a>
                    </dl><!--search_tender-->
                </div><!-- //searchArea1-->
            </form>


            <form name='pro_storeFrm'>
                <input type="hidden" name="all" value="1">
                <input type="hidden" name="exCode" value="alldel">
                <div class="borderWarp" style="margin-top:0; border-bottom:0 none;">
                    <table class="borderTable requestarea">
                        <tr class="bgygr">
                            <th>¹øÈ£</th>
                            <th>ȸ¿øID</th>
                            <th>»óÈ£[ȸ¿ø¸í]</th>
                            <th>ÇÁ·Î±×·¥/CD-KEY</th>
                            <th>¶óÀ̼¾½º</th>
                            <th>PDA/õSÁ¶È¸Àü¿ë</th>
                            <th>µî·Ï/¸¸·áÀÏ</th>
                            <th>±Ý¾×</th>
                            <th>ºñ°í</th>
                            <th class="last">°ü¸®</th>
                        </tr>
<?
 
if($num mysql_num_rows($result)){
      
     while(
$row  mysql_fetch_array($result)) {
         if(!isset(
$row['category_name'])) $row['category_name'] = "";
         if(!isset(
$row['reg_date'])) $row['reg_date'] = "";
         if(!isset(
$row['content'])) $row['content'] = "";
         if(!isset(
$row['app_block'])) $row['app_block'] = "";
        
// if(!isset($row['reg_date'])) $row['reg_date'] = time();
         
     
$category_name    =      explode("->",$row['category_name']);
    
// $regdate          =      date('Y-m-d', $row['reg_date']);
     //$regdate          =      $row['reg_date'];
     
$content          =      stripcslashes($row['content']);

    
$sql "select * from regist_user_log where ru_idx = '{$row['idx']}' order by idx desc limit 1";
    
//echo $sql;
    
$res mysql_query($sql);
    
$info mysql_fetch_array($res);
    
//print_r($info);
?>
                        <tr <? if($row['app_block'] == "1"){ echo "bgcolor=#f49ac2"; }?>>
                            <td class="family"><?=$row['idx'];?> </td>
                            <td class="family"><?=$row['user_id']?></td>
                            <td style='max-width:190px;'><?=$row['user_name'];?> </td>
                            <td style="line-height:14px;"><span class="key">[<?=$row['cde_nm']?>]<br /><strong><?=$row['cdkey'];?></strong></span></td>
                            <td class="family"><?=$row['license_pc'];?> (<?=$row['use_cdkey']?>) </td>
                            <td class="family"><?=$row['license_pda'];?></td>
                            <td style="line-height:14px;"><?=substr($row['rgst_dtm'],0,10);?><br /><span class="end_date"><?=$row['enddate']?></span></td>
                            <td class="family"><?=$row['sale_amount'];?> </td>
                            <td style='max-width:170px;'><?=$row['bigo'];?> </td>
                            <td class="last" style="padding:2px 0; line-height:14px;">
                                <!--<a href="javascript:editnum2('<?=$row['idx']?>');">--><?if($info['rgster']!=''){ echo $info['rgster']; } else { echo $row['rgster']; }?><!--</a>-->
                                <br>
                                <img src="./images/common/small_btn_edit.png" alt="¼öÁ¤" style="cursor:pointer;" onclick="editnum2('<?=$row['idx']?>');">
                                <img src="./images/common/small_btn_del.png" alt="»èÁ¦" style="cursor:pointer;" onclick="delnum('<?=$row['idx']?>');">
                            </td>
                        </tr>  
<? 
    

 } else {  
?>
                        <tr>
                            <td colspan="11">µ¥ÀÌÅͰ¡ ¾ø½À´Ï´Ù.</td>
                        </tr>
<?  }  ?>

                    </table><!-- //borderTable -->
                </div><!-- //borderWarp -->
            </form>

            <? echo pageListing($pg$nPage$cm_nCount"NewcertiManage.php?menu=3&sub=2&search_mode=$search_mode&SearchMdiv=$SearchMdiv&SearchMdiv=$SearchMdiv&searchCode=$searchCode&keyword=$keyword&mode=$mode&ord_type=$ord_type&pg=" $mode$SearchMdiv ,$SearchMup,$SearchMper,$searchCode ,$keyword ,$SearchMsw1 $cm_nCount$menu$sub)?>
            <?//print_r($_REQUEST)?>
                     
            <iframe name="ifrm" width="0" height="0"></iframe>

        </div><!-- //admin_table -->

        <p class="navi">°ü¸®ÀÚ¸ðµå > Á¤Ç°°ü¸® > MacAddredd Á¤Ç°ÀÎÁõ</p>

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


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

</body>
</html>