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
324
325
326
327
328
329
|
<style> .center_wrap{margin: 0px;width: 330px;margin-right: 160px;display: flex;flex-wrap: wrap;justify-content: center;}
/* 서비스처리현황 */ .table_box{border: 1px solid #D1D1D1;} .counsel_box{background: #fff;table-layout: fixed !important;width: 330px;border: 1px solid #e9e3e2;position: absolute;left:0px;bottom: 0px;} .counsel_box li, .counsel_box li div{text-align: center;word-break: break-all;} .counsel_box_top li{color: #222;font-size: 13px;font-weight: 600;height: 28px;line-height: 28px;}
/* 처리현황표 내 데이터 */ .counsel_slider{width: 100%;height: 112px;overflow: hidden;background: #fff;} /* .counsel_list_box{width: 100%;height: 232px;} */ .counsel_list_box > li{height:28px;box-sizing: border-box;border-bottom:1px dashed #e9e3e2;} .counsel_list_box > li > div{float: left;box-sizing: border-box;padding-top: 4px;padding-bottom: 3px;height: 27px;font-size: 11px;} .counsel_list_box > li div:nth-child(2) .cell, .counsel_list_box li div:nth-child(3) .cell{ /* display: -webkit-box; */ overflow:hidden; white-space: nowrap; text-overflow: ellipsis; word-break: break-all; width: 100%; line-height: 20px; } .counsel_list_box li div:nth-child(2) .cell{text-align: left;font-weight: 600;} .counsel_list_box > li > div{line-height: 20px;text-align: center;} .counsel_list_box > li > div:nth-child(1){width: 30px;} .counsel_list_box > li > div:nth-child(2){width: 60px;box-sizing: border-box;/* padding-right: 5px;padding-left: 5px; */} .counsel_list_box > li > div:nth-child(3){width: 90px;} .counsel_list_box > li > div:nth-child(4){width: 80px;} /* .counsel_list_box > li > div:nth-child(5){width: 90px;} */ /* .counsel_list_box > li > div:nth-child(5){width: 75px;} */ .counsel_list_box > li > div:nth-child(5){width: 70px;text-align: center;padding-right: 10px;} .counsel_list_box > li > div em{font-weight: 600;}
/* 서비스처리현황표 영역 레이아웃 */ .n_wrap .counsel_btn{width:auto !important;height:auto !important;display: inline-block !important;background: none !important;} .counsel_btn span{width: 136px;height: 40px;border-radius: 20px;border: 2px solid #c5c5c5;text-align: center;color: #555555;font-weight: 600;font-size: 14px;line-height: 36px;background: #fff;transition: .3s;margin: 0 auto;padding: 8px 20px;} .counsel_btn span:hover{background: #3e3e3e;color: #fff;}
/* 서비스처리현황표 타이틀 */ .counsel_box_top{box-sizing: border-box;border-bottom: 1px dashed #e9e3e2;width: 330px;height: 28px;text-align: center;background: #fff;/* position: absolute;left:0px;top:0px;z-index: 99;background: #fff; */} .counsel_box_top li{float: left;} .counsel_box_top::after{content:'';display: block;}
.counsel_slider .swiper-scrollbar-drag{border-radius: 0px;}
/* 처리현황표 하단버튼 */ .service_btn{display:inherit;text-align:center;} .service_btn span{width:136px;height:40px;border-radius:20px;border: 1px solid #616161;text-align:center;color: #555555; font-weight:600; font-size:11px; line-height:28px;background: #fff;transition:0.3s;margin:0 auto;padding:4px 10px;} .service_btn span:hover{background: #3E3E3E;color: #fff;} </style>
<?php
$DB_HOST = "114.108.136.196"; $DB_USER = "mj_inhouse_web"; $DB_PWD = "m897461z"; $DB_NAME = "mj_inhouse";
include('../manage/category/class_db.php');
$connect_realtime = @mysql_connect($DB_HOST,$DB_USER,$DB_PWD); @mysql_select_db( $DB_NAME,$connect_realtime);
mysql_query("set session character_set_connection=utf8;"); mysql_query("set session character_set_results=utf8;"); mysql_query("set session character_set_client=utf8;");
$today = date('Y-m-d');
$total_sql = "SELECT count(bb.sdate) as cnt FROM ( SELECT sdate FROM jangbu_tellist AS a LEFT JOIN jangbu_maechul AS b ON a.cname = b.name WHERE a.sdate = '{$today}' AND a.stime > '09:00:00' AND a.stime < '18:00:00' AND a.stime NOT BETWEEN '12:00:00' AND '13:00:00' AND cname NOT LIKE '%오상목%' AND cname NOT LIKE '%미진소프트%' AND cname NOT LIKE '%엠제이소프트%' /*GROUP BY cname*/ ) bb;";
$total_res = mysql_query($total_sql,$connect_realtime); $total_count = mysql_fetch_array($total_res); $idx = (int)$total_count['cnt'];
// 오늘날짜에 게시글이 하나도 없으면 어제날짜로 설정 if($idx == 0){
$day_sql = "SELECT a.sdate FROM jangbu_tellist AS a LEFT JOIN jangbu_maechul AS b ON a.cname = b.name WHERE a.stime > '09:00:00' AND a.stime < '18:00:00' AND a.stime NOT BETWEEN '12:00:00' AND '13:00:00' AND cname NOT LIKE '%오상목%' AND cname NOT LIKE '%미진소프트%' AND cname NOT LIKE '%엠제이소프트%' ORDER BY sdate DESC LIMIT 1"; $day_res = mysql_query($day_sql,$connect_realtime); $day_arr = mysql_fetch_array($day_res); $today = $day_arr['sdate'];
// 최근날짜로 다시한번 더 전체갯수를 취득 $total_sql = "SELECT count(bb.sdate) as cnt FROM ( SELECT sdate FROM jangbu_tellist AS a LEFT JOIN jangbu_maechul AS b ON a.cname = b.name WHERE a.sdate = '{$today}' AND a.stime > '09:00:00' AND a.stime < '18:00:00' AND a.stime NOT BETWEEN '12:00:00' AND '13:00:00' AND cname NOT LIKE '%오상목%' AND cname NOT LIKE '%미진소프트%' AND cname NOT LIKE '%엠제이소프트%' /*GROUP BY cname*/ ) bb;";
$total_res = mysql_query($total_sql,$connect_realtime); $total_count = mysql_fetch_array($total_res); $idx = (int)$total_count['cnt']; }
/*$weekDay = date('w', strtotime($today));
// 오늘날짜가 토요일인 경우 if($weekDay == 0) { $today = date("Y-m-d", strtotime($day." -1 day")); } else if($weekDay == 6) { // 오늘날짜가 일요일인 경우 $today = date("Y-m-d", strtotime($day." -2 day")); }*/
$sql = "SELECT a.seq, /*a.sdate, min(a.stime) as stime, a.etime, a.cname, */ a.sdate, a.stime, a.etime, a.cname, IFNULL(b.`status`,'도소매') AS status_r, IFNULL(b.item,'') AS item_r, a.sdam, a.bigo, a.complete FROM jangbu_tellist AS a LEFT JOIN jangbu_maechul AS b ON a.cname = b.name WHERE a.sdate = '{$today}' AND a.stime > '09:00:00' AND a.stime < '18:00:00' AND a.stime NOT BETWEEN '12:00:00' AND '13:00:00' AND cname NOT LIKE '%오상목%' AND cname NOT LIKE '%미진소프트%' AND cname NOT LIKE '%엠제이소프트%' /*GROUP BY cname*/ ORDER BY stime desc";
$res = mysql_query($sql,$connect_realtime);
if(!$res) { echo mysql_error(); }
while($info=mysql_fetch_array($res)){ $list_arr[] = $info; }
//$cnt = count($list_arr);
?>
<div class="center_wrap" style="position: relative;margin: 0 auto;"> <p class="sec_tit" style="font-size: 16px !important;font-weight:600;color:#4a4a4a;font-family: 'gs',sans-serif;">구매상담/서비스 진행현황</p> <input type='hidden' name='etime_val' value=''> <input type='hidden' name='stime_val' value=''> <input type='hidden' name='idx' value=''> <div class="table_box" style="box-sizing: border-box;width: 332px;height: 142px;position: relative;"> <!-- <span class="" style="position: absolute;right: 8px;top: -20px;font-size: 11px;color: #868686;font-weight: 600;">당일/현재</span> --> <ul class="counsel_box_top"> <li style="width:30px;">순번</li> <li style="width:60px;">상호</li> <!-- <li style="width:60px;">업 종</li> --> <li style="width:90px;">상담내용</li> <!-- <li style="width:90px;">접수시간</li> --> <li style="width:80px;">완료시간</li> <!-- <li style="width:75px;">담당자</li> --> <li style="width:70px;box-sizing: border-box;text-align: left;padding-left: 18px;">결과</li> </ul> <div class="counsel_slider" style="position: relative;"> <ul id="counsel_list_box" class="counsel_list counsel_list_box slider05 swiper-wrapper"> <?php for($i=0; $i<count($list_arr); $i++){ $list = $list_arr[$i];
//상담내용 글자 수 줄이기 $bigo = mb_strimwidth($list['bigo'],0,60,"...");
//상호명 글자 수 줄이기 $sangho_leng = mb_strlen($list['cname']); if($sangho_leng <= 6){ $sangho_leng = ceil($sangho_leng/2); $star = ""; for($s=0; $s<$sangho_leng; $s++){ $star .= "*"; } $sangho = mb_substr($list['cname'], '0', $sangho_leng).$star; } else if($sangho_leng > 6 ){ $sangho_leng = ceil($sangho_leng - 3); $star = ""; for($s=0; $s<$sangho_leng; $s++){ $star .= "*"; } $sangho = mb_substr($list['cname'], '0', 3).$star; }
// 상호명이 비어있는 경우 if($sangho == "") { $sangho = "사업자개설전"; }
//담당자->팀으로 치환 $team = ""; switch($list['sdam']) { case "오상목": $team = "상담1팀"; break; case "권창규": $team = "상담2팀"; break; case "홍재원": $team = "상담3팀"; break; case "이승환": $team = "상담4팀"; break; case "여욱동": $team = "상담5팀"; break; case "황재현": $team = "상담6팀"; break; case "이수현": $team = "상담7팀"; break; case "황혜인": $team = "상담8팀"; break; case "박주현": $team = "상담9팀"; break; case "김태정": $team = "상담10팀"; break; case "한동진": $team = "상담11팀"; break; case "안재윤": $team = "상담12팀"; break; default: $team = "상담팀"; }
if($list['complete']=="1"){ $complete = "상담완료"; } else if($list['complete']=="0"){ $complete = "상담중"; }
// 종료시간이 00시면 아무것도 표시안함 if($list['etime']=="00:00:00"){ $etime = ""; } else { $etime = substr($list['sdate'],5,9)."-".substr($list['etime'],0,5); }
// 두시간이 지나도 상담중..일 경우 상담완료라고 표시하기 $str_date = strtotime($list['stime'].'+2 hours'); $twohours = $list['sdate']."-".date("H:i", $str_date); $twohours2 = substr($twohours, 5); if(date("Y-m-d-H:i") > $twohours && $list['complete'] == "0"){ $complete = "상담완료"; $etime = $twohours2; }
// 인코딩(필요없지만 코멘트) //$sangho = iconv("EUC-KR", "UTF-8", $sangho); // 상호 //$list['status_r'] = iconv("EUC-KR", "UTF-8", $list['status_r']); // 업종
// 상호명이 비어있는 경우 if($sangho == "") { $sangho = "사업자개설전"; }
if($complete == "상담중"){$etime = "";} ?> <li id="<?php echo $list['seq'];?>" class="seqClass swiper-slide <?php echo $list['etime'];?> <?php echo $list['stime'];?>"> <div class="idx"><?php echo $idx;?></div> <div class="company_name"><div class="cell"><?php echo $sangho;?></div></div> <!-- <div><div class="cell"><?php echo $list['status_r'];?></div></div> --> <div>구매상담/서비스</div> <!-- <div><?php echo $list['sdate']."-".substr($list['stime'],0,5);?></div> --> <div><?php echo $etime;?></div> <!-- <div><?php echo $team;?></div> --> <div><?php echo $complete;?></div> </li> <?php $idx--; } ?>
</ul> <div class="swiper-scrollbar" style="position: absolute;right: 0px;top:0px;z-indexe: 999;height: 100%;width: 10px;border-radius: 0px;"></div> </div> </div> <a class="counsel_btn service_btn" href="./realtime_counsel.php" style="margin-top:10px;"><span>전체 보기</span></a> </div> <script> $(function(){
//첫 시작 슬라이드(순번1) 설정 var slide_num = $(".seqClass").length; console.log(slide_num); if(slide_num <= 4){initial_num = 4} else{initial_num = slide_num - 4;} console.log(initial_num); const swiper02 = new Swiper('.counsel_slider', { //첫 시작 슬라이드 설정 initialSlide: initial_num, autoplay: { delay: 50, disableOnInteraction: false, //이동 방향 설정(위 -> 아래) reverseDirection: true, }, speed: 1400, slidesPerView: 'auto', direction: 'vertical', loop: false, scrollbar : { el : '.swiper-scrollbar', draggable: true, }, }); swiper02.on('reachEnd', function(){ swiper02.slideTo(slide_num, 5, false); }); //상담완료,상담중 문구색상 변경 $('.seqClass > div:last-child:contains("상담완료")').css("color","#ff2020"); $('.seqClass > div:last-child:contains("상담중")').css("color","#204eff");
//12.06 수정중 setInterval(function(){ $('.seqClass > div:last-child:contains("상담중")').animate({opacity: 0}, 1000, function(){ $(this).animate({opacity: 1}, 1000); }); }, 2000); }) </script>
|