Файл: upload/core/functions/messages.php
Строк: 25
<?php
function insertMessage($sender, $receiver, $text) {
dbquery("INSERT INTO messages (sender_id, receiver_id, readed, k_text, attachment, created_at) VALUES (?, ?, '0', ?, '', ?)", [$sender, $receiver, $text, time()]);
}
function insertMessagePay($senderId, $receiverId, $workName, $amount) {
$text = "[QUOTEMESSAGEROOT][BMESSAGEROOT]Оплатил заказ ({$workName}) на сумму {$amount} ₽[/BMESSAGEROOT][/QUOTEMESSAGEROOT]";
dbquery("INSERT INTO messages (sender_id, receiver_id, k_text, attachment, created_at) VALUES (?, ?, ?, '', ?)", [$senderId, $receiverId, $text, time()]);
}
function getUnreadCountMes($us)
{
$row = FetchAssoc(dbquery("
SELECT COUNT(*) AS cnt
FROM messages
WHERE receiver_id = ? AND readed = 0
", [$us]));
return intval($row['cnt']);
}
?>