diff --git a/admin.php b/admin.php
new file mode 100644
index 0000000..ecc9035
--- /dev/null
+++ b/admin.php
@@ -0,0 +1,221 @@
+ 'Normal', 'V' => 'Vegetarian', 'G' => 'Vegan'];
+ return $types[$char] ?? 'Unknown';
+}
+
+$message = '';
+$error = '';
+$edit_meal = null;
+
+try {
+ $pdo = db();
+
+ // Handle Delete
+ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_id'])) {
+ $stmt = $pdo->prepare("DELETE FROM meals WHERE id = ?");
+ $stmt->execute([$_POST['delete_id']]);
+ $message = 'Meal deleted successfully!';
+ }
+ // Handle Add/Update
+ elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ $day_of_week = $_POST['day_of_week'] ?? '';
+ $meal_type = $_POST['meal_type'] ?? '';
+ $name = $_POST['name'] ?? '';
+ $description = $_POST['description'] ?? '';
+ $id = $_POST['update_id'] ?? null;
+
+ if (empty($day_of_week) || empty($meal_type) || empty($name)) {
+ $error = 'Please fill in all required fields (Day, Meal Type, Name).';
+ } else {
+ if ($id) {
+ // Update
+ $stmt = $pdo->prepare("UPDATE meals SET day_of_week = ?, meal_type = ?, name = ?, description = ? WHERE id = ?");
+ $stmt->execute([$day_of_week, $meal_type, $name, $description, $id]);
+ $message = 'Meal updated successfully!';
+ } else {
+ // Insert
+ $stmt = $pdo->prepare("INSERT INTO meals (day_of_week, meal_type, name, description) VALUES (?, ?, ?, ?)");
+ $stmt->execute([$day_of_week, $meal_type, $name, $description]);
+ $message = 'Meal added successfully!';
+ }
+ }
+ }
+
+ // Handle Edit - Fetch meal to edit
+ if (isset($_GET['edit_id'])) {
+ $stmt = $pdo->prepare("SELECT * FROM meals WHERE id = ?");
+ $stmt->execute([$_GET['edit_id']]);
+ $edit_meal = $stmt->fetch(PDO::FETCH_ASSOC);
+ }
+
+ // Fetch all meals for display
+ $stmt = $pdo->query("SELECT * FROM meals ORDER BY FIELD(day_of_week, 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'), meal_type");
+ $meals = $stmt->fetchAll(PDO::FETCH_ASSOC);
+
+} catch (PDOException $e) {
+ $error = 'Database error: ' . $e->getMessage();
+ $meals = [];
+}
+
+?>
+
+
+
+
+
+ Admin - Meal Management
+
+
+
+
+
+
+
+
+
+
+
+
+ Meal Management
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Day |
+ Type |
+ Name |
+ Description |
+ Actions |
+
+
+
+
+
+ | No meals found. Add one above! |
+
+
+
+
+ |
+ |
+ |
+ |
+
+ Edit
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..baad9aa
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,67 @@
+@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Lato:wght@400;700&display=swap');
+
+:root {
+ --primary-color: #4A90E2;
+ --secondary-color: #50E3C2;
+ --background-color: #F4F7F6;
+ --surface-color: #FFFFFF;
+ --text-color: #333333;
+ --text-muted-color: #6c757d;
+ --border-radius: 0.5rem;
+}
+
+body {
+ font-family: 'Lato', sans-serif;
+ background-color: var(--background-color);
+ color: var(--text-color);
+}
+
+h1, h2, h3, h4, h5, h6, .navbar-brand, .fw-bold {
+ font-family: 'Poppins', sans-serif;
+}
+
+.btn-primary {
+ background-color: var(--primary-color);
+ border-color: var(--primary-color);
+ transition: all 0.3s ease;
+}
+
+.btn-primary:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
+}
+
+.text-primary {
+ color: var(--primary-color) !important;
+}
+
+.hero-section {
+ background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
+ padding: 6rem 0;
+ margin-bottom: 3rem;
+}
+
+.navbar-brand {
+ color: var(--primary-color) !important;
+}
+
+.nav-link.active {
+ font-weight: bold;
+ color: var(--primary-color) !important;
+}
+
+.day-card {
+ border-radius: var(--border-radius);
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
+}
+
+.day-card:hover {
+ transform: translateY(-5px);
+ box-shadow: 0 8px 25px rgba(0,0,0,0.08);
+}
+
+.meal-card {
+ background-color: #f8f9fa;
+ border-radius: var(--border-radius);
+ border: 1px solid #e9ecef;
+}
diff --git a/db/migrate.php b/db/migrate.php
new file mode 100644
index 0000000..2687a99
--- /dev/null
+++ b/db/migrate.php
@@ -0,0 +1,20 @@
+exec($sql);
+ echo "Successfully executed migration: " . basename($file) . "\n";
+ } catch (PDOException $e) {
+ echo "Error executing migration: " . basename($file) . " - " . $e->getMessage() . "\n";
+ }
+}
+
diff --git a/db/migrations/001_create_meals_table.sql b/db/migrations/001_create_meals_table.sql
new file mode 100644
index 0000000..c147b9e
--- /dev/null
+++ b/db/migrations/001_create_meals_table.sql
@@ -0,0 +1,9 @@
+
+CREATE TABLE IF NOT EXISTS meals (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ day_of_week VARCHAR(20) NOT NULL,
+ meal_type CHAR(1) NOT NULL,
+ name VARCHAR(255) NOT NULL,
+ description TEXT,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
diff --git a/db/migrations/002_insert_sample_meals.sql b/db/migrations/002_insert_sample_meals.sql
new file mode 100644
index 0000000..e261220
--- /dev/null
+++ b/db/migrations/002_insert_sample_meals.sql
@@ -0,0 +1,17 @@
+-- Sample Meals
+INSERT INTO `meals` (`day_of_week`, `name`, `description`, `meal_type`) VALUES
+('Monday', 'Spaghetti Bolognese', 'Classic Italian meat sauce with pasta', 'N'),
+('Monday', 'Lentil Shepherd''s Pie', 'A hearty vegetarian shepherd''s pie with a lentil filling.', 'V'),
+('Monday', 'Mushroom Risotto', 'Creamy risotto with fresh mushrooms', 'G'),
+('Tuesday', 'Chicken Teriyaki', 'Grilled chicken with a sweet and savory teriyaki sauce', 'N'),
+('Tuesday', 'Black Bean Burgers', 'Homemade black bean burgers on a whole wheat bun.', 'V'),
+('Tuesday', 'Quinoa Salad', 'Healthy and refreshing quinoa salad with mixed vegetables', 'G'),
+('Wednesday', 'Beef Tacos', 'Spicy ground beef in a crispy taco shell', 'N'),
+('Wednesday', 'Spinach and Feta Stuffed Peppers', 'Bell peppers stuffed with a savory mixture of spinach, feta cheese, and rice.', 'V'),
+('Wednesday', 'Vegetable Curry', 'A flavorful curry with a variety of fresh vegetables', 'G'),
+('Thursday', 'Fish and Chips', 'Classic battered fish with a side of french fries', 'N'),
+('Thursday', 'Eggplant Parmesan', 'Slices of breaded eggplant, fried and layered with cheese and tomato sauce.', 'V'),
+('Thursday', 'Sweet Potato and Black Bean Burritos', 'Hearty burritos filled with a sweet and savory mixture.', 'G'),
+('Friday', 'Pizza Salami', 'Classic pizza with tomato sauce, cheese, and salami', 'N'),
+('Friday', 'Four Cheese Pizza', 'A delicious pizza topped with four different kinds of cheese.', 'V'),
+('Friday', 'Vegan Pizza', 'Pizza with a variety of fresh vegetables and vegan cheese', 'G');
\ No newline at end of file
diff --git a/db/migrations/003_create_users_table.sql b/db/migrations/003_create_users_table.sql
new file mode 100644
index 0000000..355b1be
--- /dev/null
+++ b/db/migrations/003_create_users_table.sql
@@ -0,0 +1,7 @@
+CREATE TABLE IF NOT EXISTS users (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ username VARCHAR(50) NOT NULL UNIQUE,
+ email VARCHAR(100) NOT NULL UNIQUE,
+ password VARCHAR(255) NOT NULL,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
diff --git a/db/migrations/004_add_role_to_users_table.sql b/db/migrations/004_add_role_to_users_table.sql
new file mode 100644
index 0000000..5115ee0
--- /dev/null
+++ b/db/migrations/004_add_role_to_users_table.sql
@@ -0,0 +1 @@
+ALTER TABLE users ADD COLUMN role VARCHAR(50) NOT NULL DEFAULT 'user';
diff --git a/index.php b/index.php
index 7205f3d..5e0d33e 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,105 @@
-
-
+
+
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ eMenza - School Meal Management
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
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) ?>
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
View Menus
+
Easily check the upcoming weekly menu with detailed descriptions and allergen info.
+
+
+
+
+
+
+
+
Order Ahead
+
Pre-order your meals for the week with just a few clicks. Cancel anytime before the deadline.
+
+
+
+
+
+
+
+
Easy Payments
+
Manage your balance and pay for your meals securely online or in person.
+
+
+
+
+
+
+
+
+
+
+
-
+