send email; manage notis and email logs
This commit is contained in:
36
_include/include_notifications.php
Normal file
36
_include/include_notifications.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
# HA NINCS ID, AKKOR ÉRTESÍTÉSEK
|
||||
|
||||
if ($this->is_id()) {
|
||||
|
||||
}
|
||||
else {
|
||||
# ÉRTESÍTÉSEK
|
||||
|
||||
//hány óránként küldünk emailt
|
||||
$notify_hours = $sql->single_variable(' SELECT
|
||||
setv_int
|
||||
FROM
|
||||
setting_value
|
||||
JOIN
|
||||
setting ON setv_setting_set_id = set_id
|
||||
WHERE
|
||||
set_name = "Értesítések közt eltelt idő";
|
||||
;');
|
||||
|
||||
//akiket értesítettünk az elmúlt x órában
|
||||
$notifiedKids = $sql->assoc_array('select * from user_kid WHERE DATE_SUB(CURDATE(),INTERVAL '.$notify_hours.' HOUR) <= uk_last_notification order by uk_name ASC;');
|
||||
|
||||
$kid_array = array();
|
||||
foreach ($notifiedKids as $key => $kid) {
|
||||
$new_kid = new user_kid();
|
||||
$new_kid->set_user_data_by_id($kid['uk_id']);
|
||||
$kid_array[] = $new_kid;
|
||||
}
|
||||
$smarty->assign('kid_array', $kid_array);
|
||||
$smarty->display('notifications.tpl');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user