Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
45 righe
1.5 KiB
45 righe
1.5 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "remoto"; |
|
$cmd_info = stipula::getInfoModulo($id_modulo); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_POST["codice_contratto"],$id_modulo)) { |
|
$contratto = stipula::init($_POST["codice_contratto"]); |
|
if (!empty($contratto)) { |
|
$sottoscrizioni = $contratto->getContrattoSottoscritto(); |
|
if (!empty($sottoscrizioni)) { |
|
$found = false; |
|
$next = false; |
|
$elemento = false; |
|
foreach($sottoscrizioni AS $id_contraente => $sottoscrizione) { |
|
if ($next) { |
|
$found = true; |
|
break; |
|
} |
|
if ($id_contraente == $_POST["codice"]) { |
|
$next = true; |
|
$elemento = $sottoscrizione; |
|
} |
|
} |
|
if (!$found && !empty($elemento)) { |
|
$bind = [":codice"=>$elemento["codice"]]; |
|
$sql = "DELETE FROM b_contratti_sottoscritti WHERE codice = :codice "; |
|
$ris = $pdo->go($sql,$bind); |
|
if ($ris->rowCount() === 1) { |
|
$contratto->updateStato("20",true); |
|
$error = false; |
|
scriviLog("b_contratti_sottoscritti","DELETE",$pdo->getSQL(),$elemento["codice"]); |
|
?> |
|
window.location.reload(); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|