diff --git a/hotel_booking/admin/ajax/room.php b/hotel_booking/admin/ajax/room.php
index 16bec53..31df4e7 100644
--- a/hotel_booking/admin/ajax/room.php
+++ b/hotel_booking/admin/ajax/room.php
@@ -50,4 +50,84 @@
echo 0;
}
}
+
+ if(isset($_POST['get_all_rooms'])){
+ $res = selectAll('rooms');
+ $i = 0;
+ $data = "";
+
+ while($row = mysqli_fetch_assoc($res)){
+ if($row['status']==1){
+ $status = "
+
+ ";
+ } else{
+ $status = "
+
+ ";
+ }
+
+ $data.="
+
+ $i |
+ $row[name] |
+ $row[area] sq.ft. |
+
+ Adult: $row[adult]
+ Children: $row[children]
+ |
+ $$row[price] |
+ $row[quantity] |
+ $status |
+
+
+ |
+
+ ";
+ $i++;
+ }
+ echo $data;
+ }
+
+ if(isset($_POST['get_room'])){
+ $frm_data = filteration($_POST);
+ $res1 = select("SELECT * FROM `rooms` WHERE `id`=?", [$frm_data['get_room']], 'i');
+ $res2 = select("SELECT * FROM `room_accommodation` WHERE `room_id`=?", [$frm_data['get_room']], 'i');
+ $res3 = select("SELECT * FROM `room_additionalAccom` WHERE `room_id`=?", [$frm_data['get_room']], 'i');
+
+ $roomdata = mysqli_fetch_assoc($res1);
+ $accommodation = [];
+ $additional_accomm = [];
+
+ if(mysqli_num_rows($res2)>0){
+ while($row = mysqli_fetch_assoc($res2)){
+ array_push($accommodation, $row['accommodation_id']);
+ }
+ }
+ if(mysqli_num_rows($res3)>0){
+ while($row = mysqli_fetch_assoc($res3)){
+ array_push($additional_accomm, $row['additionalAccom_id']);
+ }
+ }
+ $data = ["roomdata" => $roomdata, "accommodation" => $accommodation, "additional_accomm" => $additional_accomm];
+ $data = json_encode($data);
+
+ echo $data;
+ }
+
+ if(isset($_POST['edit_room'])){
+
+ }
+
+ if(isset($_POST['toggleStatus'])){
+ $frm_data = filteration($_POST);
+ $q = "UPDATE `rooms` SET `status`=? WHERE `id`=?";
+ $values = [$frm_data['value'], $frm_data['toggleStatus']];
+
+ if(update($q, $values, 'ii')){
+ echo 1;
+ } else{
+ echo 0;
+ }
+ }
?>
\ No newline at end of file
diff --git a/hotel_booking/admin/rooms.php b/hotel_booking/admin/rooms.php
index 24b2ab8..b2c5db4 100644
--- a/hotel_booking/admin/rooms.php
+++ b/hotel_booking/admin/rooms.php
@@ -139,10 +139,102 @@
+
+
+
+
+
+
+
+
+
+
+