diff --git a/assets/css/custom.css b/assets/css/custom.css index 03275d0..ea58ee6 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -246,6 +246,8 @@ body { padding: 2rem; transition: all 0.3s; min-height: 100vh; + display: flex; + flex-direction: column; } [dir="rtl"] .main-content { @@ -296,6 +298,7 @@ body { display: flex; justify-content: space-between; align-items: center; + flex-shrink: 0; } /* UI Components */ @@ -332,6 +335,8 @@ body { .main-footer { background: transparent; color: var(--text-muted); + margin-top: auto; + flex-shrink: 0; } .main-footer .border-top { diff --git a/index.php b/index.php index eea9493..5130a2a 100644 --- a/index.php +++ b/index.php @@ -2,10 +2,26 @@ declare(strict_types=1); // Sessions setup -if (!is_dir(__DIR__ . '/sessions')) { - mkdir(__DIR__ . '/sessions', 0777, true); +$sessions_dir = __DIR__ . '/sessions'; +if (!is_dir($sessions_dir)) { + @mkdir($sessions_dir, 0777, true); +} +if (is_writable($sessions_dir)) { + session_save_path($sessions_dir); +} + +// Check for required extensions +$required_extensions = ['pdo', 'pdo_mysql', 'curl', 'json']; +$missing_extensions = []; +foreach ($required_extensions as $ext) { + if (!extension_loaded($ext)) { + $missing_extensions[] = $ext; + } +} + +if (!empty($missing_extensions)) { + die("Error: The following PHP extensions are required but missing: " . implode(', ', $missing_extensions) . ". Please contact your hosting provider to enable them."); } -session_save_path(__DIR__ . '/sessions'); // Enhanced session security and iframe compatibility if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) { @@ -37,9 +53,15 @@ $lang = $_SESSION['lang']; $dir = ($lang === 'ar') ? 'rtl' : 'ltr'; // Licensing Middleware -$is_activated = LicenseService::isActivated(); -$trial_days = LicenseService::getTrialRemainingDays(); -$can_access = LicenseService::canAccess(); +try { + $is_activated = LicenseService::isActivated(); + $trial_days = LicenseService::getTrialRemainingDays(); + $can_access = LicenseService::canAccess(); +} catch (PDOException $e) { + die("Database Connection Error: " . $e->getMessage() . "Please check your db/config.php settings."); +} catch (Exception $e) { + die("Application Error: " . $e->getMessage()); +} $page = $_GET['page'] ?? 'dashboard'; if (!$can_access && $page !== 'activate') { @@ -11255,8 +11277,10 @@ document.addEventListener('DOMContentLoaded', function() {