2020-08-14 13:36:36 +02:00
< ? php
/**
*
*
* Class za posiljanje sporocil uporabnikom ( v mojih anketah )
*
*
*/
class Notifications {
function __construct () {
global $admin_type , $global_user_id ;
}
public function display ( $tab = 0 ){
global $admin_type , $global_user_id , $lang ;
2022-03-25 01:52:29 +01:00
2020-08-14 13:36:36 +02:00
// Prikazemo poslana sporocila
if (( isset ( $_GET [ 't' ]) && $_GET [ 't' ] == 'sent' ) || $tab == 1 ){
2022-03-25 01:52:29 +01:00
echo '<div class="notifications_content">' ;
2020-08-14 13:36:36 +02:00
// Izpis vseh poslanih sporocil
if ( $admin_type == 0 ){
2022-03-25 01:52:29 +01:00
echo '<div class="notifications_content_left">' ;
2022-03-28 17:23:46 +02:00
echo '<div class="title">' ;
echo '<div class="title_icon"><span class="faicon inv_sent_1"></span></div>' ;
echo '<h2>' . $lang [ 'srv_notifications_sent' ] . '</h2>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
$this -> displaySentMessages ();
echo '</div>' ;
// obrazec za posiljanje sporocil
2022-03-28 17:23:46 +02:00
echo '<div class="notifications_content_right">' ;
echo '<div class="title">' ;
echo '<div class="title_icon"><span class="faicon inv_sent_0"></span></div>' ;
echo '<h2>' . $lang [ 'srv_inv_message_draft_new' ] . '</h2>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
$this -> sendMessageForm ();
2022-03-28 17:23:46 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
else
2022-03-25 01:52:29 +01:00
echo $lang [ 'srv_notifications_admin_alert' ];
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
// Prikazemo prejeta sporocila
else {
2022-03-28 23:06:03 +02:00
echo '<div class="title">' ;
echo '<div class="title_icon"><span class="faicon fa-inbox"></span></div>' ;
echo '<h2>' . $lang [ 'srv_notifications_recieved' ] . '</h2>' ;
echo '</div>' ;
echo '<div class="notifications_content">' ;
echo '<div class="notifications_content_left">' ;
2020-08-14 13:36:36 +02:00
echo '<div class="recieved_list">' ;
$this -> displayRecievedMessages ();
echo '</div>' ;
2022-03-28 23:06:03 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-28 23:06:03 +02:00
echo '<div class="notifications_content_right">' ;
2020-08-14 13:36:36 +02:00
echo '<div id="message" style="display:none;"></div>' ;
2022-03-28 23:06:03 +02:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
}
private function displayRecievedMessages ( $active = 0 ){
global $admin_type , $global_user_id , $lang ;
// 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
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 " );
while ( $row = mysqli_fetch_array ( $sql )){
$recievedMessages [ $row [ 'id' ]] = $row ;
}
echo '<ul>' ;
if ( count ( $recievedMessages ) > 0 ){
foreach ( $recievedMessages as $message ){
2022-03-29 13:47:49 +02:00
echo '<li class="' . ( $active > 0 && $message [ 'id' ] == $active ? ' active' : '' ) . '" onclick="viewMessage(\'' . $message [ 'id' ] . '\'); return false;">' ;
echo '<span class="faicon fa-circle ' . ( $message [ 'viewed' ] == 0 ? ' unread' : '' ) . '"></span>' ;
2022-03-28 23:54:00 +02:00
echo '<div class="title_row">' ; //sem noter pride še oznaka, če je obvestilo ali sporočilo
echo '<div class="subject">' ;
echo $message [ 'title' ];
echo '</div>' ;
echo '<div class="date">' ;
echo $message [ 'date' ];
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-28 23:54:00 +02:00
$text = strip_tags ( $message [ 'text' ]);
echo '<div class="content">' ;
echo $text ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</li>' ;
}
}
echo '</ul>' ;
}
private function displaySentMessages (){
global $admin_type , $global_user_id , $lang ;
2022-03-25 01:52:29 +01:00
2020-08-14 13:36:36 +02:00
// Napolnimo array poslanih sporocil
$sentMessages = array ();
$sql = sisplet_query ( " SELECT * FROM srv_notifications_messages WHERE author=' " . $global_user_id . " ' ORDER BY date DESC " );
while ( $row = mysqli_fetch_array ( $sql )){
$sentMessages [ $row [ 'id' ]] = $row ;
}
if ( count ( $sentMessages ) > 0 ){
2022-03-28 23:06:03 +02:00
echo '<div class="sent_list">' ;
echo '<ul>' ;
2020-08-14 13:36:36 +02:00
foreach ( $sentMessages as $message_id => $message ){
echo '<li>' ;
2022-03-25 01:52:29 +01:00
2022-03-28 23:54:00 +02:00
echo '<div class="title_row">' ; //sem noter pride še oznaka, če je obvestilo ali sporočilo
2022-03-25 01:52:29 +01:00
echo '<div class="subject">' ;
echo $message [ 'title' ];
echo '</div>' ;
echo '<div class="date">' ;
2022-03-25 09:06:20 +01:00
echo $message [ 'date' ];
2022-03-25 01:52:29 +01:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
2022-03-28 23:06:03 +02:00
$text = strip_tags ( $message [ 'text' ]);
2022-03-25 01:52:29 +01:00
echo '<div class="content">' ;
echo $text ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Gumb da se sporocilo razresi vsem (kot da so ga pregledali)
$sqlN = sisplet_query ( " SELECT message_id FROM srv_notifications WHERE message_id=' " . $message_id . " ' AND viewed='0' " );
$count = mysqli_num_rows ( $sqlN );
if ( $count > 0 ){
2022-03-29 13:37:12 +02:00
echo '<div class="resolve" onclick="resolveMessages(\'' . $message_id . '\'); return false;">' ;
echo '<span class="faicon fa-check"></span>' ;
echo $lang [ 'srv_notifications_sent_resolve' ] . ' (' . $count . ')' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
echo '</li>' ;
2022-03-28 23:06:03 +02:00
}
echo '</ul>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-28 23:06:03 +02:00
else //Ni poslanih sporočil
echo '<p>' . $lang [ 'srv_notifications_sent_none' ] . '.</p>' ;
2020-08-14 13:36:36 +02:00
}
// Obrazec za posiljanje sporocila
private function sendMessageForm ( $note = '' ){
global $admin_type , $global_user_id , $lang ;
echo '<div class="send_form">' ;
2022-03-28 17:23:46 +02:00
//Prejemniki
echo '<div class="setting_holder">' ;
echo '<span class="setting_title">' . $lang [ 'srv_notifications_send_reciever2' ] . ':</span>' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" value="1" name="recipient_all_slo" id="recipient_all_slo" onChange="recipient_toggle(\'slo\');">' ;
echo '<label for="recipient_all_slo">' . $lang [ 'srv_notifications_send_all_slo' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" value="1" name="recipient_all_ang" id="recipient_all_ang" onChange="recipient_toggle(\'ang\');">' ;
echo '<label for="recipient_all_ang">' . $lang [ 'srv_notifications_send_all_ang' ] . '</label>' ;
echo '</div>' ;
echo '<div class="setting_item">' ;
echo '<input type="checkbox" value="1" name="recipient_custom" id="recipient_custom" onChange="recipient_toggle(\'custom\');">' ;
echo '<label for="recipient_custom">' . $lang [ 'srv_notifications_send_custom' ] . '</label>' ;
echo '<input type="text" class="text large disabled" name="recipient" id="recipient">' ;
echo '</div>' ;
echo '</div>' ;
2021-08-26 10:00:13 +02:00
// Naslov sporocila
2022-03-28 17:23:46 +02:00
echo '<div class="setting_holder">' ;
echo $lang [ 'srv_notifications_send_title' ] . ':' ;
echo '<input type="text" class="text large" name="title">' ;
echo '</div>' ;
2021-08-26 10:00:13 +02:00
// Besedilo sporocila (editor)
2022-03-28 23:06:03 +02:00
echo $lang [ 'srv_notifications_send_text' ] . ':' ;
echo '<div class="label">' ;
2022-03-28 17:23:46 +02:00
echo '<textarea id="notification" name="notification" autocomplete="off"></textarea>' ;
2022-03-28 23:06:03 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Avtomatsko prikaži obvestilo po prijavi
2022-03-28 17:23:46 +02:00
echo '<div class="auto_checkbox">' ;
echo '<input type="checkbox" value="1" name="force_show" id="force_show">' ;
echo '<label for="force_show">' . $lang [ 'srv_notifications_force_show' ] . '</label>' ;
echo '</div>' ;
2022-03-28 23:06:03 +02:00
//Error notes
2020-08-14 13:36:36 +02:00
if ( $note != '' ){
2022-03-28 23:06:03 +02:00
echo '<p class="top16">' . $note . '</p>' ;
2020-08-14 13:36:36 +02:00
}
2022-03-28 23:06:03 +02:00
// Gumb pošlji
echo '<div class="button_holder ' . ( $note != '' ? 'top16' : '' ) . '">' ;
echo '<button class="medium blue" onclick="sendNotification(); return false;">' . $lang [ 'srv_notifications_send' ] . '</button>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
echo '</div>' ;
2021-08-26 10:00:13 +02:00
// Inicializiramo editor
2021-08-26 10:32:14 +02:00
echo '<script type="text/javascript">create_editor_notification(\'notification\');</script>' ;
2020-08-14 13:36:36 +02:00
}
// Vrnemo stevilo sporocil
public function countMessages ( $type = 'unread' ){
global $global_user_id ;
$count = 0 ;
switch ( $type ){
case 'recieved' :
$sql = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_notifications WHERE recipient=' $global_user_id ' AND viewed='1' " );
break ;
case 'sent' :
$sql = sisplet_query ( " SELECT COUNT(n.*) AS count FROM srv_notifications n, srv_notifications_messages m WHERE m.author=' $global_user_id ' AND m.id=n.message_id " );
break ;
case 'unread' :
default :
$sql = sisplet_query ( " SELECT COUNT(*) AS count FROM srv_notifications WHERE recipient=' $global_user_id ' AND viewed='0' " );
break ;
}
if ( mysqli_num_rows ( $sql ) > 0 ){
$row = mysqli_fetch_array ( $sql );
$count = $row [ 'count' ];
}
return $count ;
}
// Preveri ce avtomatsko prikaze sporocilo po prijavi
public function checkForceShow (){
global $global_user_id ;
$sql = sisplet_query ( " SELECT m.force_show FROM srv_notifications n, srv_notifications_messages m WHERE n.message_id=m.id AND n.recipient=' $global_user_id ' AND n.viewed='0' AND m.force_show='1' " );
if ( mysqli_num_rows ( $sql ) > 0 )
return true ;
else
return false ;
}
public function ajax () {
global $global_user_id ;
switch ( $_GET [ 'a' ]) {
case 'sendNotification' :
$this -> ajax_sendNotification ();
break ;
case 'viewMessage' :
$this -> ajax_viewMessage ();
break ;
case 'viewUnreadMessages' :
$this -> ajax_viewUnreadMessages ();
break ;
case 'viewGDPRMessage' :
$this -> ajax_viewGDPRMessage ();
break ;
case 'saveGDPRAgree' :
$this -> ajax_saveGDPRAgree ();
break ;
case 'resolveMessages' :
$this -> ajax_resolveMessages ();
break ;
default :
break ;
}
}
public function ajax_sendNotification (){
global $lang , $global_user_id ;
if ( isset ( $_POST [ 'recipient' ]))
$recipient = $_POST [ 'recipient' ];
if ( isset ( $_POST [ 'recipient_all_slo' ]))
$recipient_all_slo = $_POST [ 'recipient_all_slo' ];
if ( isset ( $_POST [ 'recipient_all_ang' ]))
$recipient_all_ang = $_POST [ 'recipient_all_ang' ];
if ( isset ( $_POST [ 'title' ]))
$title = $_POST [ 'title' ];
if ( isset ( $_POST [ 'notification' ]))
$notification = $_POST [ 'notification' ];
if ( isset ( $_POST [ 'force_show' ]))
$force_show = $_POST [ 'force_show' ];
// Ce posiljamo vsem uporabnikom nimamo maila
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 . " ') " );
$message_id = mysqli_insert_id ( $GLOBALS [ 'connect_db' ]);
$note = '' ;
// Loop cez vse uporabnike v bazi - vsakemu dodamo sporocilo
if ( $recipient_all_slo == 1 && $recipient_all_ang == 1 )
$sqlU = sisplet_query ( " SELECT id, name, surname, email FROM users WHERE status!='0' AND status!='5' AND status!='6' " );
elseif ( $recipient_all_ang == 1 )
$sqlU = sisplet_query ( " SELECT id, name, surname, email FROM users WHERE status!='0' AND status!='5' AND status!='6' AND lang='2' " );
else
$sqlU = sisplet_query ( " SELECT id, name, surname, email FROM users WHERE status!='0' AND status!='5' AND status!='6' AND lang='1' " );
while ( $rowU = mysqli_fetch_array ( $sqlU )){
$sql = sisplet_query ( " INSERT INTO srv_notifications (message_id, recipient, viewed) VALUES (' " . $message_id . " ', ' " . $rowU [ 'id' ] . " ', '0') " );
if ( ! $sql )
2022-03-28 23:06:03 +02:00
$note .= '<span class="red">' . mysqli_error ( $GLOBALS [ 'connect_db' ]) . '</span>' ;
2020-08-14 13:36:36 +02:00
}
}
// Posiljamo na specificen mail
else {
// Dobimo user id glede na vnesen mail prejemnika
$sqlU = sisplet_query ( " SELECT id, name, surname, email FROM users WHERE email=' $recipient ' " );
if ( mysqli_num_rows ( $sqlU ) > 0 ){
$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 . " ') " );
$message_id = mysqli_insert_id ( $GLOBALS [ 'connect_db' ]);
// Dodamo novo sporocilo v bazo
$sql = sisplet_query ( " INSERT INTO srv_notifications (message_id, recipient, viewed) VALUES (' " . $message_id . " ', ' " . $rowU [ 'id' ] . " ', '0') " );
if ( ! $sql )
2022-03-28 23:06:03 +02:00
$note = '<span class="red">' . mysqli_error ( $GLOBALS [ 'connect_db' ]) . '</span>' ;
2020-08-14 13:36:36 +02:00
else
2022-03-29 13:37:12 +02:00
$note = '<span class="faicon success blue link-right"></span>' . $lang [ 'srv_notifications_sent_success' ] . ' ' . $recipient . ' (' . $rowU [ 'name' ] . ' ' . $rowU [ 'surname' ] . ').' ;
2020-08-14 13:36:36 +02:00
}
else {
2022-03-29 13:37:12 +02:00
$note = '<span class="red">' . $lang [ 'srv_notifications_sent_nouser1' ] . $recipient . $lang [ 'srv_notifications_sent_nouser1' ] . '</span>' ;
2020-08-14 13:36:36 +02:00
}
}
2022-03-28 17:23:46 +02:00
echo '<div class="notifications_content">' ;
2020-08-14 13:36:36 +02:00
// Refresh vseh poslanih sporocil
2022-03-28 17:23:46 +02:00
echo '<div class="notifications_content_left">' ;
echo '<div class="title">' ;
echo '<div class="title_icon"><span class="faicon inv_sent_1"></span></div>' ;
echo '<h2>' . $lang [ 'srv_notifications_sent' ] . '</h2>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
$this -> displaySentMessages ();
echo '</div>' ;
// Refresh obrazca za posiljanje sporocil
2022-03-28 17:23:46 +02:00
echo '<div class="notifications_content_right">' ;
echo '<div class="title">' ;
echo '<div class="title_icon"><span class="faicon inv_sent_0"></span></div>' ;
echo '<h2>' . $lang [ 'srv_inv_message_draft_new' ] . '</h2>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
$this -> sendMessageForm ( $note );
2022-03-28 17:23:46 +02:00
echo '</div>' ;
echo '</div>' ;
2020-08-14 13:36:36 +02:00
}
public function ajax_resolveMessages (){
if ( isset ( $_POST [ 'id' ]))
$message_id = $_POST [ 'id' ];
// Oznacimo sporocila kot pregledana
$sql = sisplet_query ( " UPDATE srv_notifications SET viewed='1' WHERE message_id=' $message_id ' " );
$this -> displaySentMessages ();
}
public function ajax_viewMessage (){
global $lang , $global_user_id ;
if ( isset ( $_POST [ 'id' ]))
$id = $_POST [ 'id' ];
// Oznacimo sporocilo kot pregledano
$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
FROM srv_notifications n , srv_notifications_messages m
WHERE n . id = '$id' AND m . id = n . message_id " );
$row = mysqli_fetch_array ( $sql );
// Refresh vseh prejetih sporocil
2022-03-28 23:54:00 +02:00
echo '<div class="title">' ;
echo '<div class="title_icon"><span class="faicon fa-inbox"></span></div>' ;
echo '<h2>' . $lang [ 'srv_notifications_recieved' ] . '</h2>' ;
echo '</div>' ;
echo '<div class="notifications_content">' ;
echo '<div class="notifications_content_left">' ;
2020-08-14 13:36:36 +02:00
echo '<div class="recieved_list">' ;
$this -> displayRecievedMessages ( $active = $id );
echo '</div>' ;
2022-03-28 23:54:00 +02:00
echo '</div>' ;
2020-08-14 13:36:36 +02:00
// Prikaz izbranega sporocila
2022-03-28 23:54:00 +02:00
echo '<div class="notifications_content_right">' ;
2020-08-14 13:36:36 +02:00
echo '<div id="message">' ;
2021-08-26 10:05:04 +02:00
2022-03-28 23:54:00 +02:00
echo '<div class="subject">' ;
echo $row [ 'title' ];
echo '</div>' ;
echo '<div class="date">' ;
echo '(' . $row [ 'date' ] . ')' ;
echo '</div>' ;
2021-08-26 10:05:04 +02:00
// Stara sporocila so brez editorja
2021-08-26 10:32:14 +02:00
$text = ( strtotime ( $row [ 'date' ]) < strtotime ( '2021-08-26' )) ? nl2br ( $row [ 'text' ]) : $row [ 'text' ];
2022-03-28 23:54:00 +02:00
echo '<div class="content">' ;
echo $text ;
echo '</div>' ;
2021-08-26 10:05:04 +02:00
2020-08-14 13:36:36 +02:00
echo '</div>' ;
echo '<div class="clr"></div>' ;
2022-03-28 23:54:00 +02:00
echo '</div>' ; //div.notifications_content
2020-08-14 13:36:36 +02:00
}
public function ajax_viewUnreadMessages (){
global $lang , $global_user_id ;
echo '<h2>' . $lang [ 'srv_notifications_unread' ] . '</h2>' ;
echo '<ul>' ;
// 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
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 " );
while ( $row = mysqli_fetch_array ( $sql )){
echo '<li class="' . ( $row [ 'viewed' ] == 0 ? ' unread' : '' ) . ' ' . ( $active > 0 && $row [ 'id' ] == $active ? ' active' : '' ) . '">' ;
echo '<span class="bold">' . $row [ 'title' ] . ' <span class="italic">(' . $row [ 'date' ] . ')</span></span>' ;
2021-08-26 10:05:04 +02:00
// Stara sporocila so brez editorja
2021-08-26 10:32:14 +02:00
$text = ( strtotime ( $row [ 'date' ]) < strtotime ( '2021-08-26' )) ? nl2br ( $row [ 'text' ]) : $row [ 'text' ];
2021-08-26 10:05:04 +02:00
echo '<br />' . $text ;
2020-08-14 13:36:36 +02:00
echo '</li>' ;
}
echo '</ul>' ;
// Gumb za zapiranje
echo '<div class="buttons_holder">' ;
echo '<div class="buttonwrapper" title="' . $lang [ 'srv_zapri' ] . '">' ;
echo '<a class="ovalbutton ovalbutton" onclick="closeUnreadMessages(); return false;" href="#">' ;
echo '<span>' . $lang [ 'srv_zapri' ] . '</span>' ;
echo '</a>' ;
echo '</div>' ;
echo '</div>' ;
// Oznacimo sporocilo kot pregledano
$sql = sisplet_query ( " UPDATE srv_notifications SET viewed='1' WHERE recipient=' " . $global_user_id . " ' AND viewed='0' " );
}
public function ajax_viewGDPRMessage (){
2021-09-29 10:37:17 +02:00
global $lang , $global_user_id ;
2020-08-14 13:36:36 +02:00
echo '<h2>' . $lang [ 'srv_notifications_unread' ] . '</h2>' ;
echo '<ul>' ;
echo '<li class="unread active">' ;
2020-10-29 08:41:02 +01:00
2021-09-29 10:37:17 +02:00
if ( isAAI ()){
2020-10-29 08:41:02 +01:00
echo '<span class="bold">' . $lang [ 'srv_gdpr_notification_title_aai' ] . '</span>' ;
}
else {
echo '<span class="bold">' . $lang [ 'srv_gdpr_notification_title' ] . '</span>' ;
}
2020-08-14 13:36:36 +02:00
echo '<br /><br />' ;
echo $lang [ 'srv_gdpr_notification_text1' ];
echo '<br /><br />' ;
echo $lang [ 'srv_gdpr_notification_question' ];
echo '<br />' ;
echo '<div class="spaceLeft gdpr_popup_radio"><input type="radio" name="gdpr_agree" id="gdpr_agree_1" value="1" onClick="enableGDPRPopupButton();"> <label for="gdpr_agree_1">' . $lang [ 'srv_gdpr_notification_da' ] . '</label></div>' ;
//echo ' <a href="#" onClick="toggleGDPRMore();"><span class="bold">'.$lang['srv_invitation_nonActivated_more'].'</span></a>';
echo '<div class="spaceLeft gdpr_popup_radio"><input type="radio" name="gdpr_agree" id="gdpr_agree_0" value="0" onClick="enableGDPRPopupButton();"> <label for="gdpr_agree_0">' . $lang [ 'srv_gdpr_notification_ne' ] . '</label></div>' ;
echo '<div class="italic red gdpr_popup_radio">' . $lang [ 'srv_gdpr_notification_reminder' ] . '</div>' ;
echo '<br />' ;
echo $lang [ 'srv_gdpr_notification_pogoji' ];
echo '</li>' ;
echo '</ul>' ;
// Gumb za zapiranje
//echo '<div class="floatRight spaceRight" id="GDPR_popup_button">';
echo '<div class="floatRight spaceRight" id="GDPR_popup_button" style="visibility: hidden;">' ;
echo '<div class="buttonwrapper" title="' . $lang [ 'save' ] . '">' ;
echo '<a class="ovalbutton ovalbutton" onclick="saveGDPRMessage();" href="#">' ;
echo '<span>' . $lang [ 'save' ] . '</span>' ;
echo '</a>' ;
echo '</div>' ;
echo '</div>' ;
}
public function ajax_saveGDPRAgree (){
global $global_user_id ;
if ( isset ( $_POST [ 'gdpr_agree' ]))
$gdpr_agree = $_POST [ 'gdpr_agree' ];
// Oznacimo sporocila kot pregledana
$sql = sisplet_query ( " UPDATE users SET gdpr_agree=' " . $gdpr_agree . " ' WHERE id=' " . $global_user_id . " ' " );
}
}
?>