-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.php
executable file
·170 lines (146 loc) · 5.49 KB
/
view.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
<?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 users</h4>
<hr/>
<div class="tabbed_area">
<ul class="tabs">
<li><a href="javascript:tabSwitch('tab_1', 'content_1');" id="tab_1" class="active">Pharmacist </a></li>
<li><a href="javascript:tabSwitch('tab_2', 'content_2');" id="tab_2">Cashier</a></li>
<li><a href="javascript:tabSwitch('tab_3', 'content_3');" id="tab_3">Manager</a></li>
</ul>
<div id="content_1" class="content">
<?php echo $message;
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 pharmacist")or die(mysql_error());
// display data in table
echo "<table border='1' cellpadding='5'>";
echo "<tr><th>Firstname</th> <th>Lastname </th> <th>Staff ID</th><th>Phone</th><th>Email</th><th>Username </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['first_name'] . '</td>';
echo '<td>' . $row['last_name'] . '</td>';
echo '<td>' . $row['staff_id'] . '</td>';
echo '<td>' . $row['phone'] . '</td>';
echo '<td>' . $row['email'] . '</td>';
echo '<td>' . $row['username'] . '</td>';
}
// close table>
echo "</table>";
?>
</div>
<div id="content_2" class="content">
<?php echo $message;
echo $message1;
/*
View
Displays all data from 'Cashier' table
*/
// connect to the database
include_once('connect_db.php');
// get results from database
$result = mysql_query("SELECT * FROM cashier")
or die(mysql_error());
// display data in table
echo "<table border='1' cellpadding='5' >";
echo "<tr><th>Firstname</th> <th>Lastname </th> <th>Staff ID</th><th>Phone</th><th>Email</th><th>Username </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['first_name'] . '</td>';
echo '<td>' . $row['last_name'] . '</td>';
echo '<td>' . $row['staff_id'] . '</td>';
echo '<td>' . $row['phone'] . '</td>';
echo '<td>' . $row['email'] . '</td>';
echo '<td>' . $row['username'] . '</td>';
}
// close table>
echo "</table>";
?>
</div>
<div id="content_3" class="content">
<?php echo $message1;
/*
View
Displays all data from 'Manager' table
*/
// connect to the database
include_once('connect_db.php');
// get results from database
$result = mysql_query("SELECT * FROM manager")
or die(mysql_error());
// display data in table
echo "<table border='1' cellpadding='5'>";
echo "<tr><th>Firstname</th> <th>Lastname </th> <th>Staff ID</th><th>Phone</th><th>Email</th><th>Username </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['first_name'] . '</td>';
echo '<td>' . $row['last_name'] . '</td>';
echo '<td>' . $row['Staff_id'] . '</td>';
echo '<td>' . $row['phone'] . '</td>';
echo '<td>' . $row['email'] . '</td>';
echo '<td>' . $row['username'] . '</td>';
}
// close table>
echo "</table>";
?>
</div>
</div>
</div>
</div>
<div id="footer" align="Center"> Developed By IT$ MINE</div>
</div>
</body>
</html>