gestione gare pubbliche
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.
 
 
 
 
 

58 righe
2.3 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$error = true;
if (!empty($_SESSION["utente"]) && !empty($_POST["codice"]) && !empty($_POST["other"])) {
$other = json_decode(base64_decode($_POST["other"]),true);
$error = false;
$codice = $_POST["codice"];
if (is_numeric($_POST["codice"]) && !empty($other)) {
$error = true;
$bind = array(
":codice"=>$_POST["codice"],
":codice_form" => $other["codice_form"],
":codice_gruppo" => $other["codice_gruppo"],
":id" => $other["id"],
":type" => $other["type"]
);
$sql = "SELECT type,id FROM b_form_data WHERE gruppo_compilazione = :codice
AND codice_form = :codice_form
AND codice_gruppo = :codice_gruppo
AND id = :id
AND type = :type ";
$ris = $pdo->go($sql,$bind);
if ($ris->rowCount() > 1) {
$record = $ris->fetch(PDO::FETCH_ASSOC);
if ($_SESSION["utente"]->hasSuperPowers() || $_SESSION["utente"]->permission($record["type"],$record["id"]) ||
(!empty($_SESSION["utente"]->oe) && !empty($_SESSION["ente"]) &&
(
($record["type"] == "oe" && $record["id"] == $_SESSION["utente"]->oe["codice"]) ||
($record["type"] == "albo_fornitori-{$_SESSION["ente"]->codice}") ||
($record["type"] == "albi_commissione-{$_SESSION["ente"]->codice}")
)
)
) {
$bind[":utente"] = (!empty($_SESSION["utente"]->codice)) ? $_SESSION["utente"]->codice : -1;
$sql = "UPDATE b_form_data SET soft_delete = 'S', utente_modifica = :utente WHERE gruppo_compilazione = :codice
AND codice_form = :codice_form
AND codice_gruppo = :codice_gruppo
AND id = :id
AND type = :type";
$ris = $pdo->go($sql,$bind);
if ($ris->rowCount() > 1) {
$error = false;
scriviLog("b_form_group","UPDATE",$pdo->getSQL(),$_POST["codice"]);
}
}
}
}
}
if (!$error) {
?>
$("#group-panel-<?= $codice ?>").slideUp('fast',function() { $(this).remove() });
<?
} else {
header('HTTP/1.0 403 Forbidden');
die();
}
?>