diff --git a/admin/survey/classes/class.Notifications.php b/admin/survey/classes/class.Notifications.php
index 5e12ab737..367e2d3b2 100644
--- a/admin/survey/classes/class.Notifications.php
+++ b/admin/survey/classes/class.Notifications.php
@@ -85,10 +85,10 @@ class Notifications {
// Napolnimo array prejetih sporocil
$recievedMessages = array();
- $sql = sisplet_query("SELECT n.id AS id, n.recipient AS recipient, n.viewed AS viewed, m.id AS message_id, m.date AS date, m.title AS title, m.text AS text
+ $sql = sisplet_query("SELECT n.id AS id, n.recipient AS recipient, n.viewed AS viewed, m.id AS message_id, m.send_time AS send_time, m.title AS title, m.text AS text
FROM srv_notifications n, srv_notifications_messages m
WHERE n.recipient='".$global_user_id."' AND n.message_id=m.id
- ORDER BY m.date DESC");
+ ORDER BY m.send_time DESC");
while($row = mysqli_fetch_array($sql)){
$recievedMessages[$row['id']] = $row;
}
@@ -107,7 +107,7 @@ class Notifications {
echo $message['title'];
echo '';
echo '
';
- echo $message['date'];
+ echo date('Y-m-d H:i:s', strtotime($message['send_time']));
echo '
';
echo '';
@@ -129,7 +129,7 @@ class Notifications {
// Napolnimo array poslanih sporocil
$sentMessages = array();
- $sql = sisplet_query("SELECT * FROM srv_notifications_messages WHERE author='".$global_user_id."' ORDER BY date DESC");
+ $sql = sisplet_query("SELECT * FROM srv_notifications_messages WHERE author='".$global_user_id."' ORDER BY send_time DESC");
while($row = mysqli_fetch_array($sql)){
$sentMessages[$row['id']] = $row;
}
@@ -147,7 +147,7 @@ class Notifications {
echo $message['title'];
echo '';
echo '';
- echo $message['date'];
+ echo date('Y-m-d H:i:s', strtotime($message['send_time']));
echo '
';
echo '';
@@ -327,7 +327,7 @@ class Notifications {
if($recipient_all_slo == 1 || $recipient_all_ang == 1){
// Dodamo novo sporocilo v bazo
- $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, date, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
+ $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, send_time, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
$message_id = mysqli_insert_id($GLOBALS['connect_db']);
$note = '';
@@ -354,7 +354,7 @@ class Notifications {
$rowU = mysqli_fetch_array($sqlU);
// Dodamo novo sporocilo v bazo
- $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, date, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
+ $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, send_time, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
$message_id = mysqli_insert_id($GLOBALS['connect_db']);
// Dodamo novo sporocilo v bazo
@@ -418,7 +418,7 @@ class Notifications {
$sql = sisplet_query("UPDATE srv_notifications SET viewed='1' WHERE id='$id'");
// Dobimo sporocilo
- $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.date AS date
+ $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.send_time AS send_time
FROM srv_notifications n, srv_notifications_messages m
WHERE n.id='$id' AND m.id=n.message_id");
$row = mysqli_fetch_array($sql);
@@ -446,11 +446,11 @@ class Notifications {
echo '';
echo '';
- echo '('.$row['date'].')';
+ echo '('.date('Y-m-d H:i:s', strtotime($row['send_time'])).')';
echo '
';
// Stara sporocila so brez editorja
- $text = (strtotime($row['date']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
+ $text = (strtotime($row['send_time']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
echo '';
echo $text;
echo '
';
@@ -470,17 +470,17 @@ class Notifications {
echo '';
// Loop cez vsa neprebrana sporocila
- $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.date AS date, n.viewed AS viewed
+ $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.send_time AS send_time, n.viewed AS viewed
FROM srv_notifications n, srv_notifications_messages m
WHERE n.recipient='".$global_user_id."' AND n.viewed='0' AND m.id=n.message_id
- ORDER BY m.date DESC");
+ ORDER BY m.send_time DESC");
while($row = mysqli_fetch_array($sql)){
echo '- ';
- echo ''.$row['title'].' ('.$row['date'].')';
+ echo ''.$row['title'].' ('.date('Y-m-d H:i:s', strtotime($row['send_time'])).')';
// Stara sporocila so brez editorja
- $text = (strtotime($row['date']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
+ $text = (strtotime($row['send_time']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
echo '
'.$text;
echo ' ';
diff --git a/sql/update2.sql b/sql/update2.sql
index 5a17d5685..a37b62add 100644
--- a/sql/update2.sql
+++ b/sql/update2.sql
@@ -9584,3 +9584,7 @@ INSERT INTO srv_help (what, help) VALUES ('srv_glasovanje_archive', 'Dodaj anket
UPDATE misc SET value='21.11.16' WHERE what="version";
## !!!!! Uvozi sql/srv_help_new.sql datoteko za nove help vprasajcke
+
+ALTER TABLE srv_notifications_messages CHANGE date send_time DATETIME(3) NOT NULL AFTER author;
+
+UPDATE misc SET value='22.03.31' WHERE what="version";