forked from aligator4sah/Telehealth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlankSurvey3.php
275 lines (210 loc) · 6.87 KB
/
BlankSurvey3.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
<?php
require("common.php");
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} else {
//echo "db is connected";
}
?>
<!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>TeleHealth Survey</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.vendor {
margin-top: 2px;
font-size: 22px;
font-weight: 300;
letter-spacing: 0.3px;
//word-spacing: 0.1px;
line-height: 1.3;
color: #FFFFFF;
}
body {
background-color: #1e0036;
}
.experience1 {
background-color: rgba(#43374c,0.99);
position: relative;
&::before {
position: absolute;
z-index: 100;
top: 0;
left: 0;
display: block;
width: 100%;
height: 500px;
content: " ";
}
&::after {
position: absolute;
z-index: 50;
bottom: 0;
left: 0;
display: block;
width: 100%;
height: 1077px;
content: " ";
opacity: 1;
background-position: -80px 50px;
}
}
.experience1__hollow-arrow {
width: 100%;
height: 40px;
background-image: url("../img/content_hollow-arrow.png");
background-position: 50% 50%;
position: relative;
top: -40px;
left: 0;
opacity: 1;
}
.experience1__wrapper {
position: relative;
z-index: 200;
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding-top: 110px;
padding-bottom: 200px;
}
.experience1__icons-wrapper {
margin-bottom: 20px;
//clearfix
&::after {
display: table;
content: " ";
clear: both;
}
}
</style>
</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>
<nav class="header__navigation">
<a href="instructions1.php">
<div class="header__navigation-element header__navigation-element--experience">Instructions</div>
</a>
<a href="finalGraph1.php">
<div class="header__navigation-element header__navigation-element--realizations">Final Result</div>
</a>
<a href="historyGraph.php">
<div class="header__navigation-element header__navigation-element--features">History Results</div>
</a>
<a href="index1.php">
<div class="header__navigation-element header__navigation-element--realizations">Log out</div>
</a>
</nav>
<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 class="header__social-icons">
<ul class="w3-navbar w3-blue">
<a href="BlankSurvey1.php"><h5>Vendor</h5></a>
<a > <h5> | </h5></a>
<a href="BlankSurvey2.php"><h5>Patient</h5></a>
<a > <h5> | </h5></a>
<a href="BlankSurvey3.php"><h5>Data Management</h5></a>
</ul>
</div>
</div>
</header>
<!-- End Header -->
<!-- "Experience" Section -->
<section id="experience" class="experience1">
<div class="experience1__hollow-arrow"> </div>
<div class="experience1__wrapper">
<div class="section-header">
<div class="section-header__title section-header__title--experience">Data Management</div>
<div class="section-header__subtitle">Please remember to click "Done" to save your results.</div>
</div>
<?php
//session_start();
$user = $_SESSION['username'];
$sql = "SELECT id FROM userinfo WHERE username = '$user';";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$userid = $row["id"];
$nextWeek = time() + (7 * 24 * 60 * 60);
$curtime = date('Y-m-d');
if(empty($_SESSION['user'])) {
header("Location: index1.php");
die("Redirecting to index1.php");
}
$query = "SELECT questionid, categoryid, subcategoryid, description FROM data";
try {
$stmt = $db->prepare($query);
$stmt->execute();
}
catch(PDOException $ex) {
die("Failed to run query: " . $ex->getMessage());
}
$rows = $stmt->fetchAll();
$sql = "SELECT MIN(QuestionID) AS min, MAX(QuestionID) AS max FROM patient;";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$min = $row["min"];
$max = $row["max"];
if( $_POST ) {
for($x = $min; $x <= $max; $x ++){
if(isset($_POST["optionsRadios$x"])){
$question = $x;
$answer = $_POST["optionsRadios$x"];
$sql = "INSERT INTO answers (Answer, UserID, QuestionID, curtime) VALUES ('$answer', $userid, $question, '$curtime')";
if ($conn->query($sql) === TRUE){
//echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
}
}
?>
<div class="experience1__icons-wrapper">
<div class = "vendor">
<div class = "row">
<div class = "col-col-md-8 col-md-offset-2>
<?php
include("DataManagement1.php");
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- End "Experience" Section -->
<script src="style/js/dependencies.min.js" type="text/javascript"></script>
<script src="style/js/global.js" type="text/javascript"></script>
</body>
</html>