-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_prediction_main.php
159 lines (138 loc) · 5.26 KB
/
edit_prediction_main.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>edit_prediction_main</title>
<link rel="stylesheet" type="text/css" href="w3.css">
<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<!-- -->
<body>
<?php
require('header.html');
error_reporting(E_ERROR | E_PARSE);
?>
<div class="w3-container">
<div class="w3-card-2 w3-section" style="width:100%;">
<div class="w3-container w3-border-bottom">
<h1 class="w3-center">
<i class="fa fa-hourglass" aria-hidden="true"></i> ปรับเปลี่ยนสมการ (修改时间方程)
</h1>
</div>
<?php
require('connection.php');
$query="SELECT *
FROM equation WHERE t_id='1' AND Version IN
( SELECT MAX(Version)
FROM equation WHERE t_id='1'
)";
$result=odbc_exec($db,$query);
if($list=odbc_fetch_array($result))
{
$Version_A=$list['Version'];
$datetime_A=$list['datetime'];
$TuneA=$list['Tune'];
$myDateTime_A = DateTime::createFromFormat('Y-m-d H:i:s.u', $datetime_A);
$newDateString_A = $myDateTime_A->format('Y-m-d H:i:s');
}
$query="SELECT *
FROM equation WHERE t_id='2' AND Version IN
( SELECT MAX(Version)
FROM equation WHERE t_id='2'
)";
$result=odbc_exec($db,$query);
if($list=odbc_fetch_array($result))
{
$Version_B=$list['Version'];
$datetime_B=$list['datetime'];
$TuneB=$list['Tune'];
$myDateTime_B = DateTime::createFromFormat('Y-m-d H:i:s.u', $datetime_B);
$newDateString_B = $myDateTime_B->format('Y-m-d H:i:s');
}
$query="SELECT *
FROM equation WHERE t_id='3' AND Version IN
( SELECT MAX(Version)
FROM equation WHERE t_id='3'
)";
$result=odbc_exec($db,$query);
if($list=odbc_fetch_array($result))
{
$Version_C=$list['Version'];
$datetime_C=$list['datetime'];
$TuneC=$list['Tune'];
$myDateTime_C = DateTime::createFromFormat('Y-m-d H:i:s.u', $datetime_C);
$newDateString_C = $myDateTime_C->format('Y-m-d H:i:s');
}
?>
<form class="w3-row-padding" method="get" action="edit_prediction_update.php">
<div class="w3-container w3-third w3-large w3-card-2 w3-section">
<div class="w3-container w3-border-bottom">
<h2>ยาต้ม</h2>
</div>
<table class="w3-table w3-margin-bottom">
<tr>
<th>Version</th>
<td><?php echo $Version_A;?></td>
</tr>
<tr>
<th style="vertical-align:middle">เวลาเผื่อสำหรับยาต้ม</th>
<td><input class="w3-input w3-border" type="int" pattern="[-+]?[0-9]*[.,]?[0-9]+" title="Plese enter only number" name="TuneA" placeholder= <?php echo number_format($TuneA,2) ," minutes"; ?> id="TuneA"></td>
</tr>
<tr>
<th>เวลาที่บันทึก</th>
<td><?php echo $newDateString_A;?></td>
</tr>
</table>
</div>
<div class="w3-container w3-third w3-large w3-card-2 w3-section w3-container">
<div class="w3-container w3-border-bottom">
<h2>ยาจัด</h2>
</div>
<table class="w3-table w3-margin-bottom">
<tr>
<th>Version</th>
<td><?php echo $Version_B;?></td>
</tr>
<tr>
<th style="vertical-align:middle">เวลาเผื่อสำหรับยาจัด</th>
<td><input class="w3-input w3-border" type="int" pattern="[-+]?[0-9]*[.,]?[0-9]+" title="Plese enter only number" name="TuneB" placeholder= <?php echo number_format($TuneB,2) ," minutes"; ?> id="TuneB"></td>
</tr>
<tr>
<th>เวลาที่บันทึก</th>
<td><?php echo $newDateString_B;?></td>
</tr>
</table>
</div>
<div class="w3-rest w3-third w3-container w3-large w3-card-2 w3-section">
<div class="w3-container w3-border-bottom">
<h2>ยาเคอลี่</h2>
</div>
<table class="w3-table w3-margin-bottom">
<tr>
<th>Version</th>
<td><?php echo $Version_C;?></td>
</tr>
<tr>
<th style="vertical-align:middle">เวลาเผื่อสำหรับเคอลี่</th>
<td><input class="w3-input w3-border" type="int" pattern="[-+]?[0-9]*[.,]?[0-9]+" title="Plese enter only number" name="TuneC" placeholder= <?php echo number_format($TuneC,2) ," minutes"; ?> id="TuneC"></td>
</tr>
<tr>
<th>เวลาที่บันทึก</th>
<td><?php echo $newDateString_C;?></td>
</tr>
</table>
</div><br>
<div class="w3-center w3-section">
<p><input class="w3-btn w3-green w3-xlarge"style="width:30%" type="submit" ></a></p>
</div>
</div>
<br>
</div>
</div>
</body>
<!--set focus on the input-->
<script>
document.getElementById('pre_id').focus();
</script>
</html>