<?php
	include 'includes/session.php';
	include 'includes/sessions.php';


	if(isset($_POST['delete'])){
		$id = $_POST['id'];
		$sql = "DELETE FROM notice WHERE id = '$id'";
		if($conn->query($sql)){
			$_SESSION['success'] = 'Notice deleted successfully';
		} 
		else{
			$_SESSION['error'] = $conn->error;
		}
	}
	else{
		$_SESSION['error'] = 'Select item to delete first';
	}

	header('location: users.php');
	
?>