2023-03-04 23:45:46 +00:00
|
|
|
<?php
|
2023-11-12 18:12:42 +00:00
|
|
|
if (!DEFINED('EGP'))
|
|
|
|
exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
class notice_help extends cron
|
|
|
|
{
|
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
global $cfg, $sql, $start_point;
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
$time = $start_point - 3600;
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
$helps = $sql->query('SELECT `id`, `user`, `time` FROM `help` WHERE `status`="0" AND `time`<"' . $time . '" AND `notice`="0" AND `close`="0"');
|
|
|
|
while ($help = $sql->get($helps)) {
|
|
|
|
$sql->query('SELECT `mail` FROM `users` WHERE `id`="' . $help['user'] . '" AND `time`<"' . $help['time'] . '" AND `notice_help`="1" LIMIT 1');
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
if (!$sql->num())
|
|
|
|
continue;
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
$user = $sql->get();
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
if (!sys::mail('Техническая поддержка', sys::updtext(sys::text('mail', 'notice_help'), array('site' => $cfg['name'], 'url' => $cfg['http'] . 'help/section/dialog/id/' . $help['id'])), $user['mail']))
|
|
|
|
continue;
|
2023-03-04 23:45:46 +00:00
|
|
|
|
2023-11-12 18:12:42 +00:00
|
|
|
$sql->query('UPDATE `help` set `notice`="1" WHERE `id`="' . $help['id'] . '" LIMIT 1');
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
2023-05-05 01:17:19 +00:00
|
|
|
|
2023-03-04 23:45:46 +00:00
|
|
|
?>
|