-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_prescription.php
executable file
·90 lines (84 loc) · 2.8 KB
/
view_prescription.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
<?php
session_start();
include_once('connect_db.php');
if(isset($_SESSION['username'])){
$id=$_SESSION['manager_id'];
$fname=$_SESSION['first_name'];
$lname=$_SESSION['last_name'];
$sid=$_SESSION['staff_id'];
$user=$_SESSION['username'];
}else{
header("location:http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php");
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php $user?> Pharmacy Sys</title>
<link rel="stylesheet" type="text/css" href="style/mystyle.css">
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="style/table.css" type="text/css" media="screen" />
<script src="js/function1.js" type="text/javascript"></script>
<style>#left-column {height: 477px;}
#main {height: 477px;}
</style>
</head>
<body>
<div id="content">
<div id="header">
<h1><a href="#"><img src="images/ash.gif"></a>Agadi Sunrise Hospital</h1></div>
<div id="left_column">
<div id="button">
<ul>
<li><a href="manager.php">Dashboard</a></li>
<li><a href="view.php">View Users</a></li>
<li><a href="view_prescription.php">View Prescriptions</a></li>
<li><a href="stock.php">Manage Stock</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
</div>
<div id="main">
<div id="tabbed_box" class="tabbed_box">
<h4>View Prescription</h4>
<hr/>
<div class="tabbed_area">
<ul class="tabs">
<li><a href="javascript:tabSwitch('tab_1', 'content_1');" id="tab_1" class="active">Prescription </a></li>
</ul>
<div id="content_1" class="content">
<?php echo $message1;
/*
View
Displays all data from 'Pharmacist' table
*/
// connect to the database
include_once('connect_db.php');
// get results from database
$result = mysql_query("SELECT * FROM prescription")or die(mysql_error());
// display data in table
echo "<table border='1' cellpadding='5'>";
echo "<tr> <th>Customer</th><th>Prescription N<sup>o</sup></th> <th>Invoice N<sup>o</sup></th><th>Date </th></tr>";
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array( $result )) {
// echo out the contents of each row into a table
echo "<tr>";
echo '<td>' . $row['customer_name'] . '</td>';
echo '<td>' . $row['prescription_id'] . '</td>';
echo '<td>' . $row['invoice_id'] . '</td>';
echo '<td>' . $row['date'] . '</td>';
?>
<?php
}
// close table>
echo "</table>";
?>
</div>
</div>
</div>
</div>
<div id="footer" align="Center">Developed by IT$ MINE</div>
</div>
</body>
</html>