diff --git a/add_task.php b/add_task.php new file mode 100644 index 0000000..75d857b --- /dev/null +++ b/add_task.php @@ -0,0 +1,23 @@ +prepare("INSERT INTO tasks (title, description) VALUES (?, ?)"); + $stmt->execute([$title, $description]); + } catch (PDOException $e) { + header("Location: index.php?error=" . urlencode("Database error: " . $e->getMessage())); + exit; + } + } + header("Location: index.php?success=1"); + exit; +} else { + header("Location: index.php"); + exit; +} diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..bc80560 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,40 @@ +body { + background-color: #f8f9fa; + font-family: 'Inter', sans-serif; +} + +.kanban-board { + display: flex; + gap: 1rem; + overflow-x: auto; + padding-bottom: 1rem; +} + +.kanban-column { + background-color: #e9ecef; + border-radius: 0.5rem; + padding: 1rem; + width: 320px; + flex-shrink: 0; +} + +.kanban-column h3 { + font-size: 1.2rem; + font-weight: 600; + margin-bottom: 1rem; +} + +.task-card { + background-color: #fff; + border: 1px solid #dee2e6; + border-radius: 0.25rem; + padding: 1rem; + margin-bottom: 1rem; + cursor: grab; + box-shadow: 0 1px 3px rgba(0,0,0,0.05); +} + +.task-card:active { + cursor: grabbing; + background-color: #f1f3f5; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..c9f2177 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1 @@ +// Will be used for drag and drop functionality later. \ No newline at end of file diff --git a/db/migrations/001_create_initial_tables.sql b/db/migrations/001_create_initial_tables.sql new file mode 100644 index 0000000..a516a08 --- /dev/null +++ b/db/migrations/001_create_initial_tables.sql @@ -0,0 +1,16 @@ +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 +); + +CREATE TABLE IF NOT EXISTS tasks ( + id INT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + status VARCHAR(50) NOT NULL DEFAULT 'To Do', + user_id INT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (user_id) REFERENCES users(id) +); \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..98a2193 --- /dev/null +++ b/footer.php @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/header.php b/header.php new file mode 100644 index 0000000..17860f9 --- /dev/null +++ b/header.php @@ -0,0 +1,33 @@ + + + + + + webinar 1 crm task management app + + + + + + + + + + + + + + + + + + + +
diff --git a/index.php b/index.php index 7205f3d..74e2012 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,82 @@ exec($sql); + } + } catch (PDOException $e) { + // In a real app, you'd log this error. + // For now, we'll just output a generic error. + die("Database migration failed: " . $e->getMessage()); + } +} + +// Run migrations +run_migrations(); + +// Fetch tasks +$tasks = []; +try { + $pdo = db(); + $stmt = $pdo->query("SELECT * FROM tasks ORDER BY created_at DESC"); + $tasks = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + echo '
Database error: Could not fetch tasks.
'; +} + +$tasks_by_status = [ + 'To Do' => [], + 'In Progress' => [], + 'Done' => [] +]; + +foreach ($tasks as $task) { + if (isset($tasks_by_status[$task['status']])) { + $tasks_by_status[$task['status']][] = $task; + } +} -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); ?> - - - - - - New Style - - - - - - - - - - - - - - - - - - - - - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + + -
- - - + + + + + + +
+ $tasks_in_status): ?> +
+

+ +
+
+

+
+ + +
No tasks yet.
+ +
+ +
+ + \ No newline at end of file