Code
<?if($UNREAD_PM$>'0')?>
<style>
.LsMesWrap {position: fixed; top:0px; right:17px; padding:10px; color:#fff;}
.LsMesWrapp {overflow: hidden;padding: 15px;border: 2px solid #f00;-webkit-border-radius: 4px;background: #000000;position: fixed;right: 79px;top: 6px;-moz-box-shadow: 0px 0px 3px #bdbdbd;box-shadow: 0px 0px 3px #bdbdbd;-webkit-box-shadow: 0px 0px 3px #bdbdbd;font-style: italic;}
</style>
<div class="LsMesWrap"></div>
<script>
$.get('/index/14', function(data) {
$('b.unread', data).each(function() {
var NameTheme = $(this).text();
var UrlTheme = $(this).parent('a').attr('href');
var UserTheme = $(this).parent('a').next().text();
var UrlTds = $(this).parent('a').next().attr('href');
// შეტყობინების HTML სტრუქტურა
var messageHtml = `
<div class="LsMesWrapp" style="margin-bottom: 15px; border: 2px solid #dc3545; border-radius: 10px; padding: 15px; background-color: #f9f9f9;">
<div style="margin-bottom: 10px;">
<b style="color: #dc3545;">თქვენ გაქვთ ახალი შეტყობინება</b>
</div>
<div style="border-top: 1px solid #ccc; margin: 10px 0;"></div>
<div style="color: #333;">
<b>გამოაგზავნა:</b> ${UserTheme}
</div>
<div style="border-top: 1px solid #ccc; margin: 10px 0;"></div>
<div style="color: #333;">
<b>სათაური:</b> ${NameTheme}
</div>
<div style="color: #333;">
<a style="color: #dc3545; font-size: 16px; font-style: italic;" target="_blank" href="${UrlTheme}">
</a>
</div>
<div style="border-top: 1px solid #ccc; margin: 10px 0;"></div>
<div style="text-align: right;">
<button class="btn-open" style="background-color: #28a745; color: white; border: none; border-radius: 3px; padding: 6px 10px; cursor: pointer; transition: background-color 0.3s; font-size: 12px;">
გახსნა
</button>
<button class="btn-read" style="background-color: #007bff; color: white; border: none; border-radius: 3px; padding: 6px 10px; cursor: pointer; transition: background-color 0.3s; font-size: 12px;">
არმინდა
</button>
<button class="btn-delete" style="background-color: #dc3545; color: white; border: none; border-radius: 3px; padding: 6px 10px; cursor: pointer; transition: background-color 0.3s; font-size: 12px;">
ჩახურვა
</button>
</div>
</div>
`;
$(".LsMesWrap").prepend(messageHtml);
});
// ღილაკების ფუნქციონალობა
$('.btn-open').click(function() {
var UrlTheme = $(this).closest('.LsMesWrapp').find('a').attr('href');
window.open(UrlTheme, '_blank'); // გახსნა ახალი სექციაში
});
$('.btn-read').click(function() {
var messageContainer = $(this).closest('.LsMesWrapp');
messageContainer.css('background-color', '#ffff'); // ცვლილება წაკითხვის შემდეგ
alert('შეტყობინების წაკითხვა თუ არგინდა დაჭირე ჩახურვას თუგინდა გახსნა შეტყობინების დაჭირე გახსნას !');
$(this).prop('disabled', true); // Disable button after reading
});
$('.btn-delete').click(function() {
$(this).closest('.LsMesWrapp').remove(); // წაშლა
});
});
</script>
<?endif?>