10 31
This commit is contained in:
parent
f15fc3711c
commit
6441bdd294
37
includes/partner_header.php
Normal file
37
includes/partner_header.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php require_once 'includes/partner_session.php'; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Partner Dashboard - Continuum Nexus</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="partner_dashboard.php">Continuum Nexus</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="partner_dashboard.php"><i class="bi bi-people-fill me-2"></i>Assigned Residents</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="messages.php"><i class="bi bi-envelope-fill me-2"></i>Messages</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="resources.php"><i class="bi bi-info-circle-fill me-2"></i>Resources</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="logout.php"><i class="bi bi-box-arrow-right me-2"></i>Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container mt-4">
|
||||
11
includes/partner_session.php
Normal file
11
includes/partner_session.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Check if user is logged in and has the 'partner' role
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'partner') {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
require_once 'includes/resident_session.php';
|
||||
|
||||
$current_page = basename($_SERVER['PHP_SELF']);
|
||||
?>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
|
||||
11
includes/resident_session.php
Normal file
11
includes/resident_session.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Check if user is logged in and has the 'resident' role
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'resident') {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@ -1,9 +1,4 @@
|
||||
<?php
|
||||
// Ensure session is started
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
?>
|
||||
<?php require_once 'includes/staff_session.php'; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
11
includes/staff_session.php
Normal file
11
includes/staff_session.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Check if user is logged in and has the 'staff' role
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'staff') {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@ -75,6 +75,6 @@ if (isset($_SESSION['user_id'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,12 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'includes/partner_header.php';
|
||||
require_once 'db/config.php';
|
||||
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'partner') {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$pdo = db();
|
||||
$current_user_id = $_SESSION['user_id'];
|
||||
|
||||
@ -87,17 +82,6 @@ if (!$partner) {
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Partner Dashboard - Continuum Nexus</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="container-fluid">
|
||||
|
||||
@ -1,13 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'includes/resident_session.php';
|
||||
require_once 'db/config.php';
|
||||
|
||||
// Check if user is logged in and has the 'resident' role
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'resident') {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$resident_id = $_SESSION['user_id'];
|
||||
$pdo = db();
|
||||
|
||||
@ -28,7 +22,7 @@ $risk_scores = $risk_scores_stmt->fetchAll(PDO::FETCH_ASSOC | PDO::FETCH_GROUP);
|
||||
|
||||
// Fetch resident's action plans
|
||||
$action_plans_stmt = $pdo->prepare("
|
||||
SELECT ap.id, ap.title, ap.status, ap.domain
|
||||
SELECT ap.id, ap.title, ap.status, ap.domain_key
|
||||
FROM action_plans ap
|
||||
WHERE ap.resident_id = ?
|
||||
ORDER BY ap.created_at DESC
|
||||
@ -36,6 +30,7 @@ $action_plans_stmt = $pdo->prepare("
|
||||
$action_plans_stmt->execute([$resident_id]);
|
||||
$action_plans = $action_plans_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
// Domain names mapping
|
||||
$domains = [
|
||||
'economic' => 'Economic Stability',
|
||||
@ -132,7 +127,7 @@ $domains = [
|
||||
<?php foreach ($action_plans as $plan): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($plan['title']); ?></td>
|
||||
<td><span class="badge text-bg-info"><?php echo htmlspecialchars($domains[$plan['domain']] ?? 'N/A'); ?></span></td>
|
||||
<td><span class="badge text-bg-info"><?php echo htmlspecialchars($domains[$plan['domain_key']] ?? 'N/A'); ?></span></td>
|
||||
<td><span class="badge text-bg-primary"><?php echo htmlspecialchars(ucfirst($plan['status'])); ?></span></td>
|
||||
<td class="text-end">
|
||||
<a href="view_action_plan.php?id=<?php echo $plan['id']; ?>" class="btn btn-sm btn-outline-primary">View</a>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user