37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// If user is not logged in, redirect to login page
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header("Location: login.php");
|
|
exit;
|
|
}
|
|
|
|
$user_name = $_SESSION['user_name'];
|
|
$user_role = $_SESSION['user_role'];
|
|
|
|
?>
|
|
<?php include 'header.php'; ?>
|
|
|
|
<div class="container mt-5">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4>Welcome, <?php echo htmlspecialchars($user_name); ?>!</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<p>Welcome to your RentEase dashboard.</p>
|
|
<p>Your role is: <strong><?php echo htmlspecialchars($user_role); ?></strong></p>
|
|
<?php if ($user_role === 'vendor'): ?>
|
|
<a href="add_item.php" class="btn btn-primary">Add New Item</a>
|
|
<?php endif; ?>
|
|
<p><a href='logout.php'>Click here to log out.</a></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php include 'footer.php'; ?>
|