<?php

session_start();

require_once "../../SystemController/DbConnection.php";

if($_SERVER['REQUEST_METHOD'] == "POST"){

$msg = $_POST['msg'];
$userID = $_POST['id'];

$seen = 0;

$db_handle = new DbConnection();

$insert = $db_handle->insertRecord("insert into notifications(userID,message,seen) VALUES (?,?,?)", "isi",array($userID,$msg,$seen));

if($insert){
	echo "Your message has been sent successfully";
}

	


}

?>