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

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

/*
if ($txtdate == "") { 
    $txtdate = ($txtdate == "") ? date("Y-m-d", strtotime("-1 Month")) : $txtdate; 
}
if ($txtdate2 == "") { 
    $txtdate2 = ($txtdate2 == "") ? date("Y-m-d", time()) : $txtdate2; 
}
*/

$where "";

if(
$st1 != "") {
    
$where .= " AND opt = '{$st1}'";
}
if(
$txtdate != "" && $txtdate2 != "") {
    
$where .= " AND reg_date BETWEEN '{$txtdate} 00:00:00' AND '{$txtdate2} 23:59:59'";
}
if(
$stx != "") {
    
$where .= " AND company LIKE '%{$stx}%'";
}

$sql "SELECT COUNT(*) AS cnt
        FROM (
        SELECT '°ßÀû' AS opt, company, detail, admin, reg_date, product AS state_log, '' AS smtitle, gubun AS flag, mobile
        FROM mBoard_consult
        WHERE 1=1 UNION
        SELECT '°ßÀû' AS opt, smname AS company, smdetail AS detail, smoption AS admin, reg_date, state_log, smtitle, proResult AS flag, come_from AS mobile
        FROM mBoard_install_req
        WHERE smtitle in('consult-pc','consult-mobile') UNION
        SELECT '»ó´ã' AS opt, smname AS company, smdetail AS detail, smoption AS admin, reg_date, state_log, smtitle, proResult AS flag, come_from AS mobile
        FROM mBoard_install_req
        WHERE smtitle in('pc','mobile','visit-pc','visit-mobile') UNION
        SELECT '¼³Ä¡' AS opt, smname AS company, smdetail AS detail, smoption AS admin, reg_date, state_log, smtitle, proResult AS flag, come_from AS mobile
        FROM mBoard_install_req
        WHERE smtitle NOT in ('pc','mobile','visit-pc','visit-mobile','consult-pc','consult-mobile') UNION
        SELECT '±³À°' AS opt, e_company AS company, 'Áýü±³À°½Åû' AS detail, e_person AS admin, reg_date, proc_date AS state_log, '' AS smtitle, e_state AS flag, mobile
        FROM mBoard_education UNION
        SELECT '½Å±Ô' AS opt, custname AS company, 'µ¥¸ð¼³Ä¡' AS detail, '°ü¸®ÀÚ' AS admin, flow_date AS reg_date, flow_date AS state_log, flow_path AS smtilte, '7' AS flag, '' AS mobile
        FROM mBoard_file_download_setting
        WHERE 1=1) aa
        WHERE 1 
$where";
$result      =    mysql_query($sql,$connect_web);
$row mysql_fetch_array($result);
$total_count $row['cnt'];

$list_num 15;
$total_page  ceil($total_count $list_num);  // Àüü ÆäÀÌÁö °è»ê
if ($page 1) { $page 1; } // ÆäÀÌÁö°¡ ¾øÀ¸¸é Ã¹ ÆäÀÌÁö (1 ÆäÀÌÁö)
$from_record = ($page 1) * $list_num// ½ÃÀÛ ¿­À» ±¸ÇÔ

$sql "SELECT *
        FROM (
        SELECT '1' AS idx, '°ßÀû' AS opt, company, detail, admin, reg_date, product AS state_log, '' AS smtitle, gubun AS flag, mobile, tel AS tel,
        email AS email, uid AS code
        FROM mBoard_consult
        WHERE 1=1 UNION
        SELECT '2' AS idx, '°ßÀû' AS opt, smname AS company, smdetail AS detail, smoption AS admin, reg_date, state_log, smtitle, proResult AS flag, come_from AS mobile, smtel AS tel, s_email AS email, uid AS code
        FROM mBoard_install_req
        WHERE smtitle in('consult-pc','consult-mobile') UNION
        SELECT '3' AS idx, '»ó´ã' AS opt, smname AS company, smdetail AS detail, smoption AS admin, reg_date, state_log, smtitle, proResult AS flag, come_from AS mobile, smtel AS tel, s_email AS email, uid AS code
        FROM mBoard_install_req
        WHERE smtitle in('pc','mobile','visit-pc','visit-mobile') UNION
        SELECT '4' AS idx, '¼³Ä¡' AS opt, smname AS company, smdetail AS detail, smoption AS admin, reg_date, state_log, smtitle, proResult AS flag, come_from AS mobile, smtel AS tel, s_email AS email, uid AS code
        FROM mBoard_install_req
        WHERE smtitle NOT in ('pc','mobile','visit-pc','visit-mobile','consult-pc','consult-mobile') UNION
        SELECT '5' AS idx, '±³À°' AS opt, e_company AS company, 'Áýü±³À°½Åû' AS detail, e_person AS admin, reg_date, proc_date AS state_log, '' AS smtitle, e_state AS flag, mobile, e_tel AS tel, '' AS email, uid AS code
        FROM mBoard_education UNION
        SELECT '6' AS idx, '½Å±Ô' AS opt, custname AS company, 'µ¥¸ð¼³Ä¡' AS detail, '°ü¸®ÀÚ' AS admin, flow_date AS reg_date, flow_date AS state_log, flow_path AS smtilte, '7' AS flag, '' AS mobile, telno AS tel, email AS email, idx AS code
        FROM mBoard_file_download_setting
        WHERE 1=1) aa
        WHERE 1 
$where order by reg_date desc limit {$from_record}{$list_num}";
$result      =    mysql_query($sql,$connect_web);

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

$qstr $_SERVER['QUERY_STRING'];

?>
<link rel='stylesheet' type='text/css' href='./css/base_add.css'>
<link rel='stylesheet' type='text/css' href='./css/new.css'>

<style>
.review_side_ul {left: 85px !important;}
.mark_flg, .show_top {width: 25px; height: 25px;}
.memberTable th {line-height:23px;}
.pg_wrap {width: 100% !important;}
.pg_page {background-color: #fff;}
.pg_next, .pg_end {
    width: 40px;
    height: 25px;
    line-height: 25px;
    border: 1px solid #ccc !important;
}
.pg_next:hover, .pg_end:hover { background:#f3f3f3;}
</style>
<div class="container">
    <div class="border_contents">
        <div class="admin_table">
            <h3 class="list_ttl">
                °ßÀû¡¤»ó´ã¡¤¼³Ä¡¡¤±³À°¡¤½Å±Ô ÅëÇÕ¸®½ºÆ®
                <span class="list_sub_ttl bgg">±¸¸Å»ó´ã, °ßÀû¿äû, Áýü±³À°½Åû¿¡ Ç¥½ÃµÇ´Â ¸®½ºÆ®ÀÔ´Ï´Ù.</span>
            </h3>
            <!-- //°Ë»ö¹Ú½º -->
            <form name='customer_search_form' method='get'>
                <div class="searchArea searchAreaPlus" style="height:auto !important;">
                    <span class="searchAreaL"></span>
                    <span class="searchAreaR"></span>
                    <dl class="search_tender requestSearchArea" style="width:718px !important;">
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='st1' class="nonearrow">
                                <option value=''>Àüü ±¸ºÐ</option>
                                <option value='°ßÀû' <?php if($st1=='°ßÀû'){ echo "selected"; }?>>°ßÀû</option>
                                <option value='»ó´ã' <?php if($st1=='»ó´ã'){ echo "selected"; }?>>»ó´ã</option>
                                <option value='¼³Ä¡' <?php if($st1=='¼³Ä¡'){ echo "selected"; }?>>¼³Ä¡</option>
                                <option value='±³À°' <?php if($st1=='±³À°'){ echo "selected"; }?>>±³À°</option>
                                <option value='½Å±Ô' <?php if($st1=='½Å±Ô'){ echo "selected"; }?>>½Å±Ô</option>
                            </select>
                        </dd>
                        <dd class="mr10">
                            <div style="display:inline-block;" class="mr10">
                                <input type='text' name='txtdate' size='7' value='<?=$txtdate;?>' autocomplete="off" id='txtdate' style='width:120px;height:29px;text-align:center;'>
                                <span> ~ </span>
                                <input type='text' name='txtdate2' size='7' value='<?=$txtdate2;?>' autocomplete="off" id='txtdate2' style='width:120px;height:29px;text-align:center;'>
                            </div>
                        </dd>
                        <dd>
                            <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' placeholder="»óÈ£¸í" class="keyword" style="width:143px;height:29px;">
                        </dd>
                        <dd class="searchbtnarea">
                            <a href="#" class="searchBtn bgg" id='search_btn_press'>°Ë»ö</a>
                        </dd>
                    </dl><!--search_tender-->
                </div><!-- //searchArea1-->
            </form>
            <!-- //°Ë»ö¹Ú½º -->

            <div class="pt10 pb10" style="text-align:right;">
                <a class="insertbtn2" style="border:1px solid #169292 !important; color:#169292 !important;" id='sel_delete'>¼±ÅûèÁ¦</a>
            </div>

<script>
    $(function(){
        $( "#txtdate" ).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: '³â'
        });

        $( "#txtdate2" ).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='qatxt_list_form' id='qatxt_list_form' method='post'>
                <input type='hidden' name='sel_del' value=''>
                <table class="memberTable requestarea" style="width: 1200px;margin-left: -100px;">
                    <tr class="bgg">
                        <th style="width:30px;"><input type='checkbox' name='ck_all' class='check_all_class'></th>
                        <th style="width:30px;">¹øÈ£</th>
                        <th style="width:50px;">±¸ºÐ</th>
                        <th style="width:100px;">»óÈ£¸í</th>
                        <th style="width:100px;">ÀüÈ­¹øÈ£</th>
                        <th style="width:100px;">À̸ÞÀÏ</th>
                        <th style="width:350px;">󸮱¸ºÐ</th>
                        <th style="width:70px;">µî·ÏÀϽÃ</th>
                        <th style="width:70px;">´ã´çÀÚ</th>
                        <th style="width:70px;" class="last">ó¸®ÀϽÃ</th>
                    </tr>
                    <?php 
                        $cnt 
$total_count $from_record;
                        for(
$i=0;$i<count($list_array);$i++){ 
                            
$info $list_array[$i];
                            if(
$info['state']=='1'){
                                
$bgcolor " style='background-color:#C8EBFA;' ";
                                
$std2 " selected"$std1 "";
                            } else {
                                
$bgcolor " style='background-color:#FBCFD0;' ";
                                
$std1 " selected"$std2 "";
                            }
                            if(
$i%2==1){ $bgcolor1 "background-color:#f0f0f0;"; } else { $bgcolor1 ";"; }

                            if(
$info['detail'] == "µ¥¸ð¼³Ä¡" && $info['opt'] == "½Å±Ô") {
                                if(
$info['smtitle'] == "õ³â°æ¿µIII 2Á¾" || $info['smtitle'] == "õ³â°æ¿µII 2Á¾") { // 2Á¾ÆäÀÌÁö¿¡¼­ ¼³Ä¡¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."2";
                                } else if(
$info['smtitle'] == "õ³â°æ¿µ3cs »ó¼¼" || $info['smtitle'] == "õ³â°æ¿µ3 »ó¼¼" || $info['smtitle'] == "õ³â°æ¿µ »ó¼¼") { // »ó¼¼ÆäÀÌÁö¿¡¼­ ¼³Ä¡¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."S";
                                } else if(
$info['smtitle'] == "õ³â3CS Á¦Á¶") { // Á¦Á¶ÆäÀÌÁö¿¡¼­ ¼³Ä¡¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."J";
                                } else if(
$info['smtitle'] == "õ³â°æ¿µIII cs" || $info['smtitle'] == "õ³â°æ¿µcs") { // Ãµ³â°æ¿µ3cs µ¥¸ðÆäÀÌÁö¿¡¼­ ¼³Ä¡¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."H";
                                } else if(
$info['smtitle'] == "õ³â°æ¿µIII ¸ÞÀιè³Ê") { // ¸ÞÀιè³Ê¿¡¼­ ¼³Ä¡¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."D";
                                } else if(
$info['smtitle'] == "Á¤Ç° ¾÷µ¥ÀÌÆ®/3cs") { // Á¤Ç°´Ù¿î·Îµå¿¡¼­ Ãµ³â°æ¿µ3cs¸¦ ¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."U";
                                } else if(
$info['smtitle'] == "Á¤Ç° ¾÷µ¥ÀÌÆ®") { // Á¤Ç°´Ù¿î·Îµå¿¡¼­ ±× ¿Ü¸¦ ¹ÞÀ¸¸é
                                    
$info['opt'] = $info['opt']."K";
                                } else {
                                    
$info['opt'] = $info['opt']."S";
                                }
                            } else if(
$info['opt'] == "¼³Ä¡") {
                                
$info['opt'] = $info['opt']."Y";
                            }

                            
$detail $info['detail'];

                            if(
$info['flag']=='0' || $info['flag']=='½Åû' || $info['flag']==''){
                                
$info['detail'] = "<span style='color:blue'>[¿äûÁ¢¼ö]</span>";
                            } else {
                                
$info['detail'] = "[󸮿Ϸá]";
                            }
                            if(
substr($detail,0,1)=='*'){
                                if(
$info['mobile']=='mobile' || strpos("(m)",$info['mobile'])>0){
                                    
$info['opt'] = "+".$info['opt'];
                                } else {
                                    
$info['opt'] = "*".$info['opt'];
                                }
                            }
                            
$pos strpos($detail"(M)");
                            if(
$pos !== false){ //¸ÞÀϷΠµé¾î¿Í¼­ ÀÛ¼ºÇÑ °æ¿ì
                                
$info['opt'] = "M".$info['opt'];
                            }
                            if(
$info['admin'] == "¹ÌÁöÁ¤") { $info['admin'] = "°ü¸®ÀÚ"; }

                            if(
$info['company'] == "¿¥Á¦À̼ÒÇÁÆ®" || strpos($info['company'], "¿¥Á¦ÀÌ") !== false || strpos($info['company'], "Å×½ºÆ®") !== false) {
                                
$info['company'] = "½Å±Ô»ç¿ëÀÚ";
                            }

                    
?>
                    <tr style='<?php echo $bgcolor1;?> height:120px;'>
                        <td class="lh30">
                            <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'>
                            <input type='hidden' name='idxs[]' value='<?php echo $info['idx'];?>'>
                            <input type='hidden' name='codes[]' value='<?php echo $info['code']; ?>'>
                        </td>
                        <td class="family lh30"><?php echo $cnt;?></td>
                        <td class="lh30"><?php echo $info['opt'];?></td>
                        <td class="lh30"><?php echo $info['company'];?></td>
                        <td class="lh30"><?php echo $info['tel'];?></td>
                        <td class="lh30"><?php echo $info['email'];?></td>
                        <td class="lh30"><?php echo $detail;?></td>
                        <td class="lh30"><?php echo date("Y-m-d (H:i)",strtotime($info['reg_date'])); ?></td>
                        <td class="lh30"><?php echo $info['admin']; ?></td>
                        <td class="lh30"><?php echo date("Y-m-d (H:i)",strtotime($info['state_log'])); ?></td>
                    </tr>
                    <?php 
                            $cnt
--;
                        } 
                    
?>
                </table><!-- //memberTable -->
            </form>
            <br>
            <div class='pg_wrap' style='padding-top:0px;'>
                <?php echo get_paging($list_num$page$total_page"?$qstr");?>
            </div>
        </div><!-- //admin_table -->

        <p class="navi">°ü¸®ÀÚ¸ðµå > ¼­ºñ½º°Ô½ÃÆÇ > »ó´ãÈıâ</p>

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

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

<script>
var qstr = '<?php echo $qstr;?>';
$(function(){

    $(".check_all_class").click(function(){ // Àüü¼±ÅàÀüü¼±ÅÃ ÇØÁ¦
        if($(this).is(":checked")){
            $("input[name='code_idx[]']").prop("checked",true);
        } else {
            $("input[name='code_idx[]']").prop("checked",false);            
        }
    });

    $("#search_btn_press").click(function(){ // °Ë»ö¹öư
        $form_obj = $(this).closest("form");
        $form_obj.submit();
    });

    $("#stx").keypress(function(){ // °Ë»ö¿¡¼­ ¿£ÅͽÃ
        if(event.keyCode==13){
            $form_obj = $(this).closest("form");
            $form_obj.submit();
        }
    });

    $("#sel_delete").click(function(){ // ¼±ÅûèÁ¦
        var ck_cnt = 0;
        var v = $("input[name='code_idx[]']").each(function(){
            if($(this).is(":checked")){ ck_cnt++; }
        });
        if(ck_cnt==0){ alert('»èÁ¦ÇϽǠ°Ô½Ã¹°À» ¼±ÅÃÇϼ¼¿ä.'); return; }
        if(confirm('Á¤¸»·Î ¼±ÅÃÇϽŠ'+ck_cnt+'°³ÀÇ °Ô½Ã¹°À» »èÁ¦ÇϽðڽÀ´Ï±î?')){
            $("input[name='sel_del']").val("Y");
            var form_data = $("form[name='qatxt_list_form']").serialize();
            $("#qatxt_list_form").prop("action","m_totallist_process.php");
            $("#qatxt_list_form").submit();

        }
    });
});

function form_save(){ // ÀúÀå/¼öÁ¤ ¹öư
    if(confirm('ÀúÀåÇϽðڽÀ´Ï±î?')){
        $("#qatxt_reg_form input[name='qstr']").val('<?php echo $qstr;?>');
        $("#qatxt_reg_form input[name='qatxt_reg']").val('Y');
        $("#qatxt_reg_form").submit();
    }
}
</script>

</body>
</html>
<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>