/home/mjc1/public_html/manage/m_menual.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
 <?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");

$sql  =   "select count(*) as cnt from mBoard_menual 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 a.idx, a.cidx_1, a.cidx_2, a.cidx_3, b.name AS cname_1, c.name AS cname_2, d.name AS cname_3, a.title
        FROM mBoard_menual AS a
        INNER JOIN mBoard_menual_cate1 AS b ON a.cidx_1 = b.idx
        INNER JOIN mBoard_menual_cate2 AS c ON a.cidx_2 = c.idx
        LEFT JOIN mBoard_menual_cate3 AS d ON a.cidx_3 = d.idx 
        WHERE 1=1 
{$where} 
        ORDER BY idx 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 bgb">õ³â3CS¿¡¼­ »ç¿ëÇϴ ¸Å´º¾óÀ» °ü¸®Çϴ ÆäÀÌÁöÀÔ´Ï´Ù.</span>
            </h3>

            <form name='menual_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.title' <?php if($sti=='a.title'){?>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 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;">
                    <a class="insertbtn2" style="background-color:#2457BD;" id='btn_cate_new'>Ä«Å×°í¸®µî·Ï</a>
                    <a class="insertbtn2" style="background-color:#001A7F;" id='btn_menual_new'>½Å±Ôµî·Ï</a>
                    <a class="insertbtn2" style="border:1px solid #001A7F !important; color:#001A7F !important;" id='sel_delete'>¼±ÅûèÁ¦</a>
                </div>
            </form>

            <form name='menual_list_form' id='menual_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:60px;">
                            <col style="width:60px;">
                            <col style="width:60px;">
                            <col style="width:370px;">
                        </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>
        <?php 
            
for($i=0;$i<count($list_array);$i++){ 
                
$info $list_array[$i];

                if(
$info['hidden'] == "1") { $hidden "¼û±è"; } else { $hidden "°ø°³"; }
        
?>
                            <tr>
                                <td class="tcenter">
                                    <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'>
                                    <input type='hidden' name='idxs[]' value='<?php echo $info['idx'];?>'>
                                </td>
                                <td class="tcenter click_edit"><?php echo $info['idx'];?></td>
                                <td class="tcenter click_edit"><?php echo $info['cname_1'];?></td>
                                <td class="tcenter click_edit"><?php echo $info['cname_2'];?></td>
                                <td class="tcenter click_edit"><?php echo $info['cname_3'];?></td>
                                <td class="linetxt click_edit"><?php echo $info['title'];?></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 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();
    });

    $("#btn_menual_new").click(function(){ // ½Å±Ôµî·Ï
        document.location.href = "./m_menual_reg.php";
    });

    $("#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+'°³ÀÇ °Ô½Ã¹°À» »èÁ¦ÇϽðڽÀ´Ï±î?\nÇØ´ç °Ô½Ã¹°¿¡ Æ÷ÇԵȠFAQµµ ÇÔ²² »èÁ¦µË´Ï´Ù.')){
            $("input[name='sel_del']").val("Y");
            var form_data = $("form[name='menual_list_form']").serialize();
            
            $.ajax({type:"post", url:"m_menual_process.php", data:form_data, async:false, dataType : "xml", 
                success:function(xml){
                    var v_mode = $(xml).find("mode").text();
                    var v_mode_ok = $(xml).find("mode_ok").text();
                    var v_msg = $(xml).find("msg").text();
                    if(v_mode_ok!='Y'){
                        alert(v_msg);
                    }else {
                        alert("»èÁ¦Çß½À´Ï´Ù.");
                        document.location.reload();
                    }
                },
                error:function(rtn,status,error){    alert("Error : "+error);    }
            });
        }
    });

    $(".click_edit").click(function(){ // ¼öÁ¤Çϱâ
        var val = $(this).closest("tr").find("input[name='idxs[]']").val();
        document.location.href = "./m_menual_reg.php?idx="+val;
    });

    $("#btn_cate_new").click(function(){ // Ä«Å×°í¸® µî·Ï
        $.get("m_menual_cate_reg.php",function(rtn){
            $("#modal_member_box").html(rtn).dialog({
                resizable: true, height:600, width:740, modal: true, title: "Ä«Å×°í¸® µî·Ï¡¤¼öÁ¤",
                buttons: {
                    ÀúÀå: function() {
                        if(confirm('ÀúÀåÇϽðڽÀ´Ï±î?')){
                            var form_data = $("form[name='cate_form']").serialize();

                            $.ajax({type:"post", url:"m_menual_process.php", data:form_data, async:false, dataType : "xml", 
                                success:function(xml){
                                    var v_mode = $(xml).find("mode").text();
                                    var v_mode_ok = $(xml).find("mode_ok").text();
                                    var v_msg = $(xml).find("msg").text();
                                    if(v_mode_ok!='Y'){
                                        alert(v_msg);
                                    }else {
                                        alert("ÀúÀåÇß½À´Ï´Ù.");
                                    }
                                },
                                error:function(rtn,status,error){    alert("Error : "+error);    }
                            });
                            $( this ).dialog( "close" );
                        }
                    },
                    ´Ý±â: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });
});
</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>