-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestlist.php
More file actions
65 lines (59 loc) · 1.49 KB
/
requestlist.php
File metadata and controls
65 lines (59 loc) · 1.49 KB
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
<?php
require('db.php');
include("auth.php"); //include auth.php file on all secure pages
if(isset($_SESSION['email']))
{
if($_SESSION['type']==2)
{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>List of Request for <?php echo($_SESSION['email'])?></title>
<link rel="stylesheet" href="css/style.css?2.2" />
</head>
<body>
<input type="button" value="Go to Homepage" onclick="window.location.href='index.php'"></input><br /><br /><br />
<?php
$email=$_SESSION['email'];
$selectSQL = "SELECT * FROM request where hospitalemail like '$email'";
if( !( $selectRes = mysqli_query( $con,$selectSQL ) ) ){
echo 'Retrieval of data from Database Failed - #'.mysql_errno().': '.mysql_error();
}else{
?>
<table border="2">
<thead>
<tr>
<th>Requestor</th>
<th>Sample Id</th>
<th>Sample name</th>
</tr>
</thead>
<tbody>
<?php
if( mysqli_num_rows( $selectRes )==0 ){
echo '<tr><td colspan="4">No Rows Returned</td></tr>';
}else{
while( $row = mysqli_fetch_assoc( $selectRes ) ){
echo "<tr><td>{$row['requestor']}</td><td>{$row['sampleid']}</td><td>{$row['samplename']}</td></tr>\n";
}
}
?>
</tbody>
</table>
</body>
</html>
<?php
}
}
else
{
echo "<div class='form'><h3>Login to see list.</h3><br/>Click here to <a href='hospitallogin.php'>login</a></div>";
}
}
else
{
echo "<div class='form'><h3>Login to see list.</h3><br/>Click here to <a href='hospitallogin.php'>login</a></div>";
}
?>