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

	if(isset($_POST['edit'])){
		$notice = $_POST['notice']; 
		$sql = "INSERT INTO notice(notice) VALUES ('$notice')"; 

		if($conn->query($sql)){
			$_SESSION['success'] = 'Notice Added successfully';

			
		}
		else{
			$_SESSION['error'] = $conn->error;
		}
	}
	else{
		$_SESSION['error'] = 'Fill up edit form first';
	}
 echo '<script type="text/javascript">
            alert("Notice Added!!!");
            window.location.href = "notices.php";
        </script>';


?>