View file siwap.ru/AJAX/notifications/readNotifications.php
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/system/App.php');
if($sys->isAjax() && $_SERVER['REQUEST_METHOD'] == 'POST' && $me)
{
if ($notifications->read())
{
$json = [
'success' => 1,
'comment' => 'Оповещения успешно прочитаны',
];
}
else
{
$json = [
'error' => 1,
'comment' => 'Пока пусто'
];
}
}
else
{
$json = [
'error' => 1,
'comment' => '404 Bad Request'
];
}
echo json_encode($json, JSON_UNESCAPED_UNICODE);