<?php 
include ('dbconnect.php');
session_start();
$id = mysqli_real_escape_string($connection, $_POST ['id']);
$subject = mysqli_real_escape_string($connection, $_POST ['subject']);
$message = mysqli_real_escape_string($connection, $_POST ['message']);
$visible = "none";

if (mysqli_connect_error())
    {
		die('Connect Error('.mysqli_connect_errno().')'. mysqli_connect_error());
	} else
	{
    $query = "INSERT Into `notifications` (`id`, `subject`, `message`) 
    Values('$id', '$subject', '$message')";
	$query_run =mysqli_query($connection,$query);
    if($query_run)
    {
    $_SESSION['status'] = "<p style='padding:15px; background: #4E9C81; color: #fff; border-radius:10px;'>Notification Sent</p>";	
	header("location:../user.php?id=$id");
	}
	}
?>