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

$sql "select admin_name from admin where (admin_team like '°í°´Áö¿ø%' or admin_team like '¿µ¾÷%') order by admin_name";
$result mysql_query($sql,$connect_web);

while(
$emp_info=mysql_fetch_array($result)){
    
$emp_array[] = $emp_info;
}

$where1 "";
$where2 "";
$where3 "";

if(
$stx!=''){
    
$where1 .= " and smcompany like '%{$stx}%' ";
    
$where2 .= " and company like '%{$stx}%' ";
}
if(
$st1!=''){
    
$where3 .= " and a.kubun = '{$st1}' ";
}
/*
if($st2!=''){
    $where .= " and gift = '{$st2}' ";
}
if($st3!=''){
    $where .= " and del_result = '{$st3}' ";
}
if($st4!=''){
    $where .= " and del_met = '{$st4}' ";
}
*/
$sql "SELECT SUM(cnt) AS cnt
        FROM (SELECT 0 AS kubun, COUNT(uid) AS cnt
        FROM mBoard_cus_after
        WHERE 1=1 
{$where1} UNION ALL
        SELECT 1 AS kubun, COUNT(uid) AS cnt
        FROM event_review
        WHERE 1=1 
{$where2} ) AS a
        WHERE 1=1 
{$where3}";

$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 a.kubun, a.uid, a.company, a.reg_date
        FROM (SELECT 0 AS kubun, uid, smcompany AS company, reg_date
        FROM mBoard_cus_after
        WHERE 1=1 
{$where1} UNION ALL
        SELECT 1 AS kubun, uid, company, reg_date
        FROM event_review
        WHERE 1=1 
{$where2} ) AS a
        WHERE 1=1 
{$where3}
        ORDER BY a.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>
.memberTable td select {width: 100px; height: 24px;}
.review_side_ul {left: 85px !important;}
.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'>
                <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'>
                <div class="searchArea searchAreaPlus" style="height:auto !important;">
                    <span class="searchAreaL"></span>
                    <span class="searchAreaR"></span>
                    <dl class="search_tender requestSearchArea" style="width:520px !important;">
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='st1' class="nonearrow">
                                <option value=''>Àüü ÈıâÁ¾·ù</option>
                                <option value='0' <?php if($st1=='0'){ echo "selected"; }?>>»ó´ãÈıâ</option>
                                <option value='1' <?php if($st1=='1'){ echo "selected"; }?>>ÈıâÀ̺¥Æ®</option>
                            </select>
                        </dd>
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='sti' class="nonearrow">
                                <option value='company' <?php if($sti=='company'){?>selected<?php }?>>»óÈ£¸í/ȸ»ç¸í</option>
                            </select>
                        </dd>
                        <dd>
                            <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="stx_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>

            <form name='del_list_form' id='del_list_form' method='post' action>
                <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:100px;">Á¤º¸Á¾·ù</th>
                        <th style="width:100px;">µî·ÏÀÏÀÚ</th>
                        <th style="width:100px;">»óÈ£¸í(¼º¸í) /<br>ȸ»ç¸í</th>
                        <th style="width:100px;">ID</th>
                        <th style="width:100px;">Áö¿ª</th>
                        <th style="width:100px;">»çÀºÇ°</th>
                        <th style="width:100px;">¹è¼Û°á°ú</th>
                        <th style="width:100px;">¹è¼Û¹æ½Ä</th>
                        <th style="width:100px;">ÀúÀåÇϱâ</th>
                    </tr>
                    <?php 

                        
for($i=0;$i<count($list_array);$i++){ 
                            
$info $list_array[$i];
                        
                            
//delBoardÅ×ÀÌºí¿¡ µ¥ÀÌÅͰ¡ Àִ°¡ ¾ø´Â°¡¸¦ È®ÀÎ
                            
$del_sql "SELECT * FROM delBoard WHERE info = {$info['kubun']} AND info_uid = {$info['uid']}";
                            
$del_res mysql_query($del_sql,$connect_web);
                            
$del_row mysql_fetch_array($del_res);
                            
$del_uid $del_row['uid'];

                            if(
$del_row['del_result']=='1'){
                                
$bgcolor " style='background-color:#C8EBFA;' ";
                                
$del_sts2 " selected"$del_sts1 "";
                            } else {
                                
$bgcolor " style='background-color:#FBCFD0;' ";
                                
$del_sts1 " selected"$del_sts2 "";
                            }

                            if(
$del_row['del_met']=='1'){$met_sts2 " selected"$met_sts1 "";} else {$met_sts1 " selected"$met_sts2 "";}
                            if(
$i%2==1){$bgcolor1 "background-color:#f0f0f0;";} else {$bgcolor1 ";";}
                    
?>
                    <tr style='<?php echo $bgcolor1;?>'>
                        <input type='hidden' name='codes[]' value='<?php echo $info['uid'];?>'>
                        <!--
                        <td class="tcenter " style='height:60px;'>
                            <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'>
                            <input type='hidden' name='codes[]' value='<?php echo $info['uid'];?>'>
                        </td>
                        -->
                        <td class="linetxt">
                            <?php
                                
//±¸ºÐÀÌ 0À̸頻ó´ãÈı⠸®½ºÆ®, ±¸ºÐÀÌ 1À̸é Èıâ À̺¥Æ®
                                
if ($info['kubun'] == 0) {
                                    echo 
"»ó´ãÈıâ";
                                } else if(
$info['kubun'] == 1) {
                                    echo 
"Èıâ À̺¥Æ®";
                                }
                            
?>
                            <input type='hidden' name='kubun' value='<?php echo $info['kubun'];?>'>
                        </td>
                        <td class="linetxt"><?php echo $info['reg_date'];?>
                        <input type='hidden' name='reg_date' value='<?php echo $info['reg_date'];?>'>
                        <td class="linetxt"><?php echo $info['company'];?>
                        <input type='hidden' name='company' value='<?php echo $info['company'];?>'>
                        <td class="tcenter">
                        <input type="text" name='user_id' id='user_id' value='<?php echo $del_row['user_id'];?>'></td>
                        <td class="tcenter"><input type="text" name="user_area" id="user_area" value='<?php echo $del_row['user_area']?>'/>
                        <td class="tcenter">
                            <select name='gift' id='gift<?php echo $i;?>'?>'>
                                <option value='0' <?php if($del_row['gift']=='0') { echo "selected"; }?>>»óǰ±Ç5¸¸¿ø</option>
                                <option value='1' <?php if($del_row['gift']=='1') { echo "selected"; }?>>À½·á2ÀÜ</option>
                                <option value='2' <?php if($del_row['gift']=='2') { echo "selected"; }?>>Ä¿ÇÇÄíÆù</option>
                                <option value='3' <?php if($del_row['gift']=='3') { echo "selected"; }?>>»óǰ±Ç3¸¸¿ø</option>
                            </select>
                        </td>
                        <td class="tcenter">
                            <select name='del_result' id='del_result<?php echo $i;?><?php echo $bgcolor;?> >
                                <option value='0' <?php echo $del_sts1;?>>¹Ì¹ß¼Û</option>
                                <option value='1' <?php echo $del_sts2;?>>¹ß¼Û¿Ï·á</option>
                            </select>
                        </td>
                        <td class="tcenter">
                            <select name='del_met' id='del_met<?php echo $i;?>'>
                                <option value='0' <?php echo $met_sts1;?>>¿ìü±¹</option>
                                <option value='1' <?php echo $met_sts2;?>>īī¿ÀÅå</option>
                            </select>
                        </td>
                        <td class="tcenter last">
                        <div class="sub-btn-area delbtncenter">
                            <div class="sub-btn list-btn">
                                <?php if($del_uid == '') { ?>
                                    <a href="#" class="black-btn" id="add_btn_press">µî·ÏÇϱâ</a>
                                <?php } else { ?>
                                    <a href="#" class="black-btn" id="upt_btn_press">¼öÁ¤Çϱâ</a>
                                <?php ?>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <?php ?>
                </table><!-- //memberTable -->
            </form>

            <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(){
    
    var index;

    $(".sub-btn-area #add_btn_press").click(function(){
        var index = $(".sub-btn-area .list-btn .black-btn").index(this);
        var txtgift = "gift"+index;
        var txtdel_result = "del_result"+index;
        var txtdel_met = "del_met"+index;
        setsave("qstr",qstr,1);
        if(confirm('ÇØ´ç ¹è¼Û³»¿ëÀ» ÀúÀåÇϽðڽÀ´Ï±î?')){
            $uid = $(this).closest("tr").find("input[name='codes[]']").val();
            $info = $(this).closest("tr").find("input[name='kubun']").val();
            $reg_date = $(this).closest("tr").find("input[name='reg_date']").val();
            $company = $(this).closest("tr").find("input[name='company']").val();
            $user_id = $(this).closest("tr").find("input[name='user_id']").val();
            $user_area = $(this).closest("tr").find("input[name='user_area']").val();
            $gift = document.getElementById(txtgift).options[document.getElementById(txtgift).selectedIndex].value;
            $del_result = document.getElementById(txtdel_result).options[document.getElementById(txtdel_result).selectedIndex].value;
            $del_met = document.getElementById(txtdel_met).options[document.getElementById(txtdel_met).selectedIndex].value;
        
            document.del_list_form.action = "delBoardProcess.php?mode=add&uid="+$uid+"&user_id="+$user_id+"&user_area="+$user_area+
            "&company="+$company+"&reg_date="+$reg_date+"&flag="+$info+$gift+$del_result+$del_met;
            document.del_list_form.submit();
        }
    });

    $(".sub-btn-area #upt_btn_press").click(function(){
        var index = $(".sub-btn-area .list-btn .black-btn").index(this);
        var txtgift = "gift"+index;
        var txtdel_result = "del_result"+index;
        var txtdel_met = "del_met"+index;
        setsave("qstr",qstr,1);
        if(confirm('ÇØ´ç ¹è¼Û³»¿ëÀ» ¼öÁ¤ÇϽðڽÀ´Ï±î?')){
            $uid = $(this).closest("tr").find("input[name='codes[]']").val();
            $info = $(this).closest("tr").find("input[name='kubun']").val();
            $reg_date = $(this).closest("tr").find("input[name='reg_date']").val();
            $company = $(this).closest("tr").find("input[name='company']").val();
            $user_id = $(this).closest("tr").find("input[name='user_id']").val();
            $user_area = $(this).closest("tr").find("input[name='user_area']").val();
            $gift = document.getElementById(txtgift).options[document.getElementById(txtgift).selectedIndex].value;
            $del_result = document.getElementById(txtdel_result).options[document.getElementById(txtdel_result).selectedIndex].value;
            $del_met = document.getElementById(txtdel_met).options[document.getElementById(txtdel_met).selectedIndex].value;
        
            document.del_list_form.action = "delBoardProcess.php?mode=upd&uid="+$uid+"&user_id="+$user_id+"&user_area="+$user_area+
            "&company="+$company+"&reg_date="+$reg_date+"&flag="+$info+$gift+$del_result+$del_met;
            document.del_list_form.submit(); 
        }
    });

    $(".item_tab_navi a").click(function(){ //³×ºñ°ÔÀ̼ǠÅǠó¸®
        v = $(this).attr("value");
        vv = qstr_rmv(qstr,"biztype");
        document.location.href="?"+vv+"&biztype="+v;
    });

    $(".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();
    });
    
    /*
    $("#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_cusafter_process.php");
            $("#qatxt_list_form").submit();

        }

    });*/

});

function setsave(name, value, expiredays){
    value = encodeURI(value); // Çѱ۱úÁü¹®Á¦ Ã³¸®
    var today = new Date();
    today.setDate( today.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";"
}
</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>