-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmployeePage.php
50 lines (40 loc) · 1.22 KB
/
EmployeePage.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
<?php
session_start();
// Verify whoever is on this page is an employee
if($_SESSION["user_role"] != 'Admin')
{
$_SESSION["Login.Error"] = 'Please sign in<BR>';
header("location:login.php"); //redirect back to login
}
?>
<!DOCTYPE html>
<html>
<head>
<div style="float:right">
<form align="right" name="logoutform" method="post" action="Login.php">
<input name="submit" type="submit" value="Log Out">
</form>
</div>
<h1 style="text-align:center">Employee Dashboard</h1>
<hr><br>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<form align="right" name="books" method="post" action="Books.php">
<input name="submit" type="submit" value="Books">
</form>
<form align="right" name="Authors" method="post" action="Authors.php">
<input name="submit" type="submit" value="Authors">
</form>
</body>
</html>
<?php
function getUser()
{
$myfile = fopen("DB_USER.txt", "r") or die("Unable to open user file!");
$file_input = fread($myfile, filesize("DB_USER.txt"));
$user_pw = explode(" ", $file_input);
fclose($myfile);
return $user_pw;
}
?>