-
Notifications
You must be signed in to change notification settings - Fork 0
/
checktable.php
54 lines (48 loc) · 1.32 KB
/
checktable.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
<!DOCTYPE html>
<html>
<?php include "config.php"?>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="flatly.css">
</head>
<body>
<?php
include "config.php";
if(isset($_POST['submit'])){
$patusername = $_POST['username'];
$sql = "SELECT prescriptionid FROM visitingdata WHERE patusername = '$patusername'";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
while($row = mysqli_fetch_assoc($result)) {
$prescriptionid = $row["prescriptionid"];
}
// output data of each row
echo "<div class='jumbotron'>
<h1 class='display-3'>Valid Patient!</h1>
<p class='lead'></p>
<hr class='my-4'>
<p></p>
<p class='lead'>
<form method='POST' action='issueindex.php' >
Prescriptionid:<br>
<input type='text' name='regnum' value='$prescriptionid'>
<input type='submit' name='submit' value='Make Order'>
</form>
</p>
</div>";
} else {
echo "<div class='jumbotron'>
<h1 class='display-3'>Warning..Invalid Patient!</h1>
<p class='lead'></p>
<hr class='my-4'>
<p></p>
<p class='lead'>
<a class='btn btn-primary btn-lg' href='cancel.php' role='button'>Cancel</a>
</p>
</div>";
}
$mysqli->close();
}
?>
</body>
</html>