query("SELECT * FROM theme_settings WHERE id=1"); $theme = $stmt_theme->fetch(PDO::FETCH_ASSOC); } catch (Exception $e) { $theme = false; } // Defaults (Green) $primary_color = $theme && !empty($theme['primary_color']) ? $theme['primary_color'] : '#16a34a'; // Default Green $logo_url = ($theme && !empty($theme['logo'])) ? $theme['logo'] : ''; // --- 2. LOGIN LOGIC --- if(isset($_POST['login'])) { $email = trim($_POST['email']); $password = $_POST['password']; // Check Admin $stmt = $pdo->prepare("SELECT * FROM users WHERE email = ? AND role = 'admin'"); $stmt->execute([$email]); $user = $stmt->fetch(); if($user && password_verify($password, $user['password'])) { $_SESSION['admin_id'] = $user['id']; $_SESSION['admin_name'] = $user['name']; header("Location: dashboard.php"); exit; } else { $error = "Invalid Credentials!"; } } ?>
Admin Control Panel Login
© 2025 SejiStore Secure Admin