permission($radice,$_POST["codice_contratto"],"esponenti")) { $bind = array(":codice"=>$_POST["codice"],":codice_contratto"=>$_POST["codice_contratto"]); $check = $pdo->go("SELECT codice FROM r_contraenti WHERE codice_contraente = :codice AND codice_contratto <> :codice_contratto LIMIT 0,1",$bind); if ($check->rowCount() == 0) { $bind = array(":codice"=>$_POST["codice"],":codice_gestore"=>$_SESSION["ente"]->codice); $sql = "DELETE FROM b_contraenti WHERE codice = :codice AND codice_gestore = :codice_gestore "; $ris = $pdo->go($sql,$bind); if ($ris->rowCount() === 1) { $error = false; $codice = $_POST["codice"]; scriviLog("b_contraenti","DELETE",$pdo->getSQL(),$_POST["codice"]); ?> refreshModalHelper(); swal({title:js_dict.error,html:"",type:"error"});