LPA Health - V1.1
This commit is contained in:
parent
8ea8ea0809
commit
efd6077fc9
189
admin_dashboard.php
Normal file
189
admin_dashboard.php
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
if (!isset($_SESSION["user_id"]) || ($_SESSION["user_role"] ?? '') !== 'Super User') {
|
||||||
|
header("Location: login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once 'db/config.php';
|
||||||
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
|
|
||||||
|
$users_count = 0;
|
||||||
|
$lpas_count = 0;
|
||||||
|
$users = [];
|
||||||
|
$lpas = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Get stats
|
||||||
|
$users_count = db()->query("SELECT COUNT(*) FROM users")->fetchColumn();
|
||||||
|
$lpas_count = db()->query("SELECT COUNT(*) FROM lpa_applications")->fetchColumn();
|
||||||
|
|
||||||
|
// Get all users
|
||||||
|
$users = db()->query("SELECT * FROM users ORDER BY created_at DESC LIMIT 50")->fetchAll();
|
||||||
|
|
||||||
|
// Get all LPAs
|
||||||
|
$lpas = db()->query("SELECT * FROM lpa_applications ORDER BY created_at DESC LIMIT 50")->fetchAll();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
error_log($e->getMessage());
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Admin Dashboard — <?php echo htmlspecialchars($project_name); ?></title>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<link href="assets/css/custom.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body class="bg-light">
|
||||||
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
|
<div class="container">
|
||||||
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
||||||
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
|
</a>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<span class="me-3 d-none d-md-inline text-muted small">Logged in as Admin: <?php echo htmlspecialchars($_SESSION['user_name'] ?? $_SESSION['user_email']); ?></span>
|
||||||
|
<a href="/logout.php" class="btn btn-outline-secondary btn-sm px-3 rounded-pill">Logout</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="container py-5">
|
||||||
|
<div class="row mb-5">
|
||||||
|
<div class="col">
|
||||||
|
<h1 class="h3 fw-bold mb-1">System Administration</h1>
|
||||||
|
<p class="text-muted small mb-0">Overview of all users and applications in the system.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row g-4 mb-5">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="card border-0 shadow-sm p-4">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-primary-subtle text-primary p-3 rounded-3 me-3">
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h6 class="text-muted small text-uppercase fw-bold mb-1">Total Users</h6>
|
||||||
|
<h2 class="fw-bold mb-0"><?php echo number_format($users_count); ?></h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="card border-0 shadow-sm p-4">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-success-subtle text-success p-3 rounded-3 me-3">
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h6 class="text-muted small text-uppercase fw-bold mb-1">Total Applications</h6>
|
||||||
|
<h2 class="fw-bold mb-0"><?php echo number_format($lpas_count); ?></h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row g-4">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card border-0 shadow-sm">
|
||||||
|
<div class="card-header bg-white py-3 border-bottom-0">
|
||||||
|
<h5 class="fw-bold mb-0">Recent Users</h5>
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="bg-light">
|
||||||
|
<tr class="small text-uppercase tracking-wider">
|
||||||
|
<th class="ps-4">Name</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Role</th>
|
||||||
|
<th>Verified</th>
|
||||||
|
<th class="text-end pe-4">Joined</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($users as $u): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="ps-4 fw-medium"><?php echo htmlspecialchars($u['name'] ?? 'N/A'); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($u['email']); ?></td>
|
||||||
|
<td>
|
||||||
|
<span class="badge rounded-pill <?php echo $u['role'] === 'Super User' ? 'bg-danger-subtle text-danger' : 'bg-secondary-subtle text-secondary'; ?>">
|
||||||
|
<?php echo htmlspecialchars($u['role']); ?>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php if ($u['is_verified']): ?>
|
||||||
|
<span class="text-success small">
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-1"><polyline points="20 6 9 17 4 12"></polyline></svg>Yes
|
||||||
|
</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="text-muted small">No</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td class="text-end pe-4 text-muted small"><?php echo date('M d, Y', strtotime($u['created_at'])); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-12 mt-5">
|
||||||
|
<div class="card border-0 shadow-sm">
|
||||||
|
<div class="card-header bg-white py-3 border-bottom-0">
|
||||||
|
<h5 class="fw-bold mb-0">Recent Applications</h5>
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="bg-light">
|
||||||
|
<tr class="small text-uppercase tracking-wider">
|
||||||
|
<th class="ps-4">Type</th>
|
||||||
|
<th>Donor</th>
|
||||||
|
<th>Progress</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th class="text-end pe-4">Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (count($lpas) > 0): ?>
|
||||||
|
<?php foreach ($lpas as $lpa): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="ps-4">
|
||||||
|
<div class="fw-bold mb-0"><?php echo htmlspecialchars($lpa['lpa_type']); ?></div>
|
||||||
|
<div class="text-muted small">ID: #<?php echo $lpa['id']; ?></div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="fw-medium"><?php echo htmlspecialchars($lpa['donor_name']); ?></div>
|
||||||
|
<div class="text-muted small"><?php echo htmlspecialchars($lpa['customer_email']); ?></div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="progress" style="height: 6px; width: 100px;">
|
||||||
|
<?php $percent = round(($lpa['step_reached'] / 14) * 100); ?>
|
||||||
|
<div class="progress-bar bg-primary" role="progressbar" style="width: <?php echo $percent; ?>%"></div>
|
||||||
|
</div>
|
||||||
|
<span class="small text-muted"><?php echo $percent; ?>%</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="badge rounded-pill bg-info-subtle text-info"><?php echo ucfirst($lpa['status']); ?></span>
|
||||||
|
</td>
|
||||||
|
<td class="text-end pe-4">
|
||||||
|
<a href="api/generate_pdf.php?id=<?php echo $lpa['id']; ?>" class="btn btn-sm btn-outline-primary px-3 rounded-pill">PDF</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<tr><td colspan="5" class="text-center py-4">No applications found.</td></tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -7,7 +7,7 @@ if (!isset($_SESSION["user_id"])) {
|
|||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
|
|
||||||
$step = isset($_GET['step']) ? (int)$_GET['step'] : 1;
|
$step = isset($_GET['step']) ? (int)$_GET['step'] : 1;
|
||||||
$lpa_id = isset($_GET['id']) ? (int)$_GET['id'] : null;
|
$lpa_id = isset($_GET['id']) ? (int)$_GET['id'] : null;
|
||||||
@ -128,8 +128,7 @@ foreach ($notified_persons as $np) {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand d-flex align-items-center" href="/">
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<span class="me-3 d-none d-md-inline text-muted small">Logged in as: <?php echo htmlspecialchars($_SESSION['user_name'] ?? $_SESSION['user_email']); ?></span>
|
<span class="me-3 d-none d-md-inline text-muted small">Logged in as: <?php echo htmlspecialchars($_SESSION['user_name'] ?? $_SESSION['user_email']); ?></span>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ if (!isset($_SESSION["user_id"])) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
|
|
||||||
$step = isset($_GET['step']) ? (int)$_GET['step'] : 1;
|
$step = isset($_GET['step']) ? (int)$_GET['step'] : 1;
|
||||||
$lpa_id = isset($_GET['id']) ? (int)$_GET['id'] : null;
|
$lpa_id = isset($_GET['id']) ? (int)$_GET['id'] : null;
|
||||||
@ -106,8 +106,8 @@ foreach ($notified_persons as $np) {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand d-flex align-items-center" href="/">
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<a href="/dashboard.php" class="btn btn-sm btn-link text-decoration-none text-muted me-2">Back to Dashboard</a>
|
<a href="/dashboard.php" class="btn btn-sm btn-link text-decoration-none text-muted me-2">Back to Dashboard</a>
|
||||||
|
|||||||
BIN
assets/pasted-20260228-235417-eedda424.png
Normal file
BIN
assets/pasted-20260228-235417-eedda424.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@ -5,7 +5,7 @@ if (!isset($_SESSION["user_id"])) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
|
|
||||||
$lpas = [];
|
$lpas = [];
|
||||||
try {
|
try {
|
||||||
@ -29,11 +29,13 @@ try {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand d-flex align-items-center" href="/">
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<span class="me-3 d-none d-md-inline text-muted small">Logged in as: <?php echo htmlspecialchars($_SESSION['user_name'] ?? $_SESSION['user_email']); ?></span>
|
<span class="me-3 d-none d-md-inline text-muted small">Logged in as: <?php echo htmlspecialchars($_SESSION['user_name'] ?? $_SESSION['user_email']); ?></span>
|
||||||
|
<?php if (($_SESSION['user_role'] ?? '') === 'Super User'): ?>
|
||||||
|
<a href="/admin_dashboard.php" class="btn btn-danger btn-sm px-3 rounded-pill me-2">Admin Panel</a>
|
||||||
|
<?php endif; ?>
|
||||||
<a href="/apply.php" class="btn btn-primary btn-sm px-3 rounded-pill me-2">Start New LPA</a>
|
<a href="/apply.php" class="btn btn-primary btn-sm px-3 rounded-pill me-2">Start New LPA</a>
|
||||||
<a href="/logout.php" class="btn btn-outline-secondary btn-sm px-3 rounded-pill">Logout</a>
|
<a href="/logout.php" class="btn btn-outline-secondary btn-sm px-3 rounded-pill">Logout</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
2
db/migrations/04_add_role_column.sql
Normal file
2
db/migrations/04_add_role_column.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
-- Migration to add role column to users table
|
||||||
|
ALTER TABLE users ADD COLUMN role ENUM('Standard User', 'Super User') DEFAULT 'Standard User' AFTER verification_token;
|
||||||
@ -3,7 +3,7 @@ session_start();
|
|||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
require_once 'mail/MailService.php';
|
require_once 'mail/MailService.php';
|
||||||
|
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$error = '';
|
$error = '';
|
||||||
$success = '';
|
$success = '';
|
||||||
|
|
||||||
@ -74,8 +74,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container justify-content-center">
|
<div class="container justify-content-center">
|
||||||
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold fs-4"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$project_desc = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Create your UK Lasting Power of Attorney in minutes.';
|
$project_desc = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Create your UK Lasting Power of Attorney in minutes.';
|
||||||
$project_img = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
$project_img = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||||
?>
|
?>
|
||||||
@ -28,8 +28,7 @@ $project_img = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|||||||
<nav class="navbar navbar-expand-lg">
|
<nav class="navbar navbar-expand-lg">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand d-flex align-items-center" href="/">
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
<?php if (isset($_SESSION['user_id'])): ?>
|
||||||
|
|||||||
13
login.php
13
login.php
@ -2,7 +2,7 @@
|
|||||||
session_start();
|
session_start();
|
||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
|
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$error = '';
|
$error = '';
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
@ -27,7 +27,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
$_SESSION['user_id'] = $user['id'];
|
$_SESSION['user_id'] = $user['id'];
|
||||||
$_SESSION['user_email'] = $user['email'];
|
$_SESSION['user_email'] = $user['email'];
|
||||||
$_SESSION['user_name'] = $user['name'] ?? 'User';
|
$_SESSION['user_name'] = $user['name'] ?? 'User';
|
||||||
header('Location: apply.php');
|
$_SESSION['user_role'] = $user['role'] ?? 'Standard User';
|
||||||
|
|
||||||
|
if ($_SESSION['user_role'] === 'Super User') {
|
||||||
|
header('Location: admin_dashboard.php');
|
||||||
|
} else {
|
||||||
|
header('Location: apply.php');
|
||||||
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -49,8 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container justify-content-center">
|
<div class="container justify-content-center">
|
||||||
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold fs-4"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ session_start();
|
|||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
require_once 'mail/MailService.php';
|
require_once 'mail/MailService.php';
|
||||||
|
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$error = '';
|
$error = '';
|
||||||
$success = '';
|
$success = '';
|
||||||
|
|
||||||
@ -77,8 +77,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' || isset($_GET['email'])) {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container justify-content-center">
|
<div class="container justify-content-center">
|
||||||
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold fs-4"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
session_start();
|
session_start();
|
||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
|
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$token = $_GET['token'] ?? ($_POST['token'] ?? '');
|
$token = $_GET['token'] ?? ($_POST['token'] ?? '');
|
||||||
$error = '';
|
$error = '';
|
||||||
$success = '';
|
$success = '';
|
||||||
@ -50,8 +50,7 @@ if (!$user) {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container justify-content-center">
|
<div class="container justify-content-center">
|
||||||
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold fs-4"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ session_start();
|
|||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
require_once 'mail/MailService.php';
|
require_once 'mail/MailService.php';
|
||||||
|
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$error = '';
|
$error = '';
|
||||||
$success = '';
|
$success = '';
|
||||||
|
|
||||||
@ -80,8 +80,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container justify-content-center">
|
<div class="container justify-content-center">
|
||||||
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold fs-4"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@ -14,8 +14,7 @@ $project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand d-flex align-items-center" href="/">
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
require_once 'mail/MailService.php';
|
require_once 'mail/MailService.php';
|
||||||
|
|
||||||
$to = 'neel@neel.me.uk';
|
$to = 'neel@neel.me.uk';
|
||||||
$subject = 'Test Email from ' . ($_SERVER['PROJECT_NAME'] ?? 'LPA Builder');
|
$subject = 'Test Email from ' . ($_SERVER['PROJECT_NAME'] ?? 'LPA Online');
|
||||||
$html = '<h1>Test</h1><p>This is a test email to verify mail functionality.</p>';
|
$html = '<h1>Test</h1><p>This is a test email to verify mail functionality.</p>';
|
||||||
$text = 'Test: This is a test email to verify mail functionality.';
|
$text = 'Test: This is a test email to verify mail functionality.';
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
session_start();
|
session_start();
|
||||||
require_once 'db/config.php';
|
require_once 'db/config.php';
|
||||||
|
|
||||||
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Builder';
|
$project_name = $_SERVER['PROJECT_NAME'] ?? 'LPA Online';
|
||||||
$token = $_GET['token'] ?? '';
|
$token = $_GET['token'] ?? '';
|
||||||
$error = '';
|
$error = '';
|
||||||
$success = '';
|
$success = '';
|
||||||
@ -40,8 +40,7 @@ if (empty($token)) {
|
|||||||
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
<nav class="navbar navbar-expand-lg bg-white border-bottom shadow-sm">
|
||||||
<div class="container justify-content-center">
|
<div class="container justify-content-center">
|
||||||
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
<a class="navbar-brand d-flex align-items-center m-0" href="/">
|
||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-2 text-primary"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
|
<img src="assets/pasted-20260228-235417-eedda424.png" alt="<?php echo htmlspecialchars($project_name); ?>" height="40">
|
||||||
<span class="fw-bold fs-4"><?php echo htmlspecialchars($project_name); ?></span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user