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.
43 righe
1.8 KiB
43 righe
1.8 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && !empty($_POST["codice"])) { |
|
$error = false; |
|
$codice = $_POST["codice"]; |
|
if (is_numeric($_POST["codice"])) { |
|
$error = true; |
|
$bind = array(":codice"=>$_POST["codice"]); |
|
$sql = "SELECT b_concorsi_richieste.codice, b_concorsi_richieste.titolo, b_concorsi_round.codice_concorso, b_concorsi_round.codice AS codice_round FROM |
|
b_concorsi_richieste |
|
JOIN b_concorsi_round ON b_concorsi_richieste.codice_round = b_concorsi_round.codice |
|
WHERE b_concorsi_richieste.codice = :codice AND b_concorsi_richieste.locked = 'N'"; |
|
$ris = $pdo->go($sql,$bind); |
|
if ($ris->rowCount() === 1) { |
|
$richiesta = $ris->fetch(PDO::FETCH_ASSOC); |
|
$concorso = concorso::init($richiesta["codice_concorso"],$richiesta["codice_round"]); |
|
if (!empty($concorso)) { |
|
if ($_SESSION["utente"]->permission($radice,$concorso->info["codice"],"buste")) { |
|
$bind = array(":codice"=>$_POST["codice"]); |
|
//$bind[":utente"] = $_SESSION["utente"]->codice; |
|
$sql = "DELETE FROM b_concorsi_richieste WHERE codice = :codice "; |
|
$ris = $pdo->go($sql,$bind); |
|
if ($ris->rowCount() === 1) { |
|
$error = false; |
|
$concorso->addToLog("DELETE",__("Richiesta").": " . $richiesta["titolo"]); |
|
scriviLog("b_concorsi_richieste","DELETE",$pdo->getSQL(),$_POST["codice"]); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (!$error) { |
|
?> |
|
$("#input-<?= $codice ?>").slideUp('fast',function(){$(this).remove()}); |
|
<? |
|
} else { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|