-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdashboard.php
More file actions
34 lines (32 loc) · 1.06 KB
/
Copy pathdashboard.php
File metadata and controls
34 lines (32 loc) · 1.06 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
<?php
session_start();
include("config/db.php"); // Include DB config
if (!isset($_SESSION['username'])):
header('Location: login.php');
else:
include("include/header.php");
?>
<div class="container" id="data">
<!-- View for Admin -->
<?php if ($_SESSION['id'] == 1): ?>
<h1 style="text-align:center">Welcome back <?php echo $_SESSION['username']; ?>,</h1>
<div class="cards" id="home">
<div class="card">
<a href="view-users.php" class="green">View Users</a>
</div>
<div class="card">
<a href="view-products.php" class="blue">View Products</a>
</div>
</div>
<?php else: ?>
<!-- View for Users -->
<div class="user">
<h1>Welcome <?php echo $_SESSION['username']; ?>,</h1>
<a class="link-btn" href="cart.php">My Orders</a>
</div>
<?php endif ?>
</div>
<?php
include("include/footer.php");
endif
?>