diff --git a/admin.php b/admin.php
new file mode 100644
index 0000000..09d5c3a
--- /dev/null
+++ b/admin.php
@@ -0,0 +1,229 @@
+ 'danger', 'message' => 'All fields are required.'];
+ } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
+ $_SESSION['toast'] = ['type' => 'danger', 'message' => 'Invalid email format.'];
+ } else {
+ try {
+ $pdo = db();
+ $stmt = $pdo->prepare("SELECT id FROM users WHERE username = ? OR email = ?");
+ $stmt->execute([$username, $email]);
+ if ($stmt->fetch()) {
+ $_SESSION['toast'] = ['type' => 'danger', 'message' => 'Username or email already exists.'];
+ } else {
+ $hashed_password = password_hash($password, PASSWORD_DEFAULT);
+ $stmt = $pdo->prepare("INSERT INTO users (username, email, password, role) VALUES (?, ?, ?, ?)");
+ $stmt->execute([$username, $email, $hashed_password, $role]);
+ $_SESSION['toast'] = ['type' => 'success', 'message' => 'User added successfully!'];
+ }
+ } catch (PDOException $e) {
+ $_SESSION['toast'] = ['type' => 'danger', 'message' => 'Database error: ' . $e->getMessage()];
+ }
+ }
+ header("Location: admin.php");
+ exit;
+}
+
+// Fetch all users
+try {
+ $pdo = db();
+ $users_stmt = $pdo->query("SELECT id, username, email, role, status, created_at FROM users ORDER BY created_at DESC");
+ $users = $users_stmt->fetchAll(PDO::FETCH_ASSOC);
+} catch (PDOException $e) {
+ $users = [];
+ $_SESSION['toast'] = ['type' => 'danger', 'message' => 'Could not fetch users.'];
+}
+
+$toast = $_SESSION['toast'] ?? null;
+unset($_SESSION['toast']);
+?>
+
+
+
+
+
+ Admin Panel - IPTV Manager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
User Management
+
+
+
+
+
+
+
+
+
+
+ | Username |
+ Email |
+ Role |
+ Status |
+ Registered |
+ Actions |
+
+
+
+
+ | No users found. |
+
+
+
+ | = htmlspecialchars($user['username']) ?> |
+ = htmlspecialchars($user['email']) ?> |
+ = htmlspecialchars(ucfirst($user['role'])) ?> |
+
+
+ = htmlspecialchars(ucfirst($user['status'])) ?>
+
+ |
+ = date("M d, Y", strtotime($user['created_at'])) ?> |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = htmlspecialchars($toast['message']) ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..31e9725
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,47 @@
+body {
+ font-family: 'Inter', sans-serif;
+ background-color: #f8f9fa;
+}
+
+.sidebar {
+ width: 280px;
+ min-height: 100vh;
+}
+
+.sidebar .nav-link {
+ font-size: 1rem;
+ padding: 0.75rem 1rem;
+ transition: all 0.2s ease-in-out;
+}
+
+.sidebar .nav-link.active {
+ background: linear-gradient(45deg, #0d6efd, #6f42c1) !important;
+ color: white !important;
+ border-radius: 0.375rem;
+}
+
+.sidebar .nav-link:not(.active):hover {
+ background-color: #495057;
+}
+
+.main-content {
+ background-color: #f8f9fa;
+}
+
+.card {
+ border: none;
+ border-radius: 0.5rem;
+}
+
+.table {
+ margin-bottom: 0;
+}
+
+.table th {
+ font-weight: 600;
+ color: #495057;
+}
+
+.badge.bg-secondary {
+ background-color: #6c757d !important;
+}
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..c6039fe
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,7 @@
+document.addEventListener('DOMContentLoaded', (event) => {
+ const toastEl = document.getElementById('liveToast');
+ if (toastEl) {
+ const toast = new bootstrap.Toast(toastEl);
+ toast.show();
+ }
+});
diff --git a/db/db_setup.php b/db/db_setup.php
new file mode 100644
index 0000000..c15f6bf
--- /dev/null
+++ b/db/db_setup.php
@@ -0,0 +1,39 @@
+exec("CREATE TABLE IF NOT EXISTS `users` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `username` VARCHAR(255) NOT NULL UNIQUE,
+ `email` VARCHAR(255) NOT NULL UNIQUE,
+ `password` VARCHAR(255) NOT NULL,
+ `role` ENUM('superadmin', 'reseller', 'subscriber') NOT NULL DEFAULT 'subscriber',
+ `status` ENUM('active', 'blocked') NOT NULL DEFAULT 'active',
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+ );");
+
+ // Check if a superadmin exists
+ $stmt = $pdo->query("SELECT COUNT(*) FROM `users` WHERE `role` = 'superadmin'");
+ if ($stmt->fetchColumn() == 0) {
+ // Create a default superadmin
+ $username = 'admin';
+ $email = 'admin@example.com';
+ $password = password_hash('password', PASSWORD_DEFAULT); // Change this!
+ $role = 'superadmin';
+
+ $insert_stmt = $pdo->prepare("INSERT INTO `users` (username, email, password, role) VALUES (?, ?, ?, ?)");
+ $insert_stmt->execute([$username, $email, $password, $role]);
+ }
+
+ } catch (PDOException $e) {
+ // In a real app, you'd log this error.
+ // For setup, we can die to see the error.
+ die("Database setup failed: " . $e->getMessage());
+ }
+}
+
+setup_database();
+?>
\ No newline at end of file
diff --git a/index.php b/index.php
index 7205f3d..e2de274 100644
--- a/index.php
+++ b/index.php
@@ -4,147 +4,103 @@ declare(strict_types=1);
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
-$phpVersion = PHP_VERSION;
-$now = date('Y-m-d H:i:s');
+// Read project preview data from environment
+$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'A powerful and lightweight IPTV management panel.';
+$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
+$projectName = $_SERVER['PROJECT_NAME'] ?? 'IPTV Panel';
+
?>
- New Style
-
-
-
-
-
+ = htmlspecialchars($projectName) ?> - Your IPTV Solution
+
+
+
+
-
+
+
-
-
-
+
-
-
+
+
+
+
+
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
+
+
+
= htmlspecialchars($projectName) ?>
+
= htmlspecialchars($projectDescription) ?>
+
+ Go to Admin Panel
+
+
-
+