From 5152f907037383db4927c2fc2d4b5a0e810c941f Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Wed, 29 Oct 2025 00:24:58 +0000 Subject: [PATCH] Draft 1: 10/28/25 --- assets/css/custom.css | 315 +++++++++++++++++++++++++++++++++++++++++ index.php | 244 +++++++++++++------------------ logout.php | 7 + resident_dashboard.php | 94 ++++++++++++ resident_view.php | 98 +++++++++++++ staff_dashboard.php | 106 ++++++++++++++ 6 files changed, 722 insertions(+), 142 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 logout.php create mode 100644 resident_dashboard.php create mode 100644 resident_view.php create mode 100644 staff_dashboard.php diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..2e4b83a --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,315 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap'); + +:root { + --primary-color: #3B82F6; + --secondary-color: #10B981; + --bg-color: #F9FAFB; + --surface-color: #FFFFFF; + --text-color: #1F2937; + --light-gray: #6B7280; + + --primary-color-staff: #3B82F6; + --secondary-color-resident: #10B981; + --text-color-dark: #1F2937; + --text-color-light: #6B7280; + --background-light: #F9FAFB; + --surface-white: #FFFFFF; + --border-color: #E5E7EB; +} + +body.login-page { + font-family: 'Inter', sans-serif; + background-color: var(--bg-color); + color: var(--text-color); + display: flex; + align-items: center; + justify-content: center; + min-height: 100vh; + margin: 0; +} + +.login-container { + max-width: 480px; + width: 100%; + padding: 2rem; +} + +.login-card { + background-color: var(--surface-color); + border-radius: 0.75rem; + padding: 3rem; + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + text-align: center; +} + +.login-card h1 { + font-weight: 600; + font-size: 1.5rem; + margin-bottom: 0.5rem; +} + +.login-card .subtitle { + color: var(--light-gray); + margin-bottom: 2.5rem; +} + +.btn-block { + display: block; + width: 100%; + padding: 1rem; + font-size: 1rem; + font-weight: 500; + border-radius: 0.5rem; + text-decoration: none; + transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out; +} + +.btn-block:hover { + transform: translateY(-2px); + box-shadow: 0 4px 8px rgba(0,0,0,0.1); +} + +.btn-resident { + background-color: var(--secondary-color); + color: white; + margin-bottom: 1rem; +} + +.btn-staff { + background-color: var(--primary-color); + color: white; +} + +.footer-text { + text-align: center; + margin-top: 2rem; + color: var(--light-gray); + font-size: 0.875rem; +} + +/* Landing Page Styles */ +body:not(.login-page) { + font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + background-color: var(--surface-white); + color: var(--text-color-dark); + margin: 0; + line-height: 1.6; +} + +.container { + max-width: 1200px; + margin: 0 auto; + padding: 0 1.5rem; +} + +/* Header */ +.site-header { + background-color: var(--surface-white); + box-shadow: 0 2px 4px rgba(0,0,0,0.05); + padding: 1rem 0; + position: sticky; + top: 0; + z-index: 100; +} + +.site-header .container { + display: flex; + justify-content: space-between; + align-items: center; +} + +.site-header .logo { + font-size: 1.5rem; + font-weight: 700; + color: var(--text-color-dark); + font-family: 'Nunito', sans-serif; +} + +.site-header nav { + display: flex; + align-items: center; + gap: 1.5rem; +} + +.site-header nav a { + text-decoration: none; + color: var(--text-color-light); + font-weight: 600; + transition: color 0.3s ease; +} + +.site-header nav a:hover { + color: var(--primary-color-staff); +} + +.button { + padding: 0.75rem 1.5rem; + border-radius: 0.5rem; + text-decoration: none; + font-weight: 600; + transition: all 0.3s ease; + display: inline-block; +} + +.button-primary { + background-color: var(--primary-color-staff); + color: white; +} + +.button-primary:hover { + background-color: #2563EB; + transform: translateY(-2px); + box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); +} + +.button-secondary { + background-color: var(--secondary-color-resident); + color: white; +} + +.button-secondary:hover { + background-color: #059669; + transform: translateY(-2px); + box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); +} + + +/* Hero Section */ +.hero { + background: linear-gradient(to right, #EAF4FB, #EAF7EF); + padding: 6rem 0; + text-align: left; +} + +.hero-container { + display: grid; + grid-template-columns: 1fr 1fr; + align-items: center; + gap: 4rem; +} + +.hero-text h1 { + font-family: 'Nunito', sans-serif; + font-size: 3rem; + font-weight: 700; + line-height: 1.2; + margin-bottom: 1rem; + color: var(--text-color-dark); +} + +.hero-text p { + font-size: 1.125rem; + color: var(--text-color-light); + margin-bottom: 2rem; +} + +.hero-buttons { + display: flex; + gap: 1rem; +} + +.hero-image img { + width: 100%; + border-radius: 0.75rem; + box-shadow: 0 10px 25px rgba(0,0,0,0.1); +} + +/* Mission Section */ +.mission-section { + padding: 6rem 0; + background-color: var(--surface-white); +} + +.mission-container { + display: grid; + grid-template-columns: 1fr 1fr; + align-items: center; + gap: 4rem; +} + +.mission-text h2 { + font-family: 'Nunito', sans-serif; + font-size: 2.5rem; + font-weight: 700; + margin-bottom: 1.5rem; + color: var(--text-color-dark); +} + +.mission-text blockquote { + font-size: 1.25rem; + font-style: italic; + color: var(--text-color-light); + border-left: 4px solid var(--secondary-color-resident); + padding-left: 1.5rem; + margin: 0 0 2rem 0; +} + +.cta-link { + font-weight: 600; + color: var(--primary-color-staff); + text-decoration: none; +} + +.cta-link:hover { + text-decoration: underline; +} + +.mission-image img { + width: 100%; + border-radius: 0.75rem; +} + +/* How It Works Section */ +.how-it-works-section { + padding: 6rem 0; + background-color: var(--background-light); + text-align: center; +} + +.how-it-works-section h2 { + font-family: 'Nunito', sans-serif; + font-size: 2.5rem; + font-weight: 700; + margin-bottom: 1rem; +} + +.how-it-works-section p { + font-size: 1.125rem; + color: var(--text-color-light); + max-width: 600px; + margin: 0 auto; +} + +/* Footer */ +.site-footer-main { + background-color: var(--text-color-dark); + color: var(--background-light); + padding: 2rem 0; + text-align: center; +} + +/* Login Form Styles */ +.btn-primary-custom { + background-color: var(--primary-color); + color: white; + border: none; +} + +.btn-primary-custom:hover { + background-color: #2563EB; +} + +.login-card .form-footer { + margin-top: 1.5rem; + font-size: 0.9rem; +} + +.login-card .form-footer a { + color: var(--light-gray); + text-decoration: none; +} + +.login-card .form-footer a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..4c380e6 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,110 @@ prepare("SELECT * FROM users WHERE email = ?"); + $stmt->execute([$_POST['email']]); + $user = $stmt->fetch(); + + if ($user && password_verify($_POST['password'], $user['password'])) { + // Password is correct, start session + $_SESSION['user_id'] = $user['id']; + $_SESSION['user_email'] = $user['email']; + $_SESSION['user_role'] = $user['role']; + + // Redirect to the appropriate dashboard + if ($user['role'] === 'staff') { + header("Location: staff_dashboard.php"); + } else { + header("Location: resident_dashboard.php"); + } + exit; + } else { + $error_message = 'Invalid email or password.'; + } + } catch (PDOException $e) { + $error_message = 'Database error. Please try again later.'; + // In a real app, you would log this error + } + } +} ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + + Login - Continuum of Healing + + + + + + + + + + + + + + + + - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + + -
- + + - + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..3a0a043 --- /dev/null +++ b/logout.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/resident_dashboard.php b/resident_dashboard.php new file mode 100644 index 0000000..cf8d5ce --- /dev/null +++ b/resident_dashboard.php @@ -0,0 +1,94 @@ +prepare("SELECT * FROM residents WHERE user_id = ?"); + $stmt->execute([$_SESSION['user_id']]); + $resident = $stmt->fetch(PDO::FETCH_ASSOC); + + // If no resident profile is linked to this user account, show a message. + if (!$resident) { + $no_profile_message = "Your profile is not yet linked. Please contact support."; + } + +} catch (PDOException $e) { + $error_message = "Error fetching your data."; +} + +?> + + + + + + Resident Dashboard | Continuum of Healing + + + + + + + +
+
+ +

Welcome, !

+ +

Welcome, Resident!

+ +
+ + +
+ +
+ +
+
+ Your Progress +
+
+
+
+

Name:

+

Program:

+
+
+

Status:

+

Last Check-in:

+
+
+
+
+ +
+ + + + diff --git a/resident_view.php b/resident_view.php new file mode 100644 index 0000000..b4db2ee --- /dev/null +++ b/resident_view.php @@ -0,0 +1,98 @@ +prepare("SELECT * FROM residents WHERE id = ?"); + $stmt->execute([$resident_id]); + $resident = $stmt->fetch(PDO::FETCH_ASSOC); + + if (!$resident) { + // No resident found, redirect + header("Location: staff_dashboard.php"); + exit; + } + +} catch (PDOException $e) { + $error_message = "Error fetching resident data."; +} + +?> + + + + + + View Resident | Continuum of Healing + + + + + + + +
+
+

Resident Details

+ « Back to Dashboard +
+ + +
+ +
+
+ Viewing +
+
+
+
+

Name:

+

Program:

+
+
+

Status:

+

Last Check-in:

+
+
+
+
+ +
+ + + + diff --git a/staff_dashboard.php b/staff_dashboard.php new file mode 100644 index 0000000..afc4635 --- /dev/null +++ b/staff_dashboard.php @@ -0,0 +1,106 @@ +query("SELECT id, first_name, last_name, status, program FROM residents ORDER BY last_name, first_name"); + $residents = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + // Handle DB error - for now, just show a simple message + $error_message = "Error fetching resident data."; + // In a real app, you'd log this error. +} + +?> + + + + + + Staff Dashboard | Continuum of Healing + + + + + + + +
+
+

Continuum Control Center

+
+ + +
+ + +
+
+ All Residents +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameProgramStatusAction
+ View +
No residents found.
+
+
+
+
+ + + +