Welcome!
-Your project is ready to conquer the peaks.
-PHP version: = htmlspecialchars($phpVersion) ?>
Welcome Back
+Login or create an account to book your ride
+ +diff --git a/assets/pasted-20250904-144312-f8e1c105.jpg b/assets/pasted-20250904-144312-f8e1c105.jpg new file mode 100644 index 0000000..f139eca Binary files /dev/null and b/assets/pasted-20250904-144312-f8e1c105.jpg differ diff --git a/assets/pasted-20250904-145026-3fdef966.jpg b/assets/pasted-20250904-145026-3fdef966.jpg new file mode 100644 index 0000000..e9de2ed Binary files /dev/null and b/assets/pasted-20250904-145026-3fdef966.jpg differ diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..a71cb32 --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,33 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $migrationsDir = __DIR__ . '/migrations'; + $files = glob($migrationsDir . '/*.sql'); + sort($files); + + if (empty($files)) { + echo "No migration files found.\n"; + } else { + foreach ($files as $file) { + $sql = file_get_contents($file); + if ($sql === false) { + throw new Exception("Could not read migration file: $file"); + } + + $pdo->exec($sql); + echo "Successfully executed migration: " . basename($file) . "\n"; + } + } + + echo "All migrations completed successfully.\n"; + +} catch (PDOException $e) { + die("Database migration failed: " . $e->getMessage() . "\n"); +} catch (Exception $e) { + die("An error occurred: " . $e->getMessage() . "\n"); +} + diff --git a/db/migrations/001_create_users_table.sql b/db/migrations/001_create_users_table.sql new file mode 100644 index 0000000..3b1c563 --- /dev/null +++ b/db/migrations/001_create_users_table.sql @@ -0,0 +1,6 @@ +CREATE TABLE IF NOT EXISTS `users` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `username` VARCHAR(50) NOT NULL UNIQUE, + `password` VARCHAR(255) NOT NULL, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/index.php b/index.php index f7ae6b8..8d5f3a2 100644 --- a/index.php +++ b/index.php @@ -12,92 +12,156 @@ $now = date('Y-m-d H:i:s');
-Your project is ready to conquer the peaks.
-PHP version: = htmlspecialchars($phpVersion) ?>
Login or create an account to book your ride
+ +