Sindbad~EG File Manager
<?php
require_once '../includes/functions.php';
// Check if user is logged in and has admin privileges
if (!isLoggedIn()) {
header('Location: ' . BASE_URL . 'login.php');
exit();
}
$user = getCurrentUser();
if (!in_array($user['role'], ['superuser', 'area_admin', 'district_admin', 'assembly_admin'])) {
header('Location: ' . BASE_URL . 'dashboard.php');
exit();
}
$db = new CopMadinaDB();
$conn = $db->getConnection();
// Get current settings
$settings = getSettings();
$settings = getSettings();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings - COP Madina Conference Management</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: {
50: '#eff6ff',
100: '#dbeafe',
500: '#3b82f6',
600: '#2563eb',
700: '#1d4ed8',
800: '#1e40af',
900: '#1e3a8a'
}
}
}
}
}
</script>
</head>
<body class="bg-gray-100">
<div id="app" class="flex h-screen">
<?php include '../includes/public_sidebar.php'; ?>
<!-- Main Content -->
<div class="flex-1 flex flex-col overflow-hidden">
<div class="flex-1 overflow-y-auto">
<!-- Header -->
<header class="bg-white shadow-sm border-b border-gray-200">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center h-16">
<div class="flex items-center">
<a href="<?php echo BASE_URL; ?>" class="flex items-center">
<img src="<?php echo BASE_URL; ?>assets/images/logo.png" alt="COP Madina" class="h-10 w-10 rounded-full mr-3">
<div>
<h1 class="text-xl font-bold text-gray-900">System Settings</h1>
<p class="text-xs text-gray-500">Configuration Management</p>
</div>
</a>
</div>
<nav class="flex items-center space-x-4">
<a href="<?php echo BASE_URL; ?>" class="text-gray-600 hover:text-gray-900 transition-colors">
<i class="fas fa-home mr-1"></i>Home
</a>
<a href="<?php echo BASE_URL; ?>admin/" class="text-gray-600 hover:text-gray-900 transition-colors">
<i class="fas fa-arrow-left mr-1"></i>Admin
</a>
<div class="relative">
<span class="text-gray-700 font-medium">
<?php echo htmlspecialchars($user['first_name'] . ' ' . $user['last_name']); ?>
</span>
</div>
<a href="<?php echo BASE_URL; ?>logout.php" class="text-red-600 hover:text-red-800 transition-colors">
<i class="fas fa-sign-out-alt"></i>
</a>
</nav>
</div>
</div>
</header>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Page Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900">System Settings</h1>
<p class="mt-2 text-gray-600">Configure system preferences and options</p>
</div>
<!-- Settings Sections -->
<div class="space-y-6">
<!-- General Settings -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-bold text-gray-900 mb-6 flex items-center">
<i class="fas fa-cog text-primary-600 mr-2"></i>
General Settings
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Site Name</label>
<input type="text" value="<?php echo htmlspecialchars($settings['site_name'] ?? 'COP Madina Conference Management'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Site Description</label>
<input type="text" value="<?php echo htmlspecialchars($settings['site_description'] ?? 'Church Conference Management Platform'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Contact Email</label>
<input type="email" value="<?php echo htmlspecialchars($settings['contact_email'] ?? 'admin@copmadinaconf.org'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Contact Phone</label>
<input type="tel" value="<?php echo htmlspecialchars($settings['contact_phone'] ?? '+233 XX XXX XXXX'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
</div>
</div>
<!-- Event Settings -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-bold text-gray-900 mb-6 flex items-center">
<i class="fas fa-calendar-alt text-green-600 mr-2"></i>
Event Settings
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Default Event Duration (hours)</label>
<input type="number" value="<?php echo htmlspecialchars($settings['default_event_duration'] ?? '2'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Registration Deadline (days before)</label>
<input type="number" value="<?php echo htmlspecialchars($settings['registration_deadline_days'] ?? '7'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Max Registrations per Event</label>
<input type="number" value="<?php echo htmlspecialchars($settings['max_registrations'] ?? '500'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Currency</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
<option value="USD" <?php echo ($settings['currency'] ?? 'USD') === 'USD' ? 'selected' : ''; ?>>USD ($)</option>
<option value="GHS" <?php echo ($settings['currency'] ?? 'USD') === 'GHS' ? 'selected' : ''; ?>>GHS (₵)</option>
<option value="EUR" <?php echo ($settings['currency'] ?? 'USD') === 'EUR' ? 'selected' : ''; ?>>EUR (€)</option>
</select>
</div>
</div>
</div>
<!-- Notification Settings -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-bold text-gray-900 mb-6 flex items-center">
<i class="fas fa-bell text-yellow-600 mr-2"></i>
Notification Settings
</h2>
<div class="space-y-4">
<div class="flex items-center justify-between">
<div>
<h3 class="text-sm font-medium text-gray-900">Email Notifications</h3>
<p class="text-sm text-gray-500">Send email notifications for registrations and updates</p>
</div>
<label class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" checked class="sr-only peer">
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-600"></div>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<h3 class="text-sm font-medium text-gray-900">SMS Notifications</h3>
<p class="text-sm text-gray-500">Send SMS notifications for important updates</p>
</div>
<label class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" class="sr-only peer">
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-600"></div>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<h3 class="text-sm font-medium text-gray-900">Registration Confirmations</h3>
<p class="text-sm text-gray-500">Automatically send registration confirmation emails</p>
</div>
<label class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" checked class="sr-only peer">
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-600"></div>
</label>
</div>
</div>
</div>
<!-- Security Settings -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-bold text-gray-900 mb-6 flex items-center">
<i class="fas fa-shield-alt text-red-600 mr-2"></i>
Security Settings
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Session Timeout (minutes)</label>
<input type="number" value="<?php echo htmlspecialchars($settings['session_timeout'] ?? '30'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Max Login Attempts</label>
<input type="number" value="<?php echo htmlspecialchars($settings['max_login_attempts'] ?? '5'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Password Min Length</label>
<input type="number" value="<?php echo htmlspecialchars($settings['password_min_length'] ?? '8'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Lockout Duration (minutes)</label>
<input type="number" value="<?php echo htmlspecialchars($settings['lockout_duration'] ?? '15'); ?>"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-primary-500 focus:border-primary-500">
</div>
</div>
</div>
<!-- Save Button -->
<div class="flex justify-end">
<button class="bg-primary-600 text-white px-6 py-3 rounded-lg hover:bg-primary-700 transition-colors flex items-center">
<i class="fas fa-save mr-2"></i>
Save Settings
</button>
</div>
</div>
</div>
</body>
</html>
<style>
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.sidebar-active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
</style>
<script>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists