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

// DBÁ¢¼Ó
$DB_HOST  =  "114.108.136.196";
$DB_USER  =  "mj_inhouse_web";
$DB_PWD   =  "m897461z";
$DB_NAME  =  "mj_inhouse";

$connect_web    = @mysql_connect($DB_HOST,$DB_USER,$DB_PWD);
@
mysql_select_db$DB_NAME,$connect_web);

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

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

/*$total_cnt = "
SELECT COUNT(*) AS sumqnt
FROM (
SELECT t.*
FROM jangbu_tellist AS t
WHERE t.sdate BETWEEN '{$txtdate}' AND '{$txtdate2}' AND t.cust_req <> '' $where) AS t
LEFT JOIN jangbu_tellist_confirm AS c ON t.seq = c.seq";*/

$total_cnt "SELECT COUNT(*) AS sumqnt
FROM issues AS a
WHERE a.rgst_dttm BETWEEN '
{$txtdate}' AND '{$txtdate2}' AND ((a.agree_st in (2, 3)) OR (a.agree_st = 1 AND a.work_status IN (2, 3))) $where
ORDER BY idx DESC"
;

$total_res mysql_query($total_cnt,$connect_web);
$total_row mysql_fetch_array($total_res);
$total_count $total_row['sumqnt'];

$cm_nCount 10;
$cm_item_nCount 30;          

function 
pageListing($cur_page$total_page$n$url) {

    
$retValue "<div class='paging'>";
    if (
$cur_page 1) {

        
$retValue .= "<a href='" $url . ($cur_page-1) ."' class='page'><span class='next'>ÀÌÀü</span></a>";
    } else {
        
$retValue .= "";
        
$retValue .= "";
    }

    
$retValue .= "";

    
$start_page = ( ( (int)( ($cur_page ) / 10 ) ) * 10 ) + 1;

    
$end_page $start_page 9;
    if (
$end_page >= $total_page$end_page $total_page;
        if (
$start_page 1$retValue .= "<a href='" $url . ($start_page-1) . "' class='page'><span class='next10'>ÀÌÀü 10°³</span></a>";

            if (
$total_page 1)
                for (
$k=$start_page;$k<=$end_page;$k++)
            if (
$cur_page != $k$retValue .= "<a href='$url$k'>$k</a>";
                else 
$retValue .= "<a href='$url$k' class='on'>$k</a>";

    if (
$total_page $end_page$retValue .= "<a href='" $url . ($end_page+1) . "' class='page'><span class='pro10'>´ÙÀ½ 10°³</span></a>";

    
$retValue .= "";

    if (
$cur_page $total_page) {
        
$retValue .= "<a href='$url. ($cur_page+1) ."' class='page'><span class='pro'>´ÙÀ½</span></a>";

    } else {
        
$retValue .= "";
        
$retValue .= "";
    }

    
$retValue .= "</div>";
    return 
$retValue;
}

$nPage ceil($total_count $cm_nCount);
if (
$pg == ""$pg 1;
$nFrom = ($pg 1) * $cm_nCount;

// Àüü ¸®½ºÆ®
/*$sql = "
SELECT t.*, c.ceo_confirm
FROM (
SELECT t.*
FROM jangbu_tellist AS t
WHERE t.sdate BETWEEN '{$txtdate}' AND '{$txtdate2}' AND t.cust_req <> '' $where) AS t
LEFT JOIN jangbu_tellist_confirm AS c ON t.seq = c.seq
ORDER BY t.seq DESC
LIMIT $nFrom, $cm_nCount";*/

$sql "SELECT *
FROM issues AS a
WHERE a.rgst_dttm BETWEEN '
{$txtdate}' AND '{$txtdate2}' AND ((a.agree_st in (2, 3)) OR (a.agree_st = 1 AND a.work_status IN (2, 3))) $where
ORDER BY idx DESC"
;

//echo $sql;

$res mysql_query($sql,$connect_web);
while(
$jangbu=mysql_fetch_array($res)){
    
$info_array[] = $jangbu;
}

$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(10) a").addClass("active");
});
</script>
<style>
.review_side_ul {left: 85px !important;}
.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 bgg">°í°´´ÔµéÀÇ ±â´É¿äû¸®½ºÆ®(ÆÇ¸ÅÀåºÎ)ÀÔ´Ï´Ù.</span>
            </h3>
            <!-- //°Ë»ö¹Ú½º -->
            <form name='cusreq_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:718px !important;">
                        <dd class="mr10">
                            <div style="display:inline-block;" class="mr10">
                                <input type='text' name='txtdate' size='7' value='<?=$txtdate;?>' id='txtdate' style='width:120px;height:29px;text-align:center;'>
                                <span> ~ </span>
                                <input type='text' name='txtdate2' size='7' value='<?=$txtdate2;?>' id='txtdate2' style='width:120px;height:29px;text-align:center;'>
                            </div>
                        </dd>
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='sti' class="nonearrow">
                                <option value='custname' <?php if($sti=='custname'){?>selected<?php }?>>»óÈ£¸í</option>
                                <option value='rgster' <?php if($sti=='rgster'){?>selected<?php }?>>¿äûÀÚ</option>
                                <option value='rgst_conts' <?php if($sti=='rgst_conts'){?>selected<?php }?>>³»¿ë</option>
                            </select>
                        </dd>
                        <dd>
                            <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="keyword" style="width:143px;height:29px;" onKeyDown="javascript:if(event.keyCode == 13) Search();">
                        </dd>
                        <dd class="searchbtnarea">
                            <a href="#" class="searchBtn bgg" id='search_btn_press'>°Ë»ö</a>
                        </dd>
                    </dl><!--search_tender-->
                </div><!-- //searchArea1-->
            </form>
            <!-- //°Ë»ö¹Ú½º -->

<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="cusreq_board_form">
                <input type="hidden" name="all" value="1">
                <input type="hidden" name="exCode" value="alldel">
                <div class="borderWarp" style="width: 1200px; margin-left: -100px;">
                    <table class="borderTable requestarea">
                        <tr class="bgg">
                        <th style="width:70px;">µî·Ï³¯Â¥</th>
                        <th style="width:70px;">»óÈ£¸í</th>
                        <th style="width:50px;">¿äûÀÚ</th>
                        <th style="width:200px;">¿äû»çÇ×</th>
                        <th style="width:200px;">ÆÀÀå´ÔÄÚ¸àÆ®</th>
                        <th style="width:150px;" class="last">»çÀå´ÔÄÚ¸àÆ®</th>
                    </tr>
                        <?php
                            
for($i=0;$i<count($info_array);$i++){ 
                                
$info $info_array[$i];

                                if(
$info['seq'] == '') { $info['seq'] = $info[0]; }
                        
?>
                        <tr style="height:60px;">
                            <input type='hidden' name='idx' value='<?php echo $info['idx'];?>'>
                            <td class="click_edit"><?php echo $info['rgst_dttm'];?></td>
                            <td class="click_edit" style='width:60px;word-wrap:break-all;'><?php echo $info['custname'];?></td>
                            <td class="click_edit"><?php echo $info['rgster'];?></td>
                            <td class="click_edit">
                                <?php echo cut_str($info['rgst_conts'],60); ?>
                            </td>
                            <td class="click_edit">
                                <?php echo cut_str($info['leadermemo'],60); ?>
                            </td>
                            <td class="last"><?php echo $info['ceocomment'];?></td>
                        </tr>
                        <?php ?>

                        <tr>
                            <td colspan="8" class="bottom last"></td>
                        </tr>
                    </table><!-- //borderTable -->
                </div><!-- //borderWarp -->
            </form>

            <br>
            <? echo pageListing($pg$nPage$cm_nCount"m_cusreq.php?txtdate=$txtdate&txtdate2=$txtdate2&sti=$sti&stx=$stx&pg=")?>
        </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>
$(function(){
    $("#search_btn_press").click(function(){ // °Ë»ö¹öư
        $form_obj = $(this).closest("form");
        $form_obj.submit();
    });

    $(".click_edit").click(function(){ // °Ô½Ã¹° Å¬¸¯
        var idx = $(this).closest("tr").find("input[name='idx']").val();
        $.get("m_cusreq_reg.php?idx="+idx,function(rtn){
            $("#modal_cusreq_box").html(rtn).dialog({
                resizable: true, height:650, width:740, modal: true, title: "ÄÚ¸àÆ® ¼öÁ¤Çϱâ",
                buttons: {
                    ÀúÀå: function() {
                        form_save();
                    },
                    ´Ý±â: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });
});

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

function Search(){
    cusreq_search_form.submit();
}
</script>
</body>
</html>

<div id="modal_cusreq_box" title="°Å·¡Ã³¼öÁ¤" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>