/home/mjc1/public_html/manage/m_n_kin.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
 <?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" || $_SESSION['ADMINID'] == "hjh")){ 
} else {
    echo 
"
        <script>
            alert('Á¢±ÙÇÒ ¼ö Àִ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.');
            history.go(-1);
        </script>"
;
}

$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;
}

$table "mBoard_naver_kin";
$order_key "idx DESC";
$where "";

if(
$stx!=''){
    
$where .= " and {$sti} like '%{$stx}%' ";
}

$sql  =   "select count(*) as cnt from {$table} a WHERE 1=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 {$table} a WHERE 1=1 {$where} order by {$order_key} 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'>

<?php include('./include/board_side_bar.php'); ?>
<script>
$(function(){
    $(".review_side_li:nth-child(6) a").addClass("active");
});
</script>
<style>
.mark_flg {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 bgb">³×À̹ö Áö½ÄÀÎÀÇ Áú´ä °Ô½ÃÆÇÀÔ´Ï´Ù.</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:364px !important;">
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='sti' class="nonearrow">
                                <option value='created_id' <?php if($sti=='created_id'){?>selected<?php }?>>µî·ÏÀÚ(ID)</option>
                                <option value='reply_id' <?php if($sti=='reply_id'){?>selected<?php }?>>´äº¯ÀÚ(ID)</option>
                            </select>
                        </dd>
                        <dd>
                            <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="keyword" style="width:143px;height:29px;">
                        </dd>
                        <dd class="searchbtnarea">
                            <a href="#" class="searchBtn bgb" id='search_btn_press'>°Ë»ö</a>
                        </dd>
                    </dl><!--search_tender-->
                </div><!-- //searchArea1-->
            </form>
            <!-- //°Ë»ö¹Ú½º -->

            <div class="pt10 pb10" style="text-align:right;">
                <a class="nkinWrite"><span class="insertbtn2 bgb">±Ûµî·Ï</span></a>
                <a class="insertbtn2" style="border:1px solid #001A7F !important; color:#001A7F !important;" id='sel_delete'>¼±ÅûèÁ¦</a>
            </div>

            <form name='n_kin_list_form' id='n_kin_list_form' method='post'>
                <input type='hidden' name='sel_del' value=''>
                <table class="memberTable requestarea">
                    <tr class="bgb">
                        <th style="width:30px;"><input type='checkbox' name='ck_all' class='check_all_class'></th>
                        <th style="width:50px;">±Û¹øÈ£</th>
                        <th style="width:100px;">µî·ÏÀÏÀÚ</th>
                        <th style="width:100px;">µî·ÏÀÚ(ID)</th>
                        <th style="width:100px;">´äº¯ÀÚ(ID)</th>
                        <th style="width:290px;">ÁÖ¼Ò</th>
                        <th style="width:130px;">¸µÅ©<br/>¹Ù·Î°¡±â</th>
                        <th style="width:50px;" class="last">»çÀå´Ô<br/>È®ÀÎ</th>
                    </tr>
                    <?php
                        $a 
0;
                        for(
$i=0;$i<count($list_array);$i++){ 
                            
$info $list_array[$i];
                            
                    
?>
                    <tr>
                        <td class="lh30">
                            <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'>
                            <input type='hidden' name='codes[]' value='<?php echo $info['idx'];?>'>
                        </td>
                        <td class="family lh30 click_edit"><?php echo count($list_array)-$a;?></td>
                        <td class="lh30 click_edit"><?php echo $info['created_date'];?></td>
                        <td class="lh30 click_edit"><?php echo $info['created_id'];?></td>
                        <td class="lh30 click_edit"><?php echo $info['reply_id'];?></td>
                        <td class="lh30 click_edit">
                            <?php 
                                $addr_dot 
mb_strimwidth($info['addr'],0,60,"...");
                                echo 
$addr_dot;
                            
?>
                        </td>
                        <td class="lh30"><a href='<?php echo $info['link'];?>' target="blank">[¸µÅ© ¹Ù·Î°¡±â]</a></td>
                        <td class="lh30 last">
                            <input type='checkbox' class='check_val' name='check_val' style="width: 20px;height: 20px;position: relative;top: 3px;" <?php if($info['check_val']=='1'){ echo "checked"; }?>>
                        </td>
                    </tr>
                    <?php 
                        $a
++;
                        } 
                    
?>
                </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(){

    $(".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();
    });

    $(".click_edit").css("cursor","pointer").click(function(){ // ³×À̹ö Áö½ÄÀΠÁú´ä ¼öÁ¤
        var code = $(this).closest("tr").find("input[name='codes[]']").val();
        $.get("m_n_kin_reg.php?code="+code,function(rtn){
            $("#modal_member_box").html(rtn).dialog({
                resizable: true, width:740, modal: true, title: "³×À̹öÁö½ÄÀΠÁú´ä ¼öÁ¤",
                buttons: {
                    ÀúÀå: function() {
                        $("#n_kin_reg_form input[name='n_kin_val']").val('upt');
                        form_save();
                    },
                    ´Ý±â: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });

    $(".nkinWrite").click(function(){
        $.get("m_n_kin_reg.php",function(rtn){
            $("#modal_member_box").html(rtn).dialog({
                resizable: true, width:740, modal: true, title: "³×À̹öÁö½ÄÀΠÁú´ä µî·Ï",
                buttons: {
                    ÀúÀå: function() {
                        $("#n_kin_reg_form input[name='n_kin_val']").val('reg');
                        form_save();
                    },
                    ´Ý±â: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });

    $("#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='n_kin_list_form']").serialize();
            $.post("m_n_kin_process.php",form_data,function(rtn){
                if(rtn=="OK"){
                    document.location.reload();
                } else {
                    alert(rtn);
                }
            });

        }
    });

    $(".check_val").change(function(){ // Ã¼Å©¹Ú½º º¯°æ½Ã ÀÚµ¿ ¾÷µ¥ÀÌÆ®
        var check_val = 0;
        var v = $(this).closest("tr").find("input[name='codes[]']").val();
        if($(this).is(":checked")){
            check_val = 1;
        }
        
        var form_data = "n_kin_val=check_upt&idx="+v+"&check_val="+check_val;
        $.post("m_n_kin_process.php",form_data,function(rtn){
            if(rtn=="OK"){
                document.location.reload();
            } else {
                alert(rtn);
            }
        });
    });
});

function form_save(){ // ÀúÀå/¼öÁ¤ ¹öư
    if(confirm('ÀúÀåÇϽðڽÀ´Ï±î?')){
        $("#n_kin_reg_form input[name='qstr']").val('<?php echo $qstr;?>');
        var form_data = $("form[name='n_kin_reg_form']").serialize();

        $.post("m_n_kin_process.php",form_data,function(rtn){
            if(rtn=="OK"){
                document.location.reload();
            } else {
                alert(rtn);
            }
        });
    }
}
</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>