-

Dashboard

+

Welcome, !

-

Welcome, !

-

Here's a quick overview of your account.

- -
+ +
-
-
Projects
-
-
5
-

You have 5 active projects.

-
-
+ Explore Skills
-
-
Tasks
-
-
12
-

You have 12 pending tasks.

-
-
+ Continue Learning
-
-
Team Members
-
-
3
-

You have 3 team members.

-
-
+ Community
+ + +
+

My Enrolled Skills

+
+ +

You are not enrolled in any skills yet. Explore the skills below to get started!

+ + +
+
+ <?php echo htmlspecialchars($skill['title']); ?> +
+
+
+
%
+
+ Continue +
+
+
+ + +
+
+ + +
+

Skill Explorer

+ $skills): ?> +

+
+ +
+
+ <?php echo htmlspecialchars($skill['title']); ?> +
+
+

+ Enroll +
+
+
+ +
+ +
+
- \ No newline at end of file + diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..940af83 --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,21 @@ +exec($sql); + echo "Success.\n"; + } + + echo "\nAll migrations completed successfully!\n"; + +} catch (PDOException $e) { + die("Database migration failed: " . $e->getMessage()); +} + diff --git a/db/migrations/002_create_users_table.sql b/db/migrations/002_create_users_table.sql index d5e7135..b01351f 100644 --- a/db/migrations/002_create_users_table.sql +++ b/db/migrations/002_create_users_table.sql @@ -1,7 +1,7 @@ CREATE TABLE IF NOT EXISTS `users` ( - `id` INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, - `username` VARCHAR(255) NOT NULL UNIQUE, - `email` VARCHAR(255) NOT NULL UNIQUE, - `password` VARCHAR(255) NOT NULL, - `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); + `id` INT AUTO_INCREMENT PRIMARY KEY, + `username` VARCHAR(255) NOT NULL UNIQUE, + `email` VARCHAR(255) NOT NULL UNIQUE, + `password` VARCHAR(255) NOT NULL, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/db/migrations/003_create_skills_table.sql b/db/migrations/003_create_skills_table.sql new file mode 100644 index 0000000..58491d0 --- /dev/null +++ b/db/migrations/003_create_skills_table.sql @@ -0,0 +1,7 @@ +CREATE TABLE IF NOT EXISTS `skills` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `title` VARCHAR(255) NOT NULL, + `category` VARCHAR(100) NOT NULL, + `description` TEXT, + `thumbnail` VARCHAR(255) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/db/migrations/004_create_user_skills_table.sql b/db/migrations/004_create_user_skills_table.sql new file mode 100644 index 0000000..43d9d91 --- /dev/null +++ b/db/migrations/004_create_user_skills_table.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS `user_skills` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `user_id` int(11) unsigned NOT NULL, + `skill_id` int(11) NOT NULL, + `progress` INT DEFAULT 0, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (skill_id) REFERENCES skills(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/db/migrations/005_insert_sample_skills.sql b/db/migrations/005_insert_sample_skills.sql new file mode 100644 index 0000000..6075fe6 --- /dev/null +++ b/db/migrations/005_insert_sample_skills.sql @@ -0,0 +1,11 @@ +INSERT INTO `skills` (`title`, `category`, `description`, `thumbnail`) VALUES +('Introduction to Python', 'Tech', 'Learn the fundamentals of Python programming.', 'assets/images/python.png'), +('Web Development Basics', 'Tech', 'Understand HTML, CSS, and JavaScript.', 'assets/images/webdev.png'), +('Data Analysis with Pandas', 'Tech', 'Analyze data effectively using the Pandas library.', 'assets/images/pandas.png'), +('Basic Carpentry', 'Trade', 'Learn to build simple wooden furniture.', 'assets/images/carpentry.png'), +('Electrical Wiring 101', 'Trade', 'Understand the basics of home electrical wiring.', 'assets/images/wiring.png'), +('Digital Painting', 'Art', 'Create stunning digital art with this introductory course.', 'assets/images/digital_painting.png'), +('Music Production Fundamentals', 'Art', 'Learn to produce your own music from scratch.', 'assets/images/music_production.png'), +('Introduction to Business', 'Business', 'Learn the basics of starting and running a business.', 'assets/images/business.png'), +('Marketing for Beginners', 'Business', 'Understand the fundamentals of modern marketing.', 'assets/images/marketing.png'), +('Personal Finance Management', 'Business', 'Take control of your finances.', 'assets/images/finance.png'); \ No newline at end of file diff --git a/db/show_schema.php b/db/show_schema.php new file mode 100644 index 0000000..f9ca1d6 --- /dev/null +++ b/db/show_schema.php @@ -0,0 +1,20 @@ +query("SHOW CREATE TABLE users"); + $user_table_def = $stmt->fetch(PDO::FETCH_ASSOC); + echo "Users table definition:\n"; + print_r($user_table_def); + + $stmt = $pdo->query("SHOW CREATE TABLE skills"); + $skill_table_def = $stmt->fetch(PDO::FETCH_ASSOC); + echo "\nSkills table definition:\n"; + print_r($skill_table_def); + +} catch (PDOException $e) { + die("Database query failed: " . $e->getMessage()); +} +