<?php
error_reporting(0);
session_start();

include_once('../../../db_connect/db.php');
if(isset($_SESSION['admin_id'])){

	$admin_id = $_SESSION['admin_id'];
}else{
	$admin_id =0;
}
$campus_id=mysqli_real_escape_string($con,$_POST["campus_id"]);
$block_id=mysqli_real_escape_string($con,$_POST["block_id"]);
$title=mysqli_real_escape_string($con,$_POST["title"]);
$description=mysqli_real_escape_string($con,$_POST["description"]);
$bedspace=mysqli_real_escape_string($con,$_POST["bedspace"]);
$gender=mysqli_real_escape_string($con,$_POST["gender"]);
$amount=mysqli_real_escape_string($con,$_POST["amount"]);
$status=mysqli_real_escape_string($con,$_POST["status"]);



		// $insert = mysqli_query($con,"UPDATE faculties SET modified_by='$admin_id',date_modified=now()
		// ,title='$title',code='$code',email='$email',location='$location',phone_contacts='$phone_contacts',description='$description' WHERE faculty_id='$faculty_id'");

$insert = mysqli_query($con,"UPDATE hostel_categories SET
													title='$title',
													description='$description',
													hostel_site='$campus_id',
													bed_space='$bedspace',
													gender='$gender',
													hostel_amount='$amount',
													date_modified= NOW(),
													modified_by='$admin_id',
													reserved='$status'
													WHERE id='$block_id'") or die(mysqli_error($con));


							if($insert){

								echo 1;


							} else{

								echo '<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><strong>Alert!</strong> not updated </div>';
							}
