80 lines
3.2 KiB
PHP
80 lines
3.2 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// Handle role-based sign-in
|
|
if (isset($_GET['login_as'])) {
|
|
$role = $_GET['login_as'];
|
|
if ($role === 'staff') {
|
|
$_SESSION['user_id'] = 2; // Sample staff user ID
|
|
$_SESSION['user_role'] = 'staff';
|
|
header("Location: staff_dashboard.php");
|
|
exit;
|
|
} elseif ($role === 'resident') {
|
|
$_SESSION['user_id'] = 1; // Sample resident user ID
|
|
$_SESSION['user_role'] = 'resident';
|
|
header("Location: resident_dashboard.php");
|
|
exit;
|
|
} elseif ($role === 'partner') {
|
|
$_SESSION['user_id'] = 3; // Sample partner user ID
|
|
$_SESSION['user_role'] = 'partner';
|
|
header("Location: partner_dashboard.php");
|
|
exit;
|
|
}
|
|
}
|
|
|
|
// If user is already logged in, redirect to their dashboard
|
|
if (isset($_SESSION['user_id'])) {
|
|
if ($_SESSION['user_role'] === 'staff') {
|
|
header("Location: staff_dashboard.php");
|
|
} elseif ($_SESSION['user_role'] === 'resident') {
|
|
header("Location: resident_dashboard.php");
|
|
} elseif ($_SESSION['user_role'] === 'partner') {
|
|
header("Location: partner_dashboard.php");
|
|
}
|
|
exit;
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Welcome - Continuum of Healing</title>
|
|
<meta name="description" content="Sign in to the Continuum of Healing platform.">
|
|
|
|
<!-- Open Graph / Facebook -->
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:title" content="Welcome - Continuum of Healing">
|
|
<meta property="og:description" content="Sign in to the Continuum of Healing platform.">
|
|
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
|
|
|
|
<!-- Twitter -->
|
|
<meta property="twitter:card" content="summary_large_image">
|
|
<meta property="twitter:title" content="Welcome - Continuum of Healing">
|
|
<meta property="twitter:description" content="Sign in to the Continuum of Healing platform.">
|
|
<meta property="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css">
|
|
</head>
|
|
<body class="login-page">
|
|
|
|
<div class="login-container">
|
|
<div class="login-card text-center">
|
|
<h1>Continuum of Healing™</h1>
|
|
<p class="subtitle">Please select your portal to continue</p>
|
|
|
|
<div class="d-grid gap-3">
|
|
<a href="index.php?login_as=staff" class="btn btn-primary-custom btn-lg">Staff Portal</a>
|
|
<a href="index.php?login_as=resident" class="btn btn-secondary-custom btn-lg">Resident Portal</a>
|
|
<a href="index.php?login_as=partner" class="btn btn-info-custom btn-lg">Partner Portal</a>
|
|
</div>
|
|
</div>
|
|
<div class="footer-text">
|
|
© <?php echo date("Y"); ?> Continuum of Healing. Built with Flatlogic.
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
</body>
|
|
</html>
|