Autosave: 20260213-095412
This commit is contained in:
parent
ad3177ebeb
commit
0649f8fffd
@ -16,11 +16,11 @@ if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$subject = "SMTP Test Email - CharityHub";
|
||||
$orgName = get_org_name();
|
||||
$subject = "SMTP Test Email - " . $orgName;
|
||||
$htmlBody = "<h1>Test Successful!</h1><p>If you are reading this, your SMTP configuration is working correctly.</p><p>Sent at: " . date('Y-m-d H:i:s') . "</p>";
|
||||
$textBody = "SMTP Test Email - CharityHub\n\nTest Successful!\nIf you are reading this, your SMTP configuration is working correctly.\nSent at: " . date('Y-m-d H:i:s');
|
||||
$textBody = "SMTP Test Email - " . $orgName . "\n\nTest Successful!\nIf you are reading this, your SMTP configuration is working correctly.\nSent at: " . date('Y-m-d H:i:s');
|
||||
|
||||
$result = MailService::sendMail($recipient, $subject, $htmlBody, $textBody);
|
||||
|
||||
echo json_encode($result);
|
||||
|
||||
echo json_encode($result);
|
||||
@ -20,7 +20,7 @@ $logs = $pdo->query("
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Audit Logs - CharityHub Admin</title>
|
||||
<title>Audit Logs - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
|
||||
@ -56,3 +56,23 @@ function log_action($action, $details = null) {
|
||||
$stmt = $pdo->prepare("INSERT INTO audit_logs (user_id, action, details) VALUES (?, ?, ?)");
|
||||
$stmt->execute([$userId, $action, $details]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get organization name from profile
|
||||
*/
|
||||
function get_org_name() {
|
||||
if (isset($_SESSION['org_name']) && !empty($_SESSION['org_name'])) {
|
||||
return $_SESSION['org_name'];
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../db/config.php';
|
||||
try {
|
||||
$pdo = db();
|
||||
$profile = $pdo->query("SELECT name_en FROM org_profile LIMIT 1")->fetch();
|
||||
$name = $profile['name_en'] ?? 'CharityHub';
|
||||
$_SESSION['org_name'] = $name;
|
||||
return $name;
|
||||
} catch (Exception $e) {
|
||||
return 'CharityHub';
|
||||
}
|
||||
}
|
||||
@ -111,7 +111,7 @@ if (isset($_GET['edit'])) {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Manage Cases - CharityHub Admin</title>
|
||||
<title>Manage Cases - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
|
||||
@ -50,7 +50,7 @@ if (isset($_GET['edit'])) {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Manage Categories - CharityHub Admin</title>
|
||||
<title>Manage Categories - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
|
||||
@ -18,7 +18,7 @@ $donations = $pdo->query("SELECT d.*, c.title_en as case_title, cat.name_en as c
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Donations - CharityHub Admin</title>
|
||||
<title>Donations - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
|
||||
@ -26,7 +26,7 @@ $donors = $pdo->query("
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Donors CRM - CharityHub Admin</title>
|
||||
<title>Donors CRM - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
|
||||
@ -170,7 +170,7 @@ foreach ($gift_stats as $row) {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Financial Summary - CharityHub Admin</title>
|
||||
<title>Financial Summary - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
@ -223,7 +223,7 @@ foreach ($gift_stats as $row) {
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<div class="fw-bold"><?= date('l, F j, Y') ?></div>
|
||||
<div class="text-muted small no-print">CharityHub Admin Panel</div>
|
||||
<div class="text-muted small no-print"><?= htmlspecialchars(get_org_name()) ?> Admin Panel</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ $recent_donations = $pdo->query("
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dashboard - CharityHub Admin</title>
|
||||
<title>Dashboard - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Login - CharityHub</title>
|
||||
<title>Admin Login - <?= htmlspecialchars(get_org_name()) ?></title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
@ -61,7 +61,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-card">
|
||||
<h3 class="text-center mb-4 fw-bold text-success">CharityHub Admin</h3>
|
||||
<h3 class="text-center mb-4 fw-bold text-success"><?= htmlspecialchars(get_org_name()) ?> Admin</h3>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div class="alert alert-danger py-2 small"><?= htmlspecialchars($error) ?></div>
|
||||
|
||||
@ -43,6 +43,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$stmt->execute([$name_en, $name_ar, $description_en, $description_ar, $email, $phone, $address, $logo_url]);
|
||||
}
|
||||
|
||||
$_SESSION['org_name'] = $name_en;
|
||||
header('Location: profile.php?success=1');
|
||||
exit;
|
||||
}
|
||||
@ -52,7 +53,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Organization Profile - CharityHub Admin</title>
|
||||
<title>Organization Profile - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
|
||||
@ -30,7 +30,7 @@ foreach ($settings_raw as $s) {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Gateway Settings - CharityHub Admin</title>
|
||||
<title>Gateway Settings - <?= htmlspecialchars(get_org_name()) ?> Admin</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<style>
|
||||
@ -108,7 +108,7 @@ foreach ($settings_raw as $s) {
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">From Name</label>
|
||||
<input type="text" name="settings[mail_from_name]" class="form-control" value="<?= htmlspecialchars($settings['mail_from_name'] ?? 'CharityHub') ?>">
|
||||
<input type="text" name="settings[mail_from_name]" class="form-control" value="<?= htmlspecialchars($settings['mail_from_name'] ?? get_org_name()) ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
$current_page = basename($_SERVER['PHP_SELF']);
|
||||
?>
|
||||
<div class="sidebar">
|
||||
<h4 class="mb-4">CharityHub</h4>
|
||||
<h4 class="mb-4"><?= htmlspecialchars(get_org_name()) ?></h4>
|
||||
<nav class="nav flex-column">
|
||||
<a href="index.php" class="nav-link <?= $current_page == 'index.php' ? 'active' : '' ?>"><i class="bi bi-speedometer2 me-2"></i> Dashboard</a>
|
||||
<a href="profile.php" class="nav-link <?= $current_page == 'profile.php' ? 'active' : '' ?>"><i class="bi bi-building me-2"></i> Org Profile</a>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user