function claim_message($msg, $msgFh, $msgTh, $uuid){
$var = R::findOne('messages', 'WHERE `msg_th`=? AND is_read = 0', [$msgTh]);
if ($var != null){
return "$msg";
R::exec("UPDATE `messages` SET is_read=1 WHERE `id` = ?", [$id]);
exit;
}
return "null; $msgTh , $msgFh";
}
if ($var != null){
return "$msg";
R::exec("UPDATE `messages` SET is_read=1 WHERE `id` = ?", [$id]);
exit;
}
function claim_message($msg, $msgFh, $msgTh, $uuid)
{
$var = R::findOne("messages", "msg_th = ? AND is_read = 0'", [$msgTh]);
if(!is_null($var))
{
$delete = R::load("messages", $var->id);
R::trash($delete);
return $msg;
}
return "null; $msgTh , $msgFh";
}