Auto commit: 2025-10-30T18:38:17.148Z

This commit is contained in:
Flatlogic Bot 2025-10-30 18:38:17 +00:00
parent 515d5888d3
commit 17238c8890
18 changed files with 330 additions and 302 deletions

View File

@ -44,7 +44,7 @@ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Appointment Calendar - Continuum of Healing</title>
<title>Appointment Calendar - 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="assets/css/custom.css">
<style>
@ -57,7 +57,7 @@ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="resident_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="resident_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link" href="resident_dashboard.php">Dashboard</a></li>

View File

@ -19,14 +19,14 @@ $staff_users = $stmt->fetchAll(PDO::FETCH_ASSOC);
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compose Message - Continuum of Healing</title>
<title>Compose Message - 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="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="#">Continuum of Healing</a>
<a class="navbar-brand" href="#">Continuum Nexus</a>
<a href="logout.php" class="btn btn-outline-light">Logout</a>
</div>
</nav>

View File

@ -56,7 +56,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Action Plan - Continuum of Healing</title>
<title>New Action Plan - 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="assets/css/custom.css">
</head>
@ -64,7 +64,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="staff_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="staff_dashboard.php">Continuum Nexus</a>
</div>
</nav>

View File

@ -35,14 +35,14 @@ $partners = $stmt->fetchAll(PDO::FETCH_ASSOC);
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Referral - Continuum of Healing</title>
<title>New Referral - 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="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="staff_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="staff_dashboard.php">Continuum Nexus</a>
<a href="logout.php" class="btn btn-outline-light">Logout</a>
</div>
</nav>

View File

@ -0,0 +1,30 @@
<?php
$current_page = basename($_SERVER['PHP_SELF']);
?>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="resident_dashboard.php">Continuum Nexus</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#residentNavbar" aria-controls="residentNavbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="residentNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item <?php echo ($current_page == 'resident_dashboard.php') ? 'active' : ''; ?>">
<a class="nav-link" href="resident_dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</li>
<li class="nav-item <?php echo ($current_page == 'messages.php' || $current_page == 'view_message.php' || $current_page == 'resident_compose_message.php') ? 'active' : ''; ?>">
<a class="nav-link" href="messages.php"><i class="fas fa-envelope"></i> Messages</a>
</li>
<li class="nav-item <?php echo ($current_page == 'calendar.php') ? 'active' : ''; ?>">
<a class="nav-link" href="calendar.php"><i class="far fa-calendar-alt"></i> Calendar</a>
</li>
<li class="nav-item <?php echo ($current_page == 'resources.php') ? 'active' : ''; ?>">
<a class="nav-link" href="resources.php"><i class="fas fa-book"></i> Resources</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a>
</li>
</ul>
</div>
</nav>

View File

@ -39,19 +39,19 @@ if (isset($_SESSION['user_id'])) {
<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.">
<title>Welcome - Continuum Nexus</title>
<meta name="description" content="Sign in to the Continuum Nexus 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:title" content="Welcome - Continuum Nexus">
<meta property="og:description" content="Sign in to the Continuum Nexus 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:title" content="Welcome - Continuum Nexus">
<meta property="twitter:description" content="Sign in to the Continuum Nexus 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">
@ -61,7 +61,7 @@ if (isset($_SESSION['user_id'])) {
<div class="login-container">
<div class="login-card text-center">
<h1>Continuum of Healing</h1>
<h1>Continuum Nexus</h1>
<p class="subtitle">Please select your portal to continue</p>
<div class="d-grid gap-3">
@ -71,7 +71,7 @@ if (isset($_SESSION['user_id'])) {
</div>
</div>
<div class="footer-text">
&copy; <?php echo date("Y"); ?> Continuum of Healing. Built with Flatlogic.
&copy; <?php echo date("Y"); ?> Continuum Nexus. Built with Flatlogic.
</div>
</div>

View File

@ -44,7 +44,7 @@ $documents = $stmt->fetchAll(PDO::FETCH_ASSOC);
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="partner_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="partner_dashboard.php">Continuum Nexus</a>
<a href="logout.php" class="btn btn-outline-light">Logout</a>
</div>
</nav>

View File

@ -27,7 +27,7 @@ $messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Messages - Continuum of Healing</title>
<title>My Messages - 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="assets/css/custom.css">
</head>
@ -35,7 +35,7 @@ $messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="resident_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="resident_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">

View File

@ -84,7 +84,7 @@ if (!$partner) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Partner Dashboard - Continuum of Healing</title>
<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">
@ -93,7 +93,7 @@ if (!$partner) {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="partner_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="partner_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">

View File

@ -25,14 +25,14 @@ if (!$case_manager) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compose Message - Continuum of Healing</title>
<title>Compose Message - 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="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="resident_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="resident_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">

View File

@ -2,26 +2,44 @@
session_start();
require_once 'db/config.php';
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'resident') {
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'resident') {
header("Location: index.php");
exit;
exit();
}
$pdo = db();
$resident_id = $_SESSION['user_id'];
// Fetch the logged-in resident's data
$stmt = $pdo->prepare("SELECT * FROM residents WHERE user_id = ?");
$stmt->execute([$_SESSION['user_id']]);
$resident = $stmt->fetch(PDO::FETCH_ASSOC);
// Fetch resident's name
$stmt = $pdo->prepare("SELECT name FROM residents WHERE id = ?");
$stmt->execute([$resident_id]);
$resident = $stmt->fetch();
if (!$resident) {
$no_profile_message = "Your profile is not yet linked. Please contact support.";
} else {
// Fetch action plans for the resident
$stmt = $pdo->prepare("SELECT * FROM action_plans WHERE resident_id = ? ORDER BY created_at DESC");
$stmt->execute([$resident['id']]);
$action_plans = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
// Fetch resident's domain scores
$stmt = $pdo->prepare("
SELECT d.name, rds.score
FROM resident_domain_scores rds
JOIN domains d ON rds.domain_id = d.id
WHERE rds.resident_id = ?
ORDER BY d.id
");
$stmt->execute([$resident_id]);
$domain_scores = $stmt->fetchAll();
// Fetch resident's action plans
$stmt = $pdo->prepare("
SELECT ap.id, ap.title, ap.description, ap.status, d.name as domain_name
FROM action_plans ap
JOIN domains d ON ap.domain_id = d.id
WHERE ap.resident_id = ?
ORDER BY ap.created_at DESC
");
$stmt->execute([$resident_id]);
$action_plans = $stmt->fetchAll();
// Fetch resident's case manager for messaging
$stmt = $pdo->prepare("SELECT u.id, u.name, u.email FROM users u JOIN residents r ON u.id = r.case_manager_id WHERE r.id = ?");
$stmt->execute([$resident_id]);
$case_manager = $stmt->fetch();
?>
<!DOCTYPE html>
@ -29,160 +47,127 @@ if (!$resident) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Resident Dashboard - Continuum of Healing</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
<title>Resident Dashboard - Continuum Nexus</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="stylesheet" href="assets/css/custom.css">
<style>
.progress-bar {
color: #212529;
background-color: #e9ecef;
}
.progress-bar-striped {
background-size: 1rem 1rem;
}
.domain-card {
margin-bottom: 20px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="resident_dashboard.php">Continuum of Healing</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" href="resident_dashboard.php">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="messages.php">Messages</a>
</li>
<li class="nav-item">
<a class="nav-link" href="resources.php">Resource Library</a>
</li>
<li class="nav-item">
<a class="nav-link" href="calendar.php">Appointment Calendar</a>
</li>
</ul>
<a href="logout.php" class="btn btn-outline-light">Logout</a>
</div>
</div>
</nav>
<?php include 'includes/resident_header.php'; ?>
<div class="container mt-4">
<?php if (isset($_GET['success']) && $_GET['success'] == 'checkin_saved'): ?>
<div class="alert alert-success">Your check-in has been saved.</div>
<?php endif; ?>
<?php if (isset($_GET['error'])): ?>
<div class="alert alert-danger">There was an error saving your check-in. Please try again.</div>
<?php endif; ?>
<?php if (isset($no_profile_message)): ?>
<div class="alert alert-warning"><?php echo $no_profile_message; ?></div>
<?php elseif (isset($resident)): ?>
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h2">Welcome, <?php echo htmlspecialchars($resident['first_name']); ?>!</h1>
<div class="d-flex justify-content-between align-items-center mb-4">
<h2>Welcome, <?php echo htmlspecialchars($resident['name']); ?>!</h2>
<div>
<?php if ($case_manager): ?>
<a href="resident_compose_message.php?recipient_id=<?php echo $case_manager['id']; ?>" class="btn btn-primary"><i class="fas fa-envelope"></i> Message Case Manager</a>
<?php endif; ?>
<a href="messages.php" class="btn btn-info"><i class="fas fa-inbox"></i> View Messages</a>
</div>
</div>
<div class="row">
<div class="col-md-8">
<!-- Daily Check-in -->
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title mb-0">Daily Check-In</h5>
</div>
<div class="card-body">
<form action="save_check_in.php" method="POST">
<input type="hidden" name="resident_id" value="<?php echo $resident['id']; ?>">
<div class="mb-3">
<label class="form-label">How are you feeling today?</label>
<div class="d-flex justify-content-around mood-selector">
<label class="mood-option"><input type="radio" name="mood_rating" value="1" required><i class="far fa-sad-tear fa-2x"></i></label>
<label class="mood-option"><input type="radio" name="mood_rating" value="2"><i class="far fa-frown fa-2x"></i></label>
<label class="mood-option"><input type="radio" name="mood_rating" value="3"><i class="far fa-meh fa-2x"></i></label>
<label class="mood-option"><input type="radio" name="mood_rating" value="4"><i class="far fa-smile fa-2x"></i></label>
<label class="mood-option"><input type="radio" name="mood_rating" value="5"><i class="far fa-grin-beam fa-2x"></i></label>
<div class="row">
<div class="col-md-12">
<h4>Your Progress Across the 5 Domains</h4>
<div class="row">
<?php foreach ($domain_scores as $domain): ?>
<div class="col-md-6">
<div class="card domain-card">
<div class="card-body">
<h5 class="card-title"><?php echo htmlspecialchars($domain['name']); ?></h5>
<div class="progress" style="height: 25px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: <?php echo htmlspecialchars($domain['score']); ?>%;" aria-valuenow="<?php echo htmlspecialchars($domain['score']); ?>" aria-valuemin="0" aria-valuemax="100">
<strong><?php echo htmlspecialchars($domain['score']); ?>%</strong>
</div>
</div>
</div>
<div class="mb-3">
<label for="journal_entry" class="form-label">Journal Entry (optional)</label>
<textarea name="journal_entry" id="journal_entry" class="form-control" rows="3"></textarea>
</div>
<button type="submit" class="btn btn-primary-custom">Save Check-In</button>
</form>
</div>
</div>
<!-- Your Action Plans Card -->
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title mb-0">Active Action Plans</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Title</th>
<th>Status</th>
<th>Due Date</th>
<th></th>
</tr>
</thead>
<tbody>
<?php if (empty($action_plans)): ?>
<tr>
<td colspan="4" class="text-center">You have no active action plans.</td>
</tr>
<?php else: ?>
<?php foreach ($action_plans as $plan): ?>
<tr>
<td><?php echo htmlspecialchars($plan['title']); ?></td>
<td><span class="badge bg-info text-dark"><?php echo htmlspecialchars($plan['status']); ?></span></td>
<td><?php echo htmlspecialchars($plan['due_date'] ? date("M j, Y", strtotime($plan['due_date'])) : 'N/A'); ?></td>
<td><a href="view_action_plan.php?id=<?php echo $plan['id']; ?>" class="btn btn-sm btn-primary">View</a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="col-.md-4">
<!-- Your Information Card -->
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title mb-0">Your Information</h5>
</div>
<div class="card-body">
<p><strong>Name:</strong> <?php echo htmlspecialchars($resident['first_name'] . ' ' . $resident['last_name']); ?></p>
<p><strong>Program:</strong> <?php echo htmlspecialchars($resident['program']); ?></p>
<p><strong>Status:</strong> <span class="badge bg-success"><?php echo htmlspecialchars($resident['status']); ?></span></p>
</div>
</div>
</div>
<div class="card mt-4">
<div class="card-header">
<h4><i class="fas fa-tasks"></i> Your Active Action Plans</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Title</th>
<th>Domain</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (empty($action_plans)): ?>
<tr>
<td colspan="4">You have no active action plans.</td>
</tr>
<?php else: ?>
<?php foreach ($action_plans as $plan): ?>
<tr>
<td><?php echo htmlspecialchars($plan['title']); ?></td>
<td><span class="badge badge-info"><?php echo htmlspecialchars($plan['domain_name']); ?></span></td>
<td><span class="badge badge-primary"><?php echo htmlspecialchars(ucfirst($plan['status'])); ?></span></td>
<td>
<a href="view_action_plan.php?id=<?php echo $plan['id']; ?>" class="btn btn-sm btn-info">View Details</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-6 mb-4">
<div class="card h-100">
<div class="card-header">
<h4><i class="far fa-calendar-alt"></i> Upcoming Appointments</h4>
</div>
<!-- Personalized Progress Tracker -->
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title mb-0">Your Progress</h5>
</div>
<div class="card-body">
<div>
<label class="form-label">Health</label>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: <?php echo $resident['health_progress'] ?? 0; ?>%;" aria-valuenow="<?php echo $resident['health_progress'] ?? 0; ?>" aria-valuemin="0" aria-valuemax="100"><?php echo $resident['health_progress'] ?? 0; ?>%</div>
</div>
</div>
<div class="mt-3">
<label class="form-label">Housing</label>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: <?php echo $resident['housing_progress'] ?? 0; ?>%;" aria-valuenow="<?php echo $resident['housing_progress'] ?? 0; ?>" aria-valuemin="0" aria-valuemax="100"><?php echo $resident['housing_progress'] ?? 0; ?>%</div>
</div>
</div>
<div class="mt-3">
<label class="form-label">Employment</label>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: <?php echo $resident['employment_progress'] ?? 0; ?>%;" aria-valuenow="<?php echo $resident['employment_progress'] ?? 0; ?>" aria-valuemin="0" aria-valuemax="100"><?php echo $resident['employment_progress'] ?? 0; ?>%</div>
</div>
</div>
</div>
<div class="card-body">
<!-- Placeholder for calendar -->
<p>Your appointment calendar will be displayed here.</p>
<a href="calendar.php" class="btn btn-primary">View Calendar</a>
</div>
</div>
</div>
<?php endif; ?>
<div class="col-md-6 mb-4">
<div class="card h-100">
<div class="card-header">
<h4><i class="fas fa-book"></i> Resource Library</h4>
</div>
<div class="card-body">
<p>Access helpful documents, links, and guides.</p>
<a href="resources.php" class="btn btn-primary">Browse Resources</a>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.2/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
</html>

View File

@ -56,7 +56,7 @@ if (!$resident) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Resident - Continuum of Healing</title>
<title>Edit Resident - 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="assets/css/custom.css">
</head>
@ -64,7 +64,7 @@ if (!$resident) {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="staff_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="staff_dashboard.php">Continuum Nexus</a>
</div>
</nav>

View File

@ -40,7 +40,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Resident Intake - Continuum of Healing</title>
<title>New Resident Intake - 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="assets/css/custom.css">
</head>
@ -48,7 +48,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="staff_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="staff_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">

View File

@ -51,7 +51,7 @@ $case_notes = $case_notes_stmt->fetchAll(PDO::FETCH_ASSOC);
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="staff_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="staff_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">

View File

@ -22,7 +22,7 @@ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Resource Library - Continuum of Healing</title>
<title>Resource Library - 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="assets/css/custom.css">
</head>
@ -30,7 +30,7 @@ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="resident_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="resident_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">

View File

@ -11,41 +11,51 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'staff') {
$pdo = db();
// -- Analytics & Alerts --
// Fetch summary metrics
$total_residents = $pdo->query("SELECT count(*) FROM residents")->fetchColumn();
$active_residents = $pdo->query("SELECT count(*) FROM residents WHERE status = 'Active'")->fetchColumn();
$high_risk_residents = $pdo->query("SELECT count(*) FROM residents WHERE risk_level = 'High'")->fetchColumn();
// Fetch high-risk residents for the alert panel
$high_risk_alert_stmt = $pdo->query("SELECT id, first_name, last_name, program FROM residents WHERE risk_level = 'High' ORDER BY last_name, first_name LIMIT 5");
$high_risk_alerts = $high_risk_alert_stmt->fetchAll(PDO::FETCH_ASSOC);
// -- Fetch Domains --
$domain_stmt = $pdo->query("SELECT * FROM domains ORDER BY id");
$domains = $domain_stmt->fetchAll(PDO::FETCH_ASSOC);
// -- Get active domain --
$active_domain_id = $_GET['domain_id'] ?? $domains[0]['id'] ?? 1;
// -- Filtering --
$program_filter = $_GET['program'] ?? '';
$risk_filter = $_GET['risk_level'] ?? '';
$status_filter = $_GET['status'] ?? '';
$base_sql = "SELECT r.id, r.first_name, r.last_name, r.status, r.program, r.risk_level, COALESCE(rdp.progress, 0) as progress
FROM residents r
LEFT JOIN resident_domain_progress rdp ON r.id = rdp.resident_id AND rdp.domain_id = ?";
$params = [$active_domain_id];
$where_clauses = [];
$params = [];
if ($program_filter) {
$where_clauses[] = "program = ?";
$where_clauses[] = "r.program = ?";
$params[] = $program_filter;
}
if ($risk_filter) {
$where_clauses[] = "risk_level = ?";
$where_clauses[] = "r.risk_level = ?";
$params[] = $risk_filter;
}
if ($status_filter) {
$where_clauses[] = "status = ?";
$where_clauses[] = "r.status = ?";
$params[] = $status_filter;
}
$sql = "SELECT id, first_name, last_name, status, program, risk_level, health_progress, housing_progress, employment_progress FROM residents";
$sql = $base_sql;
if (!empty($where_clauses)) {
$sql .= " WHERE " . implode(' AND ', $where_clauses);
}
$sql .= " ORDER BY last_name, first_name";
$sql .= " ORDER BY r.last_name, r.first_name";
$stmt = $pdo->prepare($sql);
$stmt->execute($params);
@ -62,7 +72,7 @@ $statuses = $pdo->query("SELECT DISTINCT status FROM residents ORDER BY status")
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Staff Dashboard | Continuum of Healing</title>
<title>Staff 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">
@ -71,7 +81,7 @@ $statuses = $pdo->query("SELECT DISTINCT status FROM residents ORDER BY status")
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="staff_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="staff_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>
@ -121,121 +131,122 @@ $statuses = $pdo->query("SELECT DISTINCT status FROM residents ORDER BY status")
</div>
<div class="row">
<!-- Main Content: Resident List -->
<!-- Main Content: Domain Tabs -->
<div class="col-lg-8">
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<span>All Residents</span>
<div>
<button class="btn btn-sm btn-outline-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
<i class="bi bi-funnel me-1"></i> Filters
</button>
<a href="export_residents.php" id="export-csv-btn" class="btn btn-sm btn-outline-success">
<i class="bi bi-download me-1"></i> Export CSV
</a>
</div>
</div>
<ul class="nav nav-tabs card-header-tabs" id="domainTabs" role="tablist">
<?php foreach ($domains as $domain): ?>
<li class="nav-item" role="presentation">
<a class="nav-link <?php echo ($domain['id'] == $active_domain_id) ? 'active' : ''; ?>" href="?domain_id=<?php echo $domain['id']; ?>" role="tab"><?php echo htmlspecialchars($domain['name']); ?></a>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="card-body">
<!-- Filter Form -->
<div class="collapse" id="filterCollapse">
<form method="GET" action="staff_dashboard.php" class="mb-4">
<div class="row">
<div class="col-md-4">
<label for="program" class="form-label">Program</label>
<select name="program" id="program" class="form-select">
<option value="">All</option>
<?php foreach ($programs as $p): ?>
<option value="<?php echo htmlspecialchars($p); ?>" <?php echo ($program_filter === $p) ? 'selected' : ''; ?>><?php echo htmlspecialchars($p); ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-md-4">
<label for="risk_level" class="form-label">Risk Level</label>
<select name="risk_level" id="risk_level" class="form-select">
<option value="">All</option>
<?php foreach ($risk_levels as $r): ?>
<option value="<?php echo htmlspecialchars($r); ?>" <?php echo ($risk_filter === $r) ? 'selected' : ''; ?>><?php echo htmlspecialchars($r); ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-md-4">
<label for="status" class="form-label">Status</label>
<select name="status" id="status" class="form-select">
<option value="">All</option>
<?php foreach ($statuses as $s): ?>
<option value="<?php echo htmlspecialchars($s); ?>" <?php echo ($status_filter === $s) ? 'selected' : ''; ?>><?php echo htmlspecialchars($s); ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="tab-content" id="domainTabsContent">
<div class="tab-pane fade show active" role="tabpanel">
<!-- Filter Form -->
<div class="d-flex justify-content-end mb-3">
<button class="btn btn-sm btn-outline-secondary me-2" type="button" data-bs-toggle="collapse" data-bs-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
<i class="bi bi-funnel me-1"></i> Filters
</button>
<a href="#" id="export-csv-btn" class="btn btn-sm btn-outline-success">
<i class="bi bi-download me-1"></i> Export CSV
</a>
</div>
<div class="mt-2 text-end">
<a href="staff_dashboard.php" class="btn btn-secondary">Reset</a>
<button type="submit" class="btn btn-primary-custom">Filter</button>
<div class="collapse" id="filterCollapse">
<form method="GET" action="staff_dashboard.php" class="mb-4">
<input type="hidden" name="domain_id" value="<?php echo $active_domain_id; ?>">
<div class="row">
<div class="col-md-4">
<label for="program" class="form-label">Program</label>
<select name="program" id="program" class="form-select">
<option value="">All</option>
<?php foreach ($programs as $p): ?>
<option value="<?php echo htmlspecialchars($p); ?>" <?php echo ($program_filter === $p) ? 'selected' : ''; ?>><?php echo htmlspecialchars($p); ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-md-4">
<label for="risk_level" class="form-label">Risk Level</label>
<select name="risk_level" id="risk_level" class="form-select">
<option value="">All</option>
<?php foreach ($risk_levels as $r): ?>
<option value="<?php echo htmlspecialchars($r); ?>" <?php echo ($risk_filter === $r) ? 'selected' : ''; ?>><?php echo htmlspecialchars($r); ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-md-4">
<label for="status" class="form-label">Status</label>
<select name="status" id="status" class="form-select">
<option value="">All</option>
<?php foreach ($statuses as $s): ?>
<option value="<?php echo htmlspecialchars($s); ?>" <?php echo ($status_filter === $s) ? 'selected' : ''; ?>><?php echo htmlspecialchars($s); ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="mt-2 text-end">
<a href="staff_dashboard.php?domain_id=<?php echo $active_domain_id; ?>" class="btn btn-secondary">Reset</a>
<button type="submit" class="btn btn-primary-custom">Filter</button>
</div>
</form>
</div>
</form>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Program</th>
<th>Risk Level</th>
<th>Continuum</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (!empty($residents)): ?>
<?php foreach ($residents as $resident): ?>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<td><?php echo htmlspecialchars($resident['first_name'] . ' ' . $resident['last_name']); ?></td>
<td><?php echo htmlspecialchars($resident['program']); ?></td>
<td>
<?php
$risk_color = 'secondary';
if ($resident['risk_level'] === 'High') $risk_color = 'danger';
if ($resident['risk_level'] === 'Medium') $risk_color = 'warning';
?>
<span class="badge bg-<?php echo $risk_color; ?>"><?php echo htmlspecialchars($resident['risk_level']); ?></span>
</td>
<td>
<div class="d-flex flex-column">
<div class="progress" style="height: 5px; margin-bottom: 2px;" title="Health: <?php echo $resident['health_progress']; ?>%">
<div class="progress-bar bg-success" role="progressbar" style="width: <?php echo $resident['health_progress']; ?>%;" aria-valuenow="<?php echo $resident['health_progress']; ?>" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress" style="height: 5px; margin-bottom: 2px;" title="Housing: <?php echo $resident['housing_progress']; ?>%">
<div class="progress-bar bg-primary" role="progressbar" style="width: <?php echo $resident['housing_progress']; ?>%;" aria-valuenow="<?php echo $resident['housing_progress']; ?>" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress" style="height: 5px;" title="Employment: <?php echo $resident['employment_progress']; ?>%">
<div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo $resident['employment_progress']; ?>%;" aria-valuenow="<?php echo $resident['employment_progress']; ?>" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</td>
<td>
<?php
$status_color = 'primary';
if ($resident['status'] === 'Inactive') $status_color = 'secondary';
if ($resident['status'] === 'Stabilized') $status_color = 'success';
?>
<span class="badge bg-<?php echo $status_color; ?>"><?php echo htmlspecialchars($resident['status']); ?></span>
</td>
<td>
<a href="resident_view.php?id=<?php echo $resident['id']; ?>" class="btn btn-sm btn-outline-primary">View</a>
</td>
<th>Name</th>
<th>Program</th>
<th>Risk Level</th>
<th>Progress</th>
<th>Status</th>
<th>Action</th>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="6" class="text-center">No residents found matching your criteria.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</thead>
<tbody>
<?php if (!empty($residents)): ?>
<?php foreach ($residents as $resident): ?>
<tr>
<td><?php echo htmlspecialchars($resident['first_name'] . ' ' . $resident['last_name']); ?></td>
<td><?php echo htmlspecialchars($resident['program']); ?></td>
<td>
<?php
$risk_color = 'secondary';
if ($resident['risk_level'] === 'High') $risk_color = 'danger';
if ($resident['risk_level'] === 'Medium') $risk_color = 'warning';
?>
<span class="badge bg-<?php echo $risk_color; ?>"><?php echo htmlspecialchars($resident['risk_level']); ?></span>
</td>
<td>
<div class="progress" style="height: 20px;">
<div class="progress-bar" role="progressbar" style="width: <?php echo $resident['progress']; ?>%;" aria-valuenow="<?php echo $resident['progress']; ?>" aria-valuemin="0" aria-valuemax="100"><?php echo $resident['progress']; ?>%</div>
</div>
</td>
<td>
<?php
$status_color = 'primary';
if ($resident['status'] === 'Inactive') $status_color = 'secondary';
if ($resident['status'] === 'Stabilized') $status_color = 'success';
?>
<span class="badge bg-<?php echo $status_color; ?>"><?php echo htmlspecialchars($resident['status']); ?></span>
</td>
<td>
<a href="resident_view.php?id=<?php echo $resident['id']; ?>" class="btn btn-sm btn-outline-primary">View</a>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="6" class="text-center">No residents found matching your criteria.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@ -274,11 +285,13 @@ $statuses = $pdo->query("SELECT DISTINCT status FROM residents ORDER BY status")
const program = document.getElementById('program').value;
const riskLevel = document.getElementById('risk_level').value;
const status = document.getElementById('status').value;
const domainId = new URLSearchParams(window.location.search).get('domain_id') || '<?php echo $domains[0]['id'] ?? 1; ?>';
const params = new URLSearchParams();
if (program) params.append('program', program);
if (riskLevel) params.append('risk_level', riskLevel);
if (status) params.append('status', status);
params.append('domain_id', domainId);
const url = 'export_residents.php?' + params.toString();
window.location.href = url;

View File

@ -56,7 +56,7 @@ if ($_SESSION['user_role'] === 'resident') {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Action Plan - Continuum of Healing</title>
<title>View Action Plan - 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="assets/css/custom.css">
</head>
@ -64,7 +64,7 @@ if ($_SESSION['user_role'] === 'resident') {
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">Continuum of Healing</a>
<a class="navbar-brand" href="#">Continuum Nexus</a>
</div>
</nav>

View File

@ -64,14 +64,14 @@ if ($user_role === 'staff') {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Message - Continuum of Healing</title>
<title>View Message - 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="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="resident_dashboard.php">Continuum of Healing</a>
<a class="navbar-brand" href="resident_dashboard.php">Continuum Nexus</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">