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_once("../../common.php"); ?> <?
function cut_str2($msg,$cut_size) { if($cut_size<=0) return $msg; if(ereg("\[re\]",$msg)) $cut_size=$cut_size+4; $max_size = $cut_size; $i=0; while(1) { if (ord($msg[$i])>127){ //$i+=2; // euckr일경우 $i+=3; // utf-8일경우 } else { $i++; } if (strlen($msg) < $i) return $msg;
if ($max_size == 0) return substr($msg,0,$i); else $max_size--; } }
$cm_nCount = 10; $cm_item_nCount = 30;
function pageListing($cur_page, $total_page, $n, $url, $mode, $SearchMdiv ,$SearchMup,$SearchMper,$searchCode ,$keyword ,$SearchMsw1 , $cm_nCount, $menu, $sub ) {
$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 - 1 ) / 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; }
?>
<style> .cus_table{/*width:710px;*/width:100%;border-top:2px solid #627aaf;margin-bottom:20px;} .cus_table caption{height:25px;} .cus_table thead tr{background: #eee;} .cus_table th{height:35px;font-size:14px;line-height:14px;border-bottom:1px solid #c3c3c3;text-align:center;font-weight:600;} .cus_table td{height:32px;font-size:13px;line-height:13px;text-align:center;border-bottom:1px dashed #e7e7e7;width:25%;} tr.cus_table_bt td{border-bottom:1px solid #c3c3c3;} .td_last{border-bottom:1px solid #c3c3c3 !important;border-left: 1px dashed #e7e7e7;} /* 게시판 페이징 */ .paging{ text-align:center; margin:20px 0 50px; } .paging > a{ display:inline-block; margin:0 1px; width:27px; height:27px; line-height:27px; vertical-align:top; font-family:Verdana; font-size:13px; overflow:hidden; } .paging > a.on{ color:#f3f3f3; background:#231f20; } .paging > a.page span{ display:block; width:25px; height:25px; line-height:25px; text-indent:-9999px; border:1px solid #ccc; background:url('/manage/images/common/page_arrow.png') no-repeat; } .paging > a.page:hover{ background:#f3f3f3; } .paging > a.page .next{ background-position:center -24px; } .paging > a.page .next10{ background-position:center 6px; } .paging > a.page .pro10{ background-position:center -84px; } .paging > a.page .pro{ background-position:center -54px; } </style>
<h2 style='font-size:17px;font-weight:bold;width:90%;margin:0 auto;margin-bottom:10px;margin-top:60px;'><?php if($cust_list_title!=''){ echo $cust_list_title; } else { echo "집체교육요청 리스트"; }?></h2>
<table class="cus_table mt30"> <thead> <tr> <th>번호</th> <th>상호명</th> <th>접수구분</th> <th rowspan="2" style="border-left: 1px solid #c3c3c3;">등록일시</th> </tr> <tr> <th>구분</th> <th colspan="2"><!--집체교육요청-->담당자(처리일시)</th> </tr> </thead> <tbody> <?
/* 로그아웃 시 전체 글, 로그인하면 자기 글만 보임 */
$sql = " select * from (select '견적' as opt, company, detail, admin, reg_date, product as state_log, '' as smtitle, gubun as flag, mobile from mBoard_consult where 1=1 union select '견적' as opt, smname as company, smdetail as detail, smoption as admin, reg_date, state_log, smtitle, proResult as flag, come_from as mobile from mBoard_install_req where smtitle in('consult-pc','consult-mobile') union select '상담' as opt, smname as company, smdetail as detail, smoption as admin, reg_date, state_log, smtitle, proResult as flag, come_from as mobile from mBoard_install_req where smtitle in('pc','mobile','visit-pc','visit-mobile','shopping-pc','shopping-mobile') union select '설치' as opt, smname as company, smdetail as detail, smoption as admin, reg_date, state_log, smtitle, proResult as flag , come_from as mobile from mBoard_install_req where smtitle not in ('pc','mobile','visit-pc','visit-mobile','consult-pc','consult-mobile','shopping-pc','shopping-mobile') union select '교육' as opt, e_company as company, '집체교육신청' as detail, e_person as admin, reg_date, proc_date as state_log, '' as smtitle, e_state as flag, mobile from mBoard_education union SELECT '신규' AS opt, custname AS company, '데모설치' AS detail, '관리자' AS admin, flow_date AS reg_date, flow_date AS state_log, flow_path AS smtitle, '7' AS flag, '' AS mobile FROM mBoard_file_download_setting where 1=1) aa where 1 ";
$result = mysql_query($sql,$connect_web) or die (mysql_error()); $nTotalCount = mysql_num_rows($result); $nPage = ceil($nTotalCount / $cm_nCount); if ($pg == "") $pg = 1; $nFrom = ($pg - 1) * $cm_nCount; $result = mysql_query($sql,$connect_web) or die (mysql_error());
$sql = $sql . " order by reg_date desc limit $nFrom, $cm_nCount "; $result = mysql_query($sql,$connect_web) or die (mysql_error());
if( mysql_num_rows($result) > 0 ){ while ($info = mysql_fetch_array($result)){ foreach($info as $key=>$val){ if($key=='opt'){ continue; } if($key=='detail' && $val=='데모설치'){ continue; } $info[$key] = iconv("euckr","utf-8",$val); }
$Rowlist[] = $info; } }
$cnt = $nTotalCount-$nFrom; for($aa = 0; $aa < count($Rowlist); $aa++) { $Row = $Rowlist[$aa]; $reg_date = $Row['reg_date'];
$today = date("Y-m-d", strtotime($reg_date)); $ori_compName = $Row['company']; $reg_date = $Row['reg_date']; $tmp = ""; if(substr($Row['company'],0,4)=='(주)'){ $Row['company'] = substr($Row['company'],4,strlen($Row['company'])); $tmp = "(주)"; } $complength = strlen($Row['company']); //$compName = mb_substr($Row['company'],0,2,"euckr"); $compName = $Row['company']; for($i=0;$i<($complength/2)+1;$i++){ //$compName.="*"; }
$Namelength = mb_strlen($Row['name'],"euckr"); $Name = mb_substr($Row['name'],0,2,"euckr"); for($i=0;$i<$Namelength-2;$i++){ $Name.="*"; } $Row['detail'] = str_replace("고객요청 : ","",$Row['detail']);
$main_flg = 0; switch($Row['smtitle']) { case "천년경영ERP 도입": $main_flg = 1; break; case "스마트폰(+PDA)영업관리": $main_flg = 1; break; case "스마트폰(+온라인) 수발주관리": $main_flg = 1; break; case "도매몰/개인몰/오픈마켓관리": $main_flg = 1; break; case "스마트스토어(네이버) 판매관리": $main_flg = 1; break; case "대여관리/POS/자산관리": $main_flg = 1; break; case "물류(배송)시스템/SW개발상담": $main_flg = 1; break; default: $main_flg = 0; break; }
if($Row['detail'] == "데모설치" && $Row['opt'] == "신규") { $Row['admin'] = "관리자"; if($Row['smtitle'] == "천년경영III 2종" || $Row['smtitle'] == "천년경영II 2종") { // 2종페이지에서 설치받으면 $Row['opt'] = $Row['opt']."2"; } else if($Row['smtitle'] == "천년경영3cs 상세" || $Row['smtitle'] == "천년경영3 상세" || $Row['smtitle'] == "천년경영 상세") { // 상세페이지에서 설치받으면 $Row['opt'] = $Row['opt']."S"; } else if($Row['smtitle'] == "천년3CS 제조") { // 제조페이지에서 설치받으면 $Row['opt'] = $Row['opt']."J"; } else if($Row['smtitle'] == "천년경영III cs" || $Row['smtitle'] == "천년경영cs") { // 천년경영3cs 데모페이지에서 설치받으면 $Row['opt'] = $Row['opt']."H"; } else if($Row['smtitle'] == "천년경영III 메인배너") { // 메인배너에서 설치받으면 $Row['opt'] = $Row['opt']."D"; } else if($Row['smtitle'] == "정품 업데이트/3cs") { // 정품다운로드에서 천년경영3cs를 받으면 $Row['opt'] = $Row['opt']."U"; } else if($Row['smtitle'] == "정품 업데이트") { // 정품다운로드에서 그 외를 받으면 $Row['opt'] = $Row['opt']."K"; } else { $Row['opt'] = $Row['opt']."S"; } } else if($Row['opt'] == "설치" && $main_flg = 0) { $Row['opt'] = $Row['opt']."Y"; } else if($Row['opt'] == "설치" && $main_flg = 1) { $Row['opt'] = "상담"; } else if($Row['smtitle'] == "shopping-pc" || $Row['smtitle'] == "shopping-mobile") { $Row['opt'] = "D".$Row['opt']; }
$detail = $Row['detail']; /*if($Row['opt']=='견적'){ $Row['detail'] = "[견적요청]"; } else if($Row['opt']=='상담' && ($Row['smtitle']=='visit-pc' || $Row['smtitle']=='visit-mobile')){ $Row['detail'] = "[방문상담요청]"; } else if($Row['opt']=='상담'){ $Row['detail'] = "[구매상담요청]"; } else if($Row['opt']=='교육'){ $Row['detail'] = "[교육요청]"; } else if($Row['opt']=='설치'){ $Row['detail'] = "[설치요청]"; } if(substr($detail,0,1)=='*'){ if($Row['mobile']=='mobile'){ $Row['detail'] = "[**견적요청]"; } else { $Row['detail'] = "[*견적요청]"; } }*/ if($Row['flag']=='0' || $Row['flag']=='신청' || $Row['flag']==''){ $Row['detail'] = "<span style='color:blue'>[요청접수]</span>"; } else { $Row['detail'] = "[처리완료]"; } if(substr($detail,0,1)=='*'){ if($Row['mobile']=='mobile' || strpos("(m)",$Row['mobile'])>0){ $Row['opt'] = "+".$Row['opt']; } else { $Row['opt'] = "*".$Row['opt']; } }
$Row['state_log'] = trim($Row['state_log']); if(substr($reg_date,0,10)==substr($Row['state_log'],0,10)){ $color = ""; } else { $color = "style='color:#6060CD;'"; } ?> <tr> <td><?=$cnt;?></td> <td> <? if($compName == "엠제이소프트" || strpos($compName, "엠제이") !== false || strpos($compName, "테스트") !== false) { echo "상호미정"; } else if($aa > 0 && $ori_compName == $Rowlist[$aa-1]['company']) { echo "상호미정"; } else if($compName != "") { $len = mb_strlen($compName,'utf-8'); $len1 = round($len/2); //echo $len." ".$len1." ".iconv_substr($info['custname'],$len1); echo $tmp; echo iconv_substr($compName,0,$len1,'utf-8'); for($i=0;$i<$len-$len1;$i++){ echo "*"; } } else { echo "상호미정"; } ?> </td> <td> <?/*=cut_str2($Row['detail'],13)."...";*/echo $Row['detail'];?> </td> <td rowspan="2" class="td_last"><?=date("Y-m-d (H:i)",strtotime($reg_date));?></td> </tr> <tr class="cus_table_bt"> <td>[<?=$Row['opt'];?>]</td> <td colspan="2"><? echo $Row[admin]; if($Row['state_log']!=''){ echo " <span {$color}> ".date("Y-m-d (H:i)",strtotime(substr(trim($Row['state_log']),0,19)))." </span>"; } ?></td> </tr> <? $cnt--; } ?> </tbody> </table>
<? echo pageListing($pg, $nPage, $cm_nCount, "?pg=" , $mode, $chknotend, $SearchMup, $SearchMper, $searchCode, $keyword, $SearchMsw1, $cm_nCount, $menu, $sub)?>
|