-
Notifications
You must be signed in to change notification settings - Fork 4
/
user-health-status-input.php
205 lines (134 loc) · 5.09 KB
/
user-health-status-input.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
<?php
session_start();
include('include/conn.php');
include_once('sql.php');
if(strlen($_SESSION['email'])==0)
{
header('location:login.php');
}
else{
$_SESSION['email'];
$eamil=$_SESSION['email'];
$result = mysqli_query($conn,"SELECT * FROM users Where email='$eamil'");
if (mysqli_num_rows($result) > 0) {
$i=0;
$row = mysqli_fetch_array($result);
}
else{
echo "No result found";
}
include_once('include/header.php');
include_once('include/user-sidebar.php');
?>
<?php
session_start();
include('include/conn.php');
$email=$_SESSION['email'];
$email=$_SESSION['email'];
//Flash Message
$message="";
if(isset($dbh)){
//connection check
if(isset($_POST['submit'])){
$stmt = $dbh->prepare("INSERT INTO `user_helth_status`(`email`,`date`,`temperature`,`pulse`,`suger`,`systolic`,`diastolic`) VALUES (:email, :date, :temperature, :pulse, :suger,:systolic,:diastolic)");
//bindParam
$stmt->bindParam(':email', $email);
$stmt->bindParam(':date', $date);
$stmt->bindParam(':temperature', $temperature);
$stmt->bindParam(':pulse', $pulse);
$stmt->bindParam(':suger', $suger);
$stmt->bindParam(':diastolic', $diastolic);
$stmt->bindParam(':systolic', $systolic);
//keep data into to new variable
$date = $_POST['date'];
$temperature = $_POST['temperature'];
$pulse = $_POST['pulse'];
$suger = $_POST['suger'];
$systolic = $_POST['systolic'];
$diastolic = $_POST['diastolic'];
if($stmt->execute()){
$message="Insert Row Scuccess";
header("Location:user-dataview.php");
}
else{
$message="Insert Row Fail";
}
}
}
?>
<main class="app-content">
<div class="app-title">
<div>
<h1><i class="fa fa-dashboard"></i> user Dashboard</h1>
<p></p>
</div>
<ul class="app-breadcrumb breadcrumb">
<li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
<li class="breadcrumb-item"><a href="#">Dashboard</a></li>
</ul>
</div>
<div class="row">
<div class="col-md-6 m-auto">
<div class="tile">
<h3 class="tile-title">Input Report File </h3>
<div class="tile-body">
<form action="user-health-status-input.php" method="post" class="form-horizontal" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $id ?>">
<div class="form-group row">
<label class="control-label col-md-3" for="date">Date <span class="text-danger">*</span></label>
<div class="col-md-9">
<input type="date" class="form-control" id="date" name="date" >
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3" for="temperature">Body Temperature <span class="text-danger">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" id="temperature" name="temperature" >
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3" for="pulserate">Pulse rate <span class="text-danger">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" id="pulse" name="pulse" >
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3" for="bloodpressure"> Systolic/Upper Pressure <span class="text-danger">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" id="systolic" name="systolic" >
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3" for="bloodpressure"> Diastolic/Lower Pressure <span class="text-danger">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" id="diastolic" name="diastolic" >
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3" for="bloodsugar">Blood Sugar <span class="text-danger">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" id="bloodsugar" name="suger" >
</div>
</div>
<div class="tile-footer text-center">
<button class="btn btn-primary" type="submit" name="submit"><i class="fa fa-fw fa-lg fa-check-circle"></i>Upload</button> <a class="btn btn-secondary" href="user_dashbord.php"><i class="fa fa-fw fa-lg fa-times-circle"></i>Cancel</a>
</div>
</form>
</div>
</div>
</div>
</main>
<script src="https://cdn.rawgit.com/PascaleBeier/bootstrap-validate/v2.2.0/dist/bootstrap-validate.js" ></script>
<script>
// bootstrapvalidate('#temperature','min:2:Enter at least 2 character');
bootstrapValidate(
'#temperature',
'regex:^[0-9]+$:Enter valid tamperature'
);
</script>
</html>
<?php
include_once('include/footer.php');
include_once('include/Hfooter.php');
}
?>