-
Notifications
You must be signed in to change notification settings - Fork 1
/
gyro.html
155 lines (142 loc) · 5.94 KB
/
gyro.html
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
<?php
header('Content-Type: text/html; charset=utf-8');
include('conn.php');
$kickboard = $_POST['kickboard'];
if(empty($kickboard)){
$kickboard = $_COOKIE['kickboard'];
if(empty($kickboard)) $kickboard = '120';
}
setcookie("kickboard", $kickboard, time() + 86400);
$date = $_POST['date'];
if(empty($date)) {
$date = $_COOKIE['date'];
if(empty($date)) $date = date("Y-m-d");
}
setcookie("date", $date, time() + 86400);
$start_time = $_POST['start_time'];
if(empty($start_time)) {
$start_time = $_COOKIE['start_time'];
if(empty($start_time)) $start_time = date("H:00:00", strtotime("-1 hour"));
}
$mysql_start_date = DateTime::createFromFormat('Y-m-d H:i:s', $date. $start_time)->format('Y-m-d H:i:s');
setcookie("start_time", $start_time, time() + 86400);
$end_time = $_POST['end_time'];
if(empty($end_time)) {
$end_time = $_COOKIE['end_time'];
if(empty($end_time)) $end_time = date("H:00:00", strtotime("+1 hour"));
}
$mysql_end_date = DateTime::createFromFormat("Y-m-d H:i:s", $date. $end_time)->format('Y-m-d H:i:s');
setcookie("end_time", $end_time, time() + 86400);
$range = $_POST['range'];
if(empty($range)){
$range = $_COOKIE['range'];
if(empty($range)) $range = 24;
}
setcookie("range", $range, time() + 86400);
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} else {
echo "CONNECTION SUCCESS\n";
$sql = "SELECT * FROM mark2 WHERE kickboard = '$kickboard' AND (record_date BETWEEN '$mysql_start_date' AND '$mysql_end_date')";
$result = mysqli_query($conn, $sql);
}
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<!-- <meta http-equiv="refresh" content="10"> -->
<title>Gyro RECORD</title>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/button.css">
</head>
<body>
<header>
<?php include('gyro_button.html'); ?>
<br><br>
<?php include('gyro_search.html')?>
</header>
<div style="text-align:center">
<table align="center" border="1" bordercolor="white" bgcolor="black" width="90%">
<tr>
<th width="160px" height="40px" bgcolor="white" rowspan="2" align="center">
<font size="3">Record</font>
<font size="5">No.</font>
</th>
<th width="360px" height="40px" bgcolor="white" rowspan="2" align="center">
<font size="6">DATE</font>
</th>
<th height="20px" bgcolor="white" colspan="3" align="center">
<font size="5">Degree</font>
</th>
<th height="20px" bgcolor="white" colspan="3" align="center">
<font size="5">Angular Velocity</font>
</th>
<th height="20px" bgcolor="white" colspan="3" align="center">
<font size="5">Linear Acceleration</font>
</th>
<th height="40px" bgcolor="white" colspan="2" align="center">
<font size="6">Map</font>
</th>
</tr>
<tr>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">x</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">y</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">z</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">x</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">y</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">z</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">x</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">y</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">z</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">lat</font>
</td>
<td width="60" height="20px" bgcolor="white" align="center">
<font size="5">long</font>
</td>
</tr>
<p>
<?php
$num = 0;
while( ($rows = mysqli_fetch_array($result)) && ($num < 1000) ){
$num++;
echo '<tr align="center" height="36px" bgcolor="white">';
echo '<td>',$rows['no'],'</td>';
echo '<td>',$rows['record_date'],'</td>';
echo '<td>',$rows['deg_x'],'</td>';
echo '<td>',$rows['deg_y'],'</td>';
echo '<td>',$rows['deg_z'],'</td>';
echo '<td>',$rows['agv_x'],'</td>';
echo '<td>',$rows['agv_y'],'</td>';
echo '<td>',$rows['agv_z'],'</td>';
echo '<td>',$rows['acc_x'],'</td>';
echo '<td>',$rows['acc_y'],'</td>';
echo '<td>',$rows['acc_z'],'</td>';
echo '<td>',$rows['latitude'],'</td>';
echo '<td>',$rows['longitude'],'</td>';
echo '</tr>';
}
?>
</p>
</table>
</div>
</body>
</html>