-
Notifications
You must be signed in to change notification settings - Fork 1
/
historyGraph.html
222 lines (160 loc) · 5.4 KB
/
historyGraph.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
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
<!DOCTYPE html><html lang="en">
<head>
<!-- Basic informations -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Site informations -->
<title>History Review</title>
<!-- Open Graph -->
<meta property="og:title" content="Free Aurora Template">
<meta property="og:description" content="Free HTML5 Template created by Dominik Serafin.">
<meta property="og:url" content="http://serafin.io/aurora-template/">
<meta property="og:image" content="http://serafin.io/aurora-template/content/og_image.png">
<!-- Fonts -->
<link href="style/fonts/webfont-raleway/webfont-raleway.css" rel="stylesheet" type="text/css">
<link href="style/fonts/webfont-font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
<!-- Stylesheets -->
<link href="style/css/global.css" type="text/css" rel="stylesheet" media="all">
<!-- Scripts preload -->
<!--[if lt IE 9]><script src="style/js/html5shiv.js"></script><![endif]-->
<style>
div.text {
float: left;
width: 50%;
line-height: 4
}
div.title {
font-size: 20px;
line-height: 2;
padding-bottom: 3px;
font-weight: 600;
color: rgba(255,255,255,0.9);
border-top: 2px solid rgba(255,255,255,0.1);
}
div.element {
display: inline-block;
width: 80%;
float: center;
height: 100px;
margin-top: 50px;
}
</style>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['line']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'Date');
data.addColumn('number', 'Yes');
data.addColumn('number', 'No');
data.addColumn('number', 'Dont know');
data.addRows([
[1, 37, 20, 12],
[2, 30, 25, 15],
[3, 35, 17, 24],
[4, 29, 25, 15],
[5, 34, 25, 10]
]);
var options = {
chart: {
title: 'History record for Telehealth questionnaire',
subtitle: 'Yes, No, and Dont know: TeleHealth'
},
width: 1100,
height: 400,
vAxis: {
textStyle: {
color: "#FFFFFF",
fontSize : 14
}
},
hAxis: {
textStyle: {
color: "#FFFFFF"
}
},
legend :{
textStyle :{
color: "#FFFFFF"
}
},
backgroundColor: 'transparent',
linewidth: 20,
colors: ['9BABBF', 'F2C4B3', 'F2E0DC']
};
var chart = new google.charts.Line(document.getElementById('linechart_material'));
chart.draw(data, google.charts.Line.convertOptions(options));
}
</script>
</head>
<body>
<!-- Some Helper Stuff -->
<div id="start" class="start"> </div>
<div class="maxwidth1050"> </div>
<!-- Header -->
<header class="header">
<div class="header__wrapper">
<div class="header__hamburger">
<div class="header__hamburger-block"> </div>
<div class="header__hamburger-block"> </div>
<div class="header__hamburger-block"> </div>
</div>
<a href="instructions1.php" class="header__title-wrapper js-smooth-scroll">
<div class="header__title-main" href="instructions1.php">Tele Health</div>
<div class="header__title-sub">By School of Health and Rehabilitation</div>
</a>
</div>
</header>
<!-- End Header -->
<!-- "Features" Section -->
<section id="features" class="features">
<div class="features__wrapper">
<div class="section-header">
<div class="section-header__title section-header__title--features">History Result</div>
</div>
<div class="features__elements-wrapper">
<div id="linechart_material" style="width: 440px; height: 450px;"></div>
<?php
require("common.php");
$servername = "localhost";
$username = "hsx1";
$password = "123";
$dbname = "telemed";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} else {
//echo "db is connected";
}
//session_start();
$user = $_SESSION['username'];
$sql = "SELECT id FROM userinfo WHERE username = '$user';";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$userid = $row["id"];
//search by answer date
echo "<form action = \"historyGraph.php\" method = \"POST\">";
echo "<select name=\"datearr[]\" >";
echo "<option value=\"ALL\">ALL</option>";
$getdates = "SELECT DISTINCT curtime
FROM `answers`
WHERE UserID = $userid
GROUP BY curtime";
$resdate = $conn->query($getdates);
while($rowdates = $resdates->fetch_assoc()){
$date = $rowdates["curtime"];
echo "<option value=\"$date\">$date</option>";
}
echo "<input type = \"submit\" name = \"dateSubmit\" value = \"GO\">";
echo "</form>";
?>
<br> <br>
<table style = "width:100%">
</table>
</div>
</div>
</section>
<!-- End "Features" Section -->
</body>