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.
55 righe
1.9 KiB
55 righe
1.9 KiB
<? |
|
if (isset($this) && is_a($this,"anac")) { |
|
$lotto = $this->getLotti($codice_lotto)[0] ?? NULL; |
|
if (!empty($lotto["codice"])) { |
|
$simogMethod = "cancellaLotto"; |
|
if ($operation == "get") { |
|
$return = []; |
|
$return["method"] = $simogMethod; |
|
$return["data"] = []; |
|
$return["data"]["cig"] = $lotto["cig"]; |
|
$dati = json_decode($lotto["dati"],true); |
|
$return["data"]["id_motivazione"] = $dati["id_motivazione"]; |
|
$return["data"]["note_canc"] = ""; |
|
} else if ($operation == "put" && !empty($response)) { |
|
if (!empty($response->return->success)) { |
|
$this->updateSimogLog($simogMethod,1,"",$lotto["codice"]); |
|
if (!empty($response->return->success)) { |
|
$update = []; |
|
$update["codice"] = $lotto["codice"]; |
|
$update["eliminato"] = "S"; |
|
|
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
$salva->nome_tabella = "b_simog_lotti"; |
|
$salva->operazione = "UPDATE"; |
|
$salva->oggetto = $update; |
|
$salva->save(); |
|
} |
|
alertManager::printSuccessBox(__("Operazione effettuata con successo")); |
|
?> |
|
<script> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ |
|
window.location.href="/backend/anac/panel.php?codice=<?= $this->info["codice"] ?>"; |
|
}); |
|
</script> |
|
<? |
|
$return = true; |
|
} else if (!empty($response->return->error)) { |
|
$errors = $response->return->error; |
|
} else { |
|
$errors = __("Errore nella risposta"); |
|
} |
|
} else { |
|
$errors = __("Operazione sconosciuta"); |
|
} |
|
} else { |
|
$errors = __("Impossibile trovare lotto"); |
|
} |
|
if (!empty($errors)) { |
|
$this->updateSimogLog($simogMethod,2,$errors,$lotto["codice"]); |
|
alertManager::printAlertBox($errors); |
|
} |
|
} |
|
?>
|