<?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();
$date = date("d-m-Y");

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

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

	


}

?>