<?php 
include('session.php');
$complaintRole = $_SESSION['role'] ?? '';
if(in_array($complaintRole, array('ge_admin', 'department_admin', 'je', 'contractor'), true)) {
	echo '<script>alert("You are not allowed to delete complaints.");window.history.go(-1);</script>';
	exit;
}
$id = $_GET['id'];
$st = $_GET['st'];
$delete = $conn->query("UPDATE users_complaint SET status='".$st."' WHERE ucid=".$id);
if($delete){
	echo '<script>alert("Data updated Successfully");window.history.go(-1);</script>';
} else {
	echo '<script>alert('.$conn->error.');window.history.go(-1);</script>';
}
?>
