-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheditbp.php
121 lines (113 loc) · 3.94 KB
/
editbp.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Edit Blood Pressure Data</title>
<meta charset="utf-8">
<META name="description" content="">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="maincss.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
<br>
<?php
$error = "";
$id=$_GET['id'];
require ("dbinfo.php");
// Create connection
$conn = mysqli_connect($Host, $User, $Password, $DBName);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$tablename = "bpdata";
$sql = "SELECT * FROM $tablename WHERE id = '$id'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$myid = $row["id"];
$clientid = $row["client"];
$mydate = $row["date"];
$mytime = $row["time"];
$systolic = $row["systolic"];
$diastolic = $row["diastolic"];
$pulse = $row["pulse"];
$notes = $row["notes"];
if ($pulse == "0") {
$pulse = "n.a.";
}
}
} else {
$error = "0 results";
}
mysqli_close($conn);
?>
<div class="container">
<div class="row">
<div class="col-sm-6">
<a href="index.php"><img src="images/bp_logo1.jpg" class="img-responsive center-block" width="162" height="148" alt="bp_logo1"></a>
</div>
<div class="col-sm-6">
<h1 class="text-center">Blood Pressure Monitor</h1><p style="text-align: center;">for Robert Lattery</p>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="col-sm-3">
</div>
<div class="col-sm-6" style="border: solid 1px #DDDDDD; margin-bottom: 20px;">
<h2>Edit Blood Pressure Data:</h2>
<form action="editbp2.php" method="post">
<div class="form-group">
<label for="mydate">Date:</label>
<input type="date" class="form-control" id="mydate" name="mydate" value="<?php echo $mydate; ?>" required>
</div>
<div class="form-group">
<label for="mytime">Time:</label>
<input type="time" class="form-control" id="mytime" name="mytime" value="<?php echo $mytime; ?>" required>
</div>
<div class="form-group">
<label for="systolic">Systolic:</label>
<input type="number" class="form-control" id="systolic" name="systolic" value="<?php echo $systolic; ?>" required>
</div>
<div class="form-group">
<label for="diastolic">Diastolic:</label>
<input type="number" class="form-control" id="diastolic" name="diastolic" value="<?php echo $diastolic; ?>" required>
</div>
<div class="form-group">
<label for="pulse">Pulse:</label>
<input type="text" class="form-control" id="pulse" name="pulse" value="<?php echo $pulse; ?>">
</div>
<div class="form-group">
<label for="notes">Notes:</label>
<textarea class="form-control" rows="2" id="notes" name="notes"><?php echo $notes; ?></textarea>
</div>
<input type="hidden" name="myid" value="<?php echo $id; ?>">
<button type="submit" class="btn btn-primary" id="submit" name="submit">Edit</button>
</form>
<br>
</div>
<div class="col-sm-3">
</div>
</div>
<div class="row">
<div class="col-sm-3">
</div>
<div class="col-sm-6">
<p><a href="index.php"><span class='glyphicon glyphicon-circle-arrow-left'></span> Home</a></p>
</div>
<div class="col-sm-3">
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>