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

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

$update_category = mysqli_query($conn_1, "UPDATE hostel_blockss SET
    title='$title',
    description='$description',
    campus_id='$campus',
    bed_space='$bedspace',
    gender='$gender',
    hostel_amount='$amount',
    date_modified=NOW(),
     modified_by='$modified_by',
    reserved='$reserved'
    WHERE id ='$cat_id'
");
     if($update_category){
         $status='Successfully updated.';
       }else{
         $status='Something went wrong, contact ict.';
       }

echo $status;


?>
