-
Notifications
You must be signed in to change notification settings - Fork 0
/
display_completedV4.php
329 lines (272 loc) · 14.6 KB
/
display_completedV4.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
324
325
326
327
328
329
<!DOCTYPE html>
<html>
<title>คิวรับยา</title>
<meta charset="UTF-8">
<!-- <link rel="stylesheet" type="text/css" href="source/progress_bar.css"> -->
<link rel="stylesheet" type="text/css" href="w3.css">
<link rel="stylesheet" type="text/css" href="custom_text_class.css">
<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="source/progress_bar.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<style>
img {
width: 100px;
height: 100px;
float: left;
margin-right: 10;
}
.mySlides3c {display:none;}
.mySlides2c {display:none;}
.mySlides1c {display:none;}
.w3-striped-blue tbody tr:nth-child(even){background-color:#e6ffff;}
.w3-striped-red tbody tr:nth-child(even){background-color:#ffe6e6;}
td {
text-align: center;
}
</style>
<body>
<?php
error_reporting(E_ERROR | E_PARSE);
header('refresh: 80;');
require("connection.php");
require("source/display_functions_fin_time_2022V4.php");
require ('function.php');
$fin = find_fin_array(); //เช็คทุกคนที่ไม่ใช่อันสุดท้ายและยกเลิก
$wip = find_wip_array();
date_default_timezone_set("Etc/GMT-7");
$today = date("Y-m-d");
$language = "th";
//$refresh_time = refresh_time($db, $today);
?>
<div class="w3-row-padding w3-padding-top" style="height: 10vh">
<div class="w3-col l1" style="height: 100%;">
<img src="HC LOGO.png" alt="" style="height: 10vh; width: 5.625vw">
</div>
<div class="w3-col l6" style="height: 100%;">
<h1 class="w3-center" style="font-size:4vw!important; font-weight: bold; color: #000">เชิญรับยา Finished</h1>
</div>
<div class="w3-col l3" style="height: 100%; color: black;">
<h1 class="w3-center w3-jumbo">
<?php echo(strftime("%d/%m/%Y")); ?></p>
</h1>
</div>
<div id="time" class="w3-col l1" style="height: 100%; color: black;">
<h1 class="w3-center w3-jumbo">
<?php echo(strftime("%H:%M")); ?></p>
</h1>
</div>
<div class="w3-col l1" style="height: 100%; color: black;">
<h1 class="w3-center w3-jumbo">
<?php echo(" hrs"); ?></p>
</h1>
</div>
</div>
<div id="first_row">
<div class="w3-row-padding w3-padding-top" style="height: 20vh">
<h1 class="w3-center w3-red w3-large" style="font-size:2vw!important">คิวที่เสร็จล่าสุด Recently Finished </h1>
<div class="w3-col l6">
<!-- <div class="w3-animate-right"> -->
<!-- <table class="w3-table w3-striped-red" style="font-size:4vw!important"> -->
<?php
$query1 = "SELECT TOP 1 q.q_name, pr.ps_time
FROM prescription p
LEFT OUTER JOIN psrel pr ON pr.pre_id = p.pre_id
LEFT OUTER JOIN queue q ON p.q_id = q.q_id
WHERE pr.s_id = 15
AND p.in_datetime > '$today'
AND p.in_datetime <= dateadd(day, 1, '$today')
ORDER BY pr.ps_time DESC;";
$result = odbc_exec($db, $query1);
$item = 1;
$list = odbc_fetch_array($result);
$q_name_last = $list['q_name'];
$last_ps_time = strtotime($list['ps_time']);
$time_now = strtotime(date("Y-m-d H:i:s"));
if($last_ps_time > $time_now-60){
echo '<table class="w3-table w3-centered blinking extra-bold" style="font-size:4vw!important">';
}else{
echo '<table class="w3-table w3-centered extra-bold" style="font-size:4vw!important; color:#fd00db!important">';
}
echo '<tr><td><b style="font-size:5vw">'.$q_name_last.'</b></td>';
?>
</table>
</div>
<div class="w3-col l4">
<!-- <div class="w3-animate-right"> -->
<!-- <table class="w3-table w3-striped-red" style="font-size:4vw!important"> -->
<?php
$query1 = "SELECT TOP 1 q.q_name, pr.ps_time
FROM prescription p
LEFT OUTER JOIN psrel pr ON pr.pre_id = p.pre_id
LEFT OUTER JOIN queue q ON p.q_id = q.q_id
WHERE pr.s_id = 23
AND p.in_datetime > '$today'
AND p.in_datetime <= dateadd(day, 1, '$today')
ORDER BY pr.ps_time DESC;";
$result = odbc_exec($db, $query1);
$item = 1;
$list = odbc_fetch_array($result);
$q_name_last = $list['q_name'];
$last_ps_time = strtotime($list['ps_time']);
$time_now = strtotime(date("Y-m-d H:i:s"));
if($last_ps_time > $time_now-60){
echo '<table class="w3-table w3-centered blinking extra-bold" style="font-size:4vw!important">';
}else{
echo '<table class="w3-table w3-centered extra-bold" style="font-size:4vw!important; color:#fd00db!important">';
}
echo '<tr><td><b style="font-size:5vw">'.$q_name_last.'</b></td>';
?>
</table>
</div>
<div class="w3-col l2">
<!-- <div class="w3-animate-right"> -->
<!-- <table class="w3-table w3-striped-red" style="font-size:4vw!important"> -->
<?php
$query1 = "SELECT TOP 1 q.q_name, pr.ps_time
FROM prescription p
LEFT OUTER JOIN psrel pr ON pr.pre_id = p.pre_id
LEFT OUTER JOIN queue q ON p.q_id = q.q_id
WHERE pr.s_id = 32
AND p.in_datetime > '$today'
AND p.in_datetime <= dateadd(day, 1, '$today')
ORDER BY pr.ps_time DESC;";
$result = odbc_exec($db, $query1);
$item = 1;
$list = odbc_fetch_array($result);
$q_name_last = $list['q_name'];
$last_ps_time = strtotime($list['ps_time']);
$time_now = strtotime(date("Y-m-d H:i:s"));
if($last_ps_time > $time_now-60){
echo '<table class="w3-table w3-centered blinking extra-bold" style="font-size:4vw!important">';
}else{
echo '<table class="w3-table w3-centered extra-bold" style="font-size:4vw!important; color:#fd00db!important">';
}
echo '<tr><td><b style="font-size:5vw">'.$q_name_last.'</b></td>';
?>
</table>
</div>
</div>
</div>
<div id="second_row">
<!-- <div class="w3-row-padding" style="height: 720px;"> -->
<div class="w3-row-padding w3-padding-top" style="height: 60vh">
<!-- Finished Queue -->
<div id="first_col" class="w3-col l6" style="height: 60vh;">
<h1 class="w3-center w3-red w3-large" style="font-size:2vw!important">A คลินิกต้มให้ Decoction Service </h1>
<!-- <h1 class="w3-center">A คลินิคต้มให้ Decoction Service</h1> -->
<div class="w3-animate-right mySlides3c">
<table class="w3-table w3-striped-red extra-bold" style="font-size:80px!important">
<?php
//ต้องเรียกใช้จาก source/display_fuction ที่ function finish_table($db, $fin_s_id, $fin, $today, $title){
// ใช้แสดงคิวที่เสร็จแล้ว ต้องใส่ค่อ
//$fin_s_id ซึ่งคือ id ที่แปลว่าพร้อมจ่ายยา, $title เป็นชื่อหัวข้อของตาราง, $today เป็นวันที่อยู่ใน format 'yyyy-mm-dd'
finish_table_3c($db, 15, $fin, $today, 'คลินิกต้มให้ (A)1234');
?>
</table>
</div>
</div>
<div id="second_col" class="w3-col l4" style="height: 60vh;">
<h1 class="w3-center w3-red" style="font-size:2vw!important">B ต้มเอง Self Decocted </h1>
<!-- <h1 class="w3-center">B ต้มเอง Self Decocted</h1> -->
<div class="w3-animate-right mySlides2c">
<table class="w3-table w3-striped-red extra-bold" style="font-size:80px!important">
<?php
//ต้องเรียกใช้จาก source/display_fuction ที่ function finish_table($db, $fin_s_id, $fin, $today, $title){
// ใช้แสดงคิวที่เสร็จแล้ว ต้องใส่ค่อ
//$fin_s_id ซึ่งคือ id ที่แปลว่าพร้อมจ่ายยา, $title เป็นชื่อหัวข้อของตาราง, $today เป็นวันที่อยู่ใน format 'yyyy-mm-dd'
finish_table_2c($db, 23, $fin, $today, 'ต้มเอง (B)');
?>
</table>
</div>
</div>
<div id="third_col" class="w3-col l2" style="height: 60vh;">
<h1 class="w3-center w3-red" style="font-size:2vw!important">C เคอลี่ Granule</h1>
<!-- <h1 class="w3-center">B ต้มเอง Self Decocted</h1> -->
<div class="w3-animate-right mySlides1c">
<table class="w3-table w3-striped-red extra-bold" style="font-size:80px!important">
<?php
//ต้องเรียกใช้จาก source/display_fuction ที่ function finish_table($db, $fin_s_id, $fin, $today, $title){
// ใช้แสดงคิวที่เสร็จแล้ว ต้องใส่ค่อ
//$fin_s_id ซึ่งคือ id ที่แปลว่าพร้อมจ่ายยา, $title เป็นชื่อหัวข้อของตาราง, $today เป็นวันที่อยู่ใน format 'yyyy-mm-dd'
finish_table_1c($db, 32, $fin, $today, 'เคอลี่ (C)');
?>
</table>
</div>
</div>
</div>
</div>
<div class="w3-col l12" style="height:10vh ">
<h1 class="w3-center w3-red" style="font-size:2vw!important">D ยาสำเร็จรูปรับยาได้ทันที Code “D” pharmaceutical product pick up at the counter</h1>
</div>
<script>
var myIndex = 0;
var myIndex2 = 0;
var myIndex3 = 0;
var fin_end = 0;
var status_end = 0;
var status_end2 = 0;
var status_end3 = 0;
carousel();
carousel2();
carousel3();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides3c");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1; status_end = 1;}
x[myIndex-1].style.display = "block";
// if (fin_end == 1 && status_end == 1){
// location.reload(true);
// //location.assign("display_eng.php");
// }
setTimeout(carousel, 8000); // Change image every 2 seconds
}
function carousel2() {
var i;
var y = document.getElementsByClassName("mySlides2c");
for (i = 0; i < y.length; i++) {
y[i].style.display = "none";
}
myIndex2++;
if (myIndex2 > y.length) {myIndex2 = 1; status_end2 = 1;}
y[myIndex2-1].style.display = "block";
// if (fin_end == 1 && status_end2 == 1){
// location.reload(true);
// //location.assign("display_eng.php");
// }
setTimeout(carousel2, 8000); // Change image every 2 seconds
}
function carousel3() {
var i;
var z = document.getElementsByClassName("mySlides1c");
for (i = 0; i < z.length; i++) {
z[i].style.display = "none";
}
myIndex3++;
if (myIndex3 > z.length) {myIndex3 = 1; status_end3 = 1;}
z[myIndex3-1].style.display = "block";
// if (fin_end == 1 && status_end3 == 1){
// location.reload(true);
// //location.assign("display_eng.php");
// }
setTimeout(carousel3, 8000); // Change image every 2 seconds
}
$(document).ready(function(){
setInterval(function(){
$("#time").load(window.location.href + " #time" );
}, 1000);
setInterval(function(){
$("#first_row").load(window.location.href + " #first_row" );
}, 4000);
// setInterval(function(){
// $("#second_row").load(window.location.href + " #second_row" );
// }, 32000);
});
</script>
<!-- <div id="here">dynamic content ?</div> -->
</body>
</html>