<?php
include('../../db_connect/db.php');

//get datas from the form
$title = $_POST['title'];
$room_id =$_POST['room_id'];
$campus = $_POST['campus'];
$category=$_POST['category'];
$description = $_POST['description'];
$date_modified = $_POST['date_modified'];
$modified_by=$_POST['modified_by'];
$reserved = $_POST['reserved'];
$bedspace = $_POST['bedspace'];
$status=$_POST['status'];





            //update into the database


        //update Details
        $update = mysqli_query($conn_1, " UPDATE hostel_rooms SET
        title='$title',
        description='$description',
        campus_id='$campus',
        block_id='$category',
        published='$status',
        bedspace = '$bedspace',
        reserved = '$reserved',
        date_modified = NOW(),
        modified_by = '$modified_by'
        WHERE id='$room_id'
        ");
            if($update){
              echo "Updated successfully";
            }else{
              echo "Error in updating script, contact ict";
            }


?>
