-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadmin.php
48 lines (37 loc) · 1.39 KB
/
admin.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
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en">
<head>
<?php
//start session
session_start();
//check session vaiable username is present and user logged in
//only admin can access this page
if(isset($_SESSION['username']) && isset($_SESSION['admin']))
{
//include relevant files
include "header.php";
include "connection.php";
?>
<title>Admin</title>
<link rel="stylesheet" href="style.css" title="Style Sheet" type="text/css" />
</head>
<body>
<?php
echo "<h4>From this page you will be able to edit all entries in this Database: </h4>";
/* only admins should be ables to access these pages */
echo ' <div class="btn-group">
<a href="admin-tasks.php"><button class="btn btn-secondary btn-lg" type="button">Edit Tasks</button></a>
<a href="admin-bids.php"><button class="btn btn-secondary btn-lg" type="button">Edit Bids</button></a>
<a href="admin-wins.php"><button class="btn btn-secondary btn-lg" type="button">Edit Wins</button></a>
<a href="admin-users.php"><button class="btn btn-secondary btn-lg" type="button">Edit Users</button></a>
</div>';
}else if(isset($_SESSION['username'])){
//if user is not logged in as admin
header ('location: home.php');
}else{
header ('location: login.php');
}
?>
</body>
</html>