diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..29acf16 --- /dev/null +++ b/admin.php @@ -0,0 +1,172 @@ +prepare("INSERT INTO buildings (name) VALUES (?)"); + $stmt->execute([$_POST['building_name']]); + } elseif (isset($_POST['add_room'])) { + $stmt = $pdo->prepare("INSERT INTO rooms (building_id, name, capacity) VALUES (?, ?, ?)"); + $stmt->execute([$_POST['building_id'], $_POST['room_name'], $_POST['capacity']]); + } + header("Location: admin.php"); + exit; +} + +// Fetch data +$pdo = db(); +$buildings = $pdo->query("SELECT * FROM buildings ORDER BY name")->fetchAll(PDO::FETCH_ASSOC); +$rooms = $pdo->query("SELECT r.*, b.name as building_name FROM rooms r JOIN buildings b ON r.building_id = b.id ORDER BY b.name, r.name")->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + + Admin - Room Reservation Manager + + + + + + + + + +
+

Admin Dashboard

+ +
+ +
+
+
+

Manage Buildings

+
+
+

Add New Building

+
+
+ + +
+
+ +

Existing Buildings

+ + + + + + + + + + + + + + + + + + + + +
NameActions
+ +
No buildings found.
+
+
+
+ + +
+
+
+

Manage Rooms

+
+
+

Add New Room

+
+
+ +
+
+ +
+
+ +
+ +
+ +

Existing Rooms

+ + + + + + + + + + + + + + + + + + + + + + + + +
RoomBuildingCapacityStatus
+ + + +
No rooms found.
+
+
+
+
+
+ + + + diff --git a/index.php b/index.php index 7205f3d..2b213d9 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,51 @@ - - - - - - New Style - - - - - - - - - - - - - - - - - - - + + + + + + Room Reservation Manager + + + + + -
-
-

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

+ + +
+

Welcome to the Room Reservation Manager

+

The foundational admin panel for managing buildings and rooms is now ready.

+ Go to Admin Panel
-
- + +