$get_codice_elemento,"sub_elemento"=>$get_sub_elemento]; foreach($_keys AS $_key=>$_value) { $directLink = str_replace("{##--{$_key}--##}",$_value,$directLink); } } if (!empty($directLink)) { ?>
prepare("SELECT codice FROM r_chat WHERE codice_messaggio = :codice_messaggio AND codice_utente = :codice_utente"); $check->bindValue(":codice_utente",$_SESSION["utente"]->codice); $insert = $pdo->prepare("INSERT INTO r_chat (codice_messaggio, codice_utente) VALUES (:codice_messaggio , :codice_utente)"); $insert->bindValue(":codice_utente",$_SESSION["utente"]->codice); $updateLetto = $pdo->prepare("UPDATE r_chat SET letto = 'S' WHERE codice_messaggio = :codice_messaggio AND codice_utente = :codice_utente"); $updateLetto->bindValue(":codice_utente",$_SESSION["utente"]->codice); foreach($messaggi AS $msg) { $sender = ($msg["utente_modifica"] == $_SESSION["utente"]->codice) ? true : false; $user = Utente::getInfoFromID($msg["utente_modifica"]); if (empty($user)) { $user = [ "cognome" => "", "nome" => "" ]; } ?>
">
bindValue(":codice_messaggio",$msg["codice"]); $check->execute(); if ($check->rowCount() == 0) { $insert->bindValue(":codice_messaggio",$msg["codice"]); $insert->execute(); } else { $updateLetto->bindValue(":codice_messaggio",$msg["codice"]); $updateLetto->execute(); } } ?>
readOnly) { ?>