![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/soundstudiopro.com/public_html/admin_includes/ |
<?php
// Settings Tab
// This file handles admin settings and configuration
// Get current settings (mock data for now)
$current_settings = [
'site_name' => 'SoundStudioPro',
'maintenance_mode' => false,
'registration_enabled' => true,
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 587,
'from_email' => 'noreply@soundstudiopro.com',
'session_timeout' => 30,
'max_login_attempts' => 5,
'enable_2fa' => false
];
?>
<!-- Admin Settings -->
<div class="section-header">
<h2><i class="fas fa-cog"></i> Admin Settings</h2>
<p>Configure system-wide settings and preferences.</p>
</div>
<div class="settings-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-bottom: 3rem;">
<div class="settings-card" style="background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 2rem;">
<h3 style="margin-top: 0; color: white; font-size: 1.8rem;">General Settings</h3>
<form onsubmit="saveGeneralSettings(event)">
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Site Name</label>
<input type="text" name="site_name" value="<?= htmlspecialchars($current_settings['site_name']) ?>" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Maintenance Mode</label>
<label class="toggle-switch" style="position: relative; display: inline-block; width: 60px; height: 34px;">
<input type="checkbox" name="maintenance_mode" <?= $current_settings['maintenance_mode'] ? 'checked' : '' ?> style="opacity: 0; width: 0; height: 0;">
<span class="toggle-slider" style="position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #4a5568; transition: .4s; border-radius: 34px;"></span>
</label>
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Registration Enabled</label>
<label class="toggle-switch" style="position: relative; display: inline-block; width: 60px; height: 34px;">
<input type="checkbox" name="registration_enabled" <?= $current_settings['registration_enabled'] ? 'checked' : '' ?> style="opacity: 0; width: 0; height: 0;">
<span class="toggle-slider" style="position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #4a5568; transition: .4s; border-radius: 34px;"></span>
</label>
</div>
<button type="submit" class="btn btn-primary" style="width: 100%;">
<i class="fas fa-save"></i> Save General Settings
</button>
</form>
</div>
<div class="settings-card" style="background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 2rem;">
<h3 style="margin-top: 0; color: white; font-size: 1.8rem;">Email Settings</h3>
<form onsubmit="saveEmailSettings(event)">
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">SMTP Host</label>
<input type="text" name="smtp_host" value="<?= htmlspecialchars($current_settings['smtp_host']) ?>" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">SMTP Port</label>
<input type="number" name="smtp_port" value="<?= $current_settings['smtp_port'] ?>" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">From Email</label>
<input type="email" name="from_email" value="<?= htmlspecialchars($current_settings['from_email']) ?>" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<button type="submit" class="btn btn-primary" style="width: 100%;">
<i class="fas fa-save"></i> Save Email Settings
</button>
</form>
</div>
<div class="settings-card" style="background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 2rem;">
<h3 style="margin-top: 0; color: white; font-size: 1.8rem;">Security Settings</h3>
<form onsubmit="saveSecuritySettings(event)">
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Session Timeout (minutes)</label>
<input type="number" name="session_timeout" value="<?= $current_settings['session_timeout'] ?>" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Max Login Attempts</label>
<input type="number" name="max_login_attempts" value="<?= $current_settings['max_login_attempts'] ?>" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Enable 2FA</label>
<label class="toggle-switch" style="position: relative; display: inline-block; width: 60px; height: 34px;">
<input type="checkbox" name="enable_2fa" <?= $current_settings['enable_2fa'] ? 'checked' : '' ?> style="opacity: 0; width: 0; height: 0;">
<span class="toggle-slider" style="position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #4a5568; transition: .4s; border-radius: 34px;"></span>
</label>
</div>
<button type="submit" class="btn btn-primary" style="width: 100%;">
<i class="fas fa-save"></i> Save Security Settings
</button>
</form>
</div>
</div>
<!-- Advanced Settings -->
<div class="section-header">
<h3><i class="fas fa-tools"></i> Advanced Settings</h3>
</div>
<div class="settings-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem;">
<div class="settings-card" style="background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 2rem;">
<h3 style="margin-top: 0; color: white; font-size: 1.8rem;">Performance</h3>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Cache Duration (hours)</label>
<input type="number" value="24" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Max File Upload Size (MB)</label>
<input type="number" value="50" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<button class="btn btn-secondary" style="width: 100%;">
<i class="fas fa-save"></i> Save Performance Settings
</button>
</div>
<div class="settings-card" style="background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 2rem;">
<h3 style="margin-top: 0; color: white; font-size: 1.8rem;">Backup & Recovery</h3>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Auto Backup Frequency</label>
<select class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
<option>Daily</option>
<option>Weekly</option>
<option>Monthly</option>
<option>Never</option>
</select>
</div>
<div class="setting-item" style="margin-bottom: 1.5rem;">
<label style="display: block; color: #a0aec0; margin-bottom: 0.5rem; font-weight: 600;">Backup Retention (days)</label>
<input type="number" value="30" class="setting-input" style="width: 100%; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: white;">
</div>
<button class="btn btn-secondary" style="width: 100%;">
<i class="fas fa-save"></i> Save Backup Settings
</button>
</div>
</div>
<script>
// Toggle switch functionality
document.querySelectorAll('.toggle-switch input').forEach(toggle => {
toggle.addEventListener('change', function() {
const slider = this.nextElementSibling;
if (this.checked) {
slider.style.backgroundColor = '#48bb78';
} else {
slider.style.backgroundColor = '#4a5568';
}
});
});
// Settings save functions
function saveGeneralSettings(event) {
event.preventDefault();
const formData = new FormData(event.target);
const data = Object.fromEntries(formData);
fetch('admin_api.php?action=save_general_settings', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('General settings saved successfully!');
} else {
alert('Error saving settings: ' + data.error);
}
})
.catch(error => {
alert('Error saving settings: ' + error);
});
}
function saveEmailSettings(event) {
event.preventDefault();
const formData = new FormData(event.target);
const data = Object.fromEntries(formData);
fetch('admin_api.php?action=save_email_settings', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Email settings saved successfully!');
} else {
alert('Error saving settings: ' + data.error);
}
})
.catch(error => {
alert('Error saving settings: ' + error);
});
}
function saveSecuritySettings(event) {
event.preventDefault();
const formData = new FormData(event.target);
const data = Object.fromEntries(formData);
fetch('admin_api.php?action=save_security_settings', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Security settings saved successfully!');
} else {
alert('Error saving settings: ' + data.error);
}
})
.catch(error => {
alert('Error saving settings: ' + error);
});
}
</script>