<?php
require_once('../wu_init.php');
if (!wu_token()) { exit('wu-error'); }
if (!USER_LOGGED) { exit('wu-error'); }
include('wu_checkadmin.php');

if(isset($_POST['usr']) && isset($_POST['msg']) && isset($_POST['type'])){
if(!empty($_POST['msg'])){
$usr = intval($_POST['usr']);
$msg = mysqli_real_escape_string($connect_db, trim($_POST['msg']));
$type = intval($_POST['type']);

mysqli_query($connect_db, "INSERT INTO `".DB_PREFIX."_notif` (usr,msg,st,dt) VALUES ('$usr','$msg','$type','$dt')");

exit('1');
} else { exit('0'); }
} else { exit('wu-error'); }
?>