+
+
diff --git a/db/migrate.php b/db/migrate.php
new file mode 100644
index 0000000..b1f6784
--- /dev/null
+++ b/db/migrate.php
@@ -0,0 +1,41 @@
+setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ // Create migrations table if it doesn't exist
+ $pdo->exec("CREATE TABLE IF NOT EXISTS `migrations` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `migration` VARCHAR(255) NOT NULL,
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
+
+ // Get all run migrations
+ $stmt = $pdo->query("SELECT `migration` FROM `migrations`");
+ $run_migrations = $stmt->fetchAll(PDO::FETCH_COLUMN);
+
+ // Get all migration files
+ $migration_files = glob(__DIR__ . '/migrations/*.sql');
+ sort($migration_files);
+
+ foreach ($migration_files as $file) {
+ $migration_name = basename($file);
+ if (!in_array($migration_name, $run_migrations)) {
+ echo "Running migration: {$migration_name}...\n";
+ $sql = file_get_contents($file);
+ $pdo->exec($sql);
+
+ $stmt = $pdo->prepare("INSERT INTO `migrations` (`migration`) VALUES (?)");
+ $stmt->execute([$migration_name]);
+ echo "Success: {$migration_name} migrated.\n";
+ }
+ }
+
+ echo "All migrations have been run.\n";
+
+} catch (PDOException $e) {
+ die("Migration failed: " . $e->getMessage());
+}
+
diff --git a/db/migrations/001_create_users_table.sql b/db/migrations/001_create_users_table.sql
new file mode 100644
index 0000000..5ba57d3
--- /dev/null
+++ b/db/migrations/001_create_users_table.sql
@@ -0,0 +1,8 @@
+CREATE TABLE IF NOT EXISTS users (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(255) NOT NULL,
+ email VARCHAR(255) NOT NULL UNIQUE,
+ password VARCHAR(255) NOT NULL,
+ role ENUM('student', 'instructor', 'admin') NOT NULL DEFAULT 'student',
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
diff --git a/db/migrations/002_add_profile_fields_to_users.sql b/db/migrations/002_add_profile_fields_to_users.sql
new file mode 100644
index 0000000..f51212c
--- /dev/null
+++ b/db/migrations/002_add_profile_fields_to_users.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `users`
+ADD COLUMN `bio` TEXT DEFAULT NULL,
+ADD COLUMN `skills` VARCHAR(255) DEFAULT NULL,
+ADD COLUMN `interests` VARCHAR(255) DEFAULT NULL,
+ADD COLUMN `goals` TEXT DEFAULT NULL;
diff --git a/db/migrations/003_create_courses_table.sql b/db/migrations/003_create_courses_table.sql
new file mode 100644
index 0000000..aad4c1f
--- /dev/null
+++ b/db/migrations/003_create_courses_table.sql
@@ -0,0 +1,9 @@
+CREATE TABLE IF NOT EXISTS `courses` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `title` VARCHAR(255) NOT NULL,
+ `description` TEXT NOT NULL,
+ `instructor_id` INT,
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ FOREIGN KEY (`instructor_id`) REFERENCES `users`(`id`) ON DELETE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/db/migrations/004_add_features_tables.sql b/db/migrations/004_add_features_tables.sql
new file mode 100644
index 0000000..c4402bb
--- /dev/null
+++ b/db/migrations/004_add_features_tables.sql
@@ -0,0 +1,59 @@
+-- Monetization & Content Strategy
+ALTER TABLE `courses`
+ADD COLUMN `tier` ENUM('free', 'premium') NOT NULL DEFAULT 'free' AFTER `description`,
+ADD COLUMN `price` DECIMAL(10, 2) DEFAULT NULL AFTER `tier`,
+ADD COLUMN `type` ENUM('course', 'micro-lesson') NOT NULL DEFAULT 'course' AFTER `price`;
+
+-- Scalability & Compliance
+ALTER TABLE `users`
+ADD COLUMN `language` VARCHAR(5) NOT NULL DEFAULT 'en' AFTER `email`,
+ADD COLUMN `parental_controls_enabled` BOOLEAN NOT NULL DEFAULT FALSE AFTER `language`;
+
+-- Community & Engagement: Gamification
+CREATE TABLE IF NOT EXISTS `badges` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `name` VARCHAR(255) NOT NULL,
+ `description` TEXT,
+ `icon` VARCHAR(255) -- e.g., path to an image or a font-awesome class
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS `user_badges` (
+ `user_id` INT NOT NULL,
+ `badge_id` INT NOT NULL,
+ `awarded_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`user_id`, `badge_id`),
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE,
+ FOREIGN KEY (`badge_id`) REFERENCES `badges`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+-- Community & Engagement: Discussion Boards
+CREATE TABLE IF NOT EXISTS `discussion_forums` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `course_id` INT DEFAULT NULL, -- Can be null for general forums
+ `title` VARCHAR(255) NOT NULL,
+ `description` TEXT,
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON DELETE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS `discussion_threads` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `forum_id` INT NOT NULL,
+ `user_id` INT NOT NULL,
+ `title` VARCHAR(255) NOT NULL,
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (`forum_id`) REFERENCES `discussion_forums`(`id`) ON DELETE CASCADE,
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS `discussion_posts` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `thread_id` INT NOT NULL,
+ `user_id` INT NOT NULL,
+ `parent_post_id` INT DEFAULT NULL, -- For replies
+ `content` TEXT NOT NULL,
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (`thread_id`) REFERENCES `discussion_threads`(`id`) ON DELETE CASCADE,
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE,
+ FOREIGN KEY (`parent_post_id`) REFERENCES `discussion_posts`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/db/seeds/seed_courses.php b/db/seeds/seed_courses.php
new file mode 100644
index 0000000..eb59245
--- /dev/null
+++ b/db/seeds/seed_courses.php
@@ -0,0 +1,77 @@
+setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ // Temporarily disable foreign key checks to truncate the table
+ $pdo->exec("SET FOREIGN_KEY_CHECKS=0;");
+ $pdo->exec("TRUNCATE TABLE courses");
+ $pdo->exec("SET FOREIGN_KEY_CHECKS=1;");
+
+ $courses = [
+ [
+ 'title' => 'Introduction to PHP',
+ 'description' => 'Learn the fundamentals of PHP, the most popular server-side scripting language.',
+ 'tier' => 'free',
+ 'price' => null,
+ 'type' => 'course',
+ 'instructor_id' => null // No instructor assigned yet
+ ],
+ [
+ 'title' => 'Advanced MySQL',
+ 'description' => 'Master advanced MySQL concepts like indexing, transactions, and stored procedures.',
+ 'tier' => 'premium',
+ 'price' => '99.99',
+ 'type' => 'course',
+ 'instructor_id' => null
+ ],
+ [
+ 'title' => 'JavaScript for Beginners',
+ 'description' => 'Get started with JavaScript, the language of the web.',
+ 'tier' => 'free',
+ 'price' => null,
+ 'type' => 'course',
+ 'instructor_id' => null
+ ],
+ [
+ 'title' => 'Quick CSS Flexbox',
+ 'description' => 'A 25-minute dive into the essentials of CSS Flexbox for modern layouts.',
+ 'tier' => 'free',
+ 'price' => null,
+ 'type' => 'micro-lesson',
+ 'instructor_id' => null
+ ],
+ [
+ 'title' => 'The Complete Forex Trading Course',
+ 'description' => 'An in-depth course on Forex trading strategies, risk management, and market analysis.',
+ 'tier' => 'premium',
+ 'price' => '149.50',
+ 'type' => 'course',
+ 'instructor_id' => null
+ ]
+ ];
+
+ $stmt = $pdo->prepare(
+ "INSERT INTO courses (title, description, tier, price, type, instructor_id)
+ VALUES (:title, :description, :tier, :price, :type, :instructor_id)"
+ );
+
+ foreach ($courses as $course) {
+ $stmt->execute([
+ ':title' => $course['title'],
+ ':description' => $course['description'],
+ ':tier' => $course['tier'],
+ ':price' => $course['price'],
+ ':type' => $course['type'],
+ ':instructor_id' => $course['instructor_id']
+ ]);
+ }
+
+ echo "Successfully seeded the courses table.\n";
+
+} catch (PDOException $e) {
+ die("Seeding failed: " . $e->getMessage());
+}
+
diff --git a/db/seeds/seed_forums.php b/db/seeds/seed_forums.php
new file mode 100644
index 0000000..3a2bb94
--- /dev/null
+++ b/db/seeds/seed_forums.php
@@ -0,0 +1,44 @@
+setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ // Truncate the tables to start fresh
+ $pdo->exec("SET FOREIGN_KEY_CHECKS=0;");
+ $pdo->exec("TRUNCATE TABLE discussion_forums");
+ $pdo->exec("TRUNCATE TABLE discussion_threads");
+ $pdo->exec("TRUNCATE TABLE discussion_posts");
+ $pdo->exec("SET FOREIGN_KEY_CHECKS=1;");
+
+ // Find a course to associate with a forum
+ $stmt = $pdo->query("SELECT id FROM courses WHERE title LIKE '%PHP%' LIMIT 1");
+ $php_course = $stmt->fetch();
+ $php_course_id = $php_course ? $php_course['id'] : null;
+
+ $forums = [
+ [
+ 'course_id' => null,
+ 'title' => 'General Discussion',
+ 'description' => 'A place to talk about anything and everything.'
+ ],
+ [
+ 'course_id' => $php_course_id,
+ 'title' => 'PHP Course Q&A',
+ 'description' => 'Ask questions and get help for the Introduction to PHP course.'
+ ]
+ ];
+
+ $stmt = $pdo->prepare("INSERT INTO discussion_forums (course_id, title, description) VALUES (:course_id, :title, :description)");
+
+ foreach ($forums as $forum) {
+ $stmt->execute($forum);
+ }
+
+ echo "Successfully seeded the discussion_forums table.\n";
+
+} catch (PDOException $e) {
+ die("Seeding failed: " . $e->getMessage());
+}
+
diff --git a/disclaimer.php b/disclaimer.php
new file mode 100644
index 0000000..1d1cbda
--- /dev/null
+++ b/disclaimer.php
@@ -0,0 +1,26 @@
+
+
+
+
Disclaimer
+
Last Updated:
+
+
1. General Information
+
The information provided by our platform is for general informational and educational purposes only. All information on the site is provided in good faith, however, we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site.
+
+
2. Forex & Trading Disclaimer
+
High-Risk Investment Warning: Trading Forex (foreign exchange) and other leveraged products is highly speculative and carries a high level of risk. It is possible to lose all your capital. These products may not be suitable for everyone and you should ensure that you understand the risks involved. Seek independent advice if necessary.
+
Our platform does not provide financial advice. The content on this site, including courses, mentorship, and discussions, is for educational purposes only. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice.
+
+
3. External Links Disclaimer
+
The Site may contain (or you may be sent through the Site) links to other websites or content belonging to or originating from third parties. Such external links are not investigated, monitored, or checked for accuracy, adequacy, validity, reliability, availability or completeness by us.
+
+
4. Contact Us
+
If you have any questions about this Disclaimer, please contact us.
+
+
+
+
diff --git a/forum.php b/forum.php
new file mode 100644
index 0000000..0b2343f
--- /dev/null
+++ b/forum.php
@@ -0,0 +1,71 @@
+prepare('SELECT * FROM discussion_forums WHERE id = ?');
+$stmt->execute([$forum_id]);
+$forum = $stmt->fetch();
+
+if (!$forum) {
+ header('Location: forums.php');
+ exit();
+}
+
+// Fetch threads in this forum
+$stmt = $pdo->prepare(
+ 'SELECT t.*, u.username FROM discussion_threads t JOIN users u ON t.user_id = u.id WHERE t.forum_id = ? ORDER BY t.created_at DESC'
+);
+$stmt->execute([$forum_id]);
+$threads = $stmt->fetchAll();
+
+?>
+
+
+
+
+
+
+
+
Create a New Thread
+
+
+
+
+
Threads
+
+
+
No threads in this forum yet. Be the first to post!
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
+
+
Overview
+
We provide the tools and knowledge for you to break free from the old ways. Learn in-demand digital skills, connect with like-minded individuals, and build your own reality.
+
+
+
+
Mentor Highlights
+
+
+
Morpheus
+
Specialty: Opening minds. Morpheus can show you the door, but you're the one who has to walk through it.
+
+
+
Trinity
+
Specialty: Digital infiltration and high-speed maneuvering. Learn to navigate the system's constructs with grace and power.
+
+
+
Neo
+
Specialty: Understanding the code. Neo helps you see the world for what it truly is and manipulate it to your will.
+
+
+
+
+
+
Success Stories
+
+
+
"I was lost in the system, a battery. Now I build my own worlds."
+
- A Former Blue Pill
+
+
+
"The mentors here don't just teach, they awaken."
+
- The Kid
+
+
+
+
+
+
Join the Resistance
+
+
+
+
-
-
-
-
+
+
\ No newline at end of file
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..314bedd
--- /dev/null
+++ b/login.php
@@ -0,0 +1,22 @@
+
+
+
Welcome to our platform. We are committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you visit our website.
+
+
2. Information We Collect
+
We may collect information about you in a variety of ways. The information we may collect on the Site includes:
+
+
Personal Data: Personally identifiable information, such as your name, shipping address, email address, and telephone number, and demographic information, such as your age, gender, hometown, and interests, that you voluntarily give to us when you register with the Site or when you choose to participate in various activities related to the Site, such as online chat and message boards.
+
Derivative Data: Information our servers automatically collect when you access the Site, such as your IP address, your browser type, your operating system, your access times, and the pages you have viewed directly before and after accessing the Site.
+
+
+
3. Use of Your Information
+
Having accurate information about you permits us to provide you with a smooth, efficient, and customized experience. Specifically, we may use information collected about you via the Site to...
+
[Placeholder: Detailed text about information usage to be added here.]
+
+
4. Contact Us
+
If you have questions or comments about this Privacy Policy, please contact us.
+
+
+
+
diff --git a/profile.php b/profile.php
new file mode 100644
index 0000000..db668cf
--- /dev/null
+++ b/profile.php
@@ -0,0 +1,62 @@
+prepare('SELECT * FROM users WHERE id = ?');
+$stmt->execute([$_SESSION['user_id']]);
+$user = $stmt->fetch();
+
+?>
+
+