-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgrap.php
More file actions
61 lines (53 loc) · 1.5 KB
/
grap.php
File metadata and controls
61 lines (53 loc) · 1.5 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="30" />
<title>Document</title>
<style type="text/css" media="screen">
.hw{
width: 100%;
height: 10px;
}
</style>
</head>
<body>
<?php
include('connect.php');
$id = $_GET['carid'];
$sql = "SELECT date_,countday FROM checkcar WHERE registration='$id'";
$qrr = $conn->prepare($sql);
$qrr->execute();
$qrr->bind_result($date_,$countday);
?>
<div class = "hw" id="myfirstchart" style="height: 250px;"></div>
<script>
new Morris.Line({
// ID of the element in which to draw the chart.
element: 'myfirstchart',
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: [
<?php
while ($qrr->fetch()) {
$day = $date_;
$count = $countday;
echo "{ year: '$day', value: $count },";
}
?>
],
// The name of the data record attribute that contains x-values.
xkey: 'year',
// A list of names of data record attributes that contain y-values.
ykeys: ['value'],
// Labels for the ykeys -- will be displayed when you hover over the
// chart.
labels: ['day']
});
</script>
</body>
</html>