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

$admin_info admin_member_info();
if(
$admin_info['psn_auth']=='0' || substr($admin_info['psn_rwed'],0,1)=='0'){
    echo 
"<script>alert('ÇØ´ç Á¢±Ù±ÇÇÑÀÌ ¾ø½À´Ï´Ù.');window.history.go(-1);</script>"; exit;
}
auth_access_log("LIST");

$table "mBoard_etc_store";
$order_key "uid 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'>
<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 bgb">±âŸÀÚ·á ÆäÀÌÁöÀÔ´Ï´Ù.</span>
            </h3>

            <form name='customer_search_form' method='get'>
                <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'>

                <div class="searchArea searchAreaPlus">
                    <span class="searchAreaL"></span>
                    <span class="searchAreaR"></span>
                    <dl class="search_tender requestSearchArea" style="width: 400px;">
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='sti' class="nonearrow">
                                <option value='a.subject' <?php if($sti=='a.subject'){?>selected<?php }?>>Á¦¸ñ</option>
                                <option value='a.content' <?php if($sti=='a.content'){?>selected<?php }?>>³»¿ë</option>
                            </select>
                        </dd>
                        <dd>
                            <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="stx_class" 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-->

                <div class="btn1Warp mb5" style="text-align: right; display: inline-block; width: 990px;">
                    <!--<select name='order_key' class='order_key_class'>
                        <option value='comp_name' <?php if($order_key=='comp_name'){?>selected<?php }?>>»óÈ£¸í¼ø</option>
                        <option value='code1' <?php if($order_key=='code1'){?>selected<?php }?>>ÄÚµå¼ø</option>
                    </select>-->
                    <a class="insertbtn2" style="background-color:#001A7F;" id='btn_etc_new'>½Å±Ôµî·Ï</a>
                    <!--<a class="blue-btn">ÁÖ¹®º¹»ç</a><?php if($Orow['ordstate']==0){ ?><a class="black-btn">Àüü»èÁ¦</a><?php }?><a class="gray-btn" id='buy_print'>Àμâ</a><a class="gray-btn" id='xls_down'>¿¢¼¿</a>-->
                    <a class="insertbtn2" style="border:1px solid #001A7F !important; color:#001A7F !important;" id='sel_delete'>¼±ÅûèÁ¦</a>
                </div>
            </form>

            <!--<div class="item_tab">
                <div class="item_tab_navi">
                    <a value='0'><span>¸ÅÀÔó °ü¸®</span></a>
                    <a value='1' class="on"><span>¸ÅÃâó °ü¸®</span></a>
                </div>
            </div>--><!--//item_tab-->


            <form name='etc_list_form' id='etc_list_form' method='post'>
                <input type='hidden' name='sel_del' value=''>
                <div class="borderWarp" style="margin:0 0 40px; border-bottom:0 none;">
                    <table class="borderTable requestarea">
                        <colgroup>
                            <col style="width:30px;">
                            <col style="width:60px;"><col style="width:370px;"><col style="width:80px;">
                            <col style="width:100px;"><col style="width:60px;">
                        </colgroup>

                        <thead>
                            <tr class="bgb">
                                <th scope="col"><input type='checkbox' name='ck_all' class='check_all_class'></th>
                                <th scope="col">±Û¹øÈ£</th><th scope="col">Á¦¸ñ</th>    <th scope="col">Á¶È¸¼ö</th>
                                <th scope="col">µî·ÏÀÏ</th><th scope="col">¼û±è</th>
                            </tr>
                        </thead>
                        <tbody>
        <?php 
            
for($i=0;$i<count($list_array);$i++){ 
                
$info $list_array[$i];
        
?>
                            <tr>
                                <td class="tcenter ">
                                    <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'>
                                    <input type='hidden' name='codes[]' value='<?php echo $info['uid'];?>'>
                                </td>
                                <td class="tcenter "><?php echo $info['uid'];?></td>
                                <td class="linetxt click_edit"><?php echo $info['subject'];?></td>
                                <td class="tcenter "><?php echo $info['hit'];?></td>
                                <td class="tcenter "><?php echo date("Y-m-d",$info['reg_date']);?></td>
                                <td class="tcenter "><?php if($info['temp']=='Y'){ echo "Y"; } else { echo ""; }?></td>
                            </tr>
        <?php 
            

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

            <div class='pg_wrap' style='padding-top:0px;'>
                <?php echo get_paging($list_num$page$total_page"?$qstr");?>
            </div>

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

        <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_etc_reg.php?code="+code,function(rtn){
            $("#modal_member_box").html(rtn).dialog({
                resizable: true, height:630, width:740, modal: true, title: "±âŸÀÚ·á [¼öÁ¤]",
                buttons: {
                    ÀúÀå: function() {
                        form_save();
                    },
                    ´Ý±â: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });

    $("#btn_etc_new").click(function(){ // ½Å±Ôµî·Ï
        $.get("m_etc_reg.php",function(rtn){
            $("#modal_member_box").html(rtn).dialog({
                resizable: true, height:630, width:740, modal: true, title: "±âŸÀÚ·á [½Å±Ô]",
                buttons: {
                    ÀúÀå: function() {
                        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='etc_list_form']").serialize();
            $("#etc_list_form").prop("action","m_etc_process.php");
            $("#etc_list_form").submit();

        }

    });

});

function form_save(){ // ÀúÀå/¼öÁ¤ ¹öư
    if($("#etc_reg_form input[name='subject']").val()==''){
        alert('Á¦¸ñÀ» ÀÔ·ÂÇϼ¼¿ä.'); return;
    }
    if($("#etc_reg_form input[name='content']").val()==''){
        alert('³»¿ëÀ» ÀÔ·ÂÇϼ¼¿ä.'); return;
    }
    if(confirm('ÀúÀåÇϽðڽÀ´Ï±î?')){
        $("#etc_reg_form input[name='qstr']").val('<?php echo $qstr;?>');
        $("#etc_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>