$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php";
include_once $configPath;
if (!empty($_SESSION["utente"]) && !empty($_SESSION["utente"]->oe)) {
$codice_round = $_GET["codice_round"] ?? NULL;
$gara = publicGara::init($_GET["codice"], $codice_round);
if (!empty($gara) && $gara->potentialAction) {
$record = $gara->info;
$round = $gara->round;
$lotti = $gara->getLotti();
$breadcrumb = array();
$breadcrumb["/" . $radice . "/"] = Modulo::getInfo($radice)["titolo"];
$breadcrumb["/" . $radice . "/dettaglio.php?codice={$record["codice"]}&codice_round={$round["codice"]}"] = __("Dettaglio");
if (!empty($_GET["codice_lotto"]) && count($lotti) > 1) {
$breadcrumb["/". $radice . "/partecipa/partecipa.php?codice={$record["codice"]}&codice_round={$round["codice"]}"] = __("Scelta lotto");
}
$breadcrumb[""] = __("Pannello");
include_once $root . "/layout/top.php";
ob_start();
switch($gara->modalitaLotti()) {
case "singola":
alertManager::printWarningBox(__("ATTENZIONE"),__("SarĂ possibile partecipare solo ad un lotto"));
break;
case "tutti": {
alertManager::printWarningBox(__("ATTENZIONE"),__("Per inviare la partecipazione sarĂ necessario partecipare a tutti i lotti di gara"));
break;
}
}
$msg_modalita_lotti = ob_get_clean();
if (empty($_GET["codice_lotto"]) && count($lotti) > 1) {
$checkStato = $pdo->prepare("SELECT conferma FROM r_partecipanti_gare WHERE codice_round = :codice_round AND codice_lotto = :lotto AND codice_operatore = :operatore ");
$checkStato->bindValue(":operatore",$_SESSION["utente"]->oe["codice"]);
$checkStato->bindValue(":codice_round",$round["codice"]);
$stati = [];
foreach($lotti as $lotto) {
$stati[$lotto["codice"]] = ["label"=>"","class"=>"btn-primary"];
$checkStato->bindValue(":lotto",$lotto["codice"]);
$checkStato->execute();
if ($checkStato->rowCount() > 0) {
if ($checkStato->fetch(PDO::FETCH_COLUMN) == "S") {
$stati[$lotto["codice"]] = ["label"=>" " . __("Partecipazione inviata"),"class"=>"btn-success"];
} else {
$stati[$lotto["codice"]] = ["label"=>" " . __("Partecipazione iniziata"),"class"=>"btn-warning"];
}
}
}
$gara->printSelectLottiConditions = ["hasInvito"];
?>
= $msg_modalita_lotti ?>
$gara->printSelectLotto("/gare/partecipa/partecipa.php?codice={$record["codice"]}&codice_round={$round["codice"]}",false,$stati); ?>
if ($gara->modalitaLotti() == "tutti") {
?>
} ?>
} else {
$setLotto = $_GET["codice_lotto"] ?? $lotti[0]["codice"];
if (!empty($setLotto)) {
if ($gara->setLotto($setLotto)) {
if ($gara->hasInvito()) {
$tipiBuste = gara::tipologieBusta();
$lotto = $gara->lotto;
$submit = false;
if ($gara->partecipazioneAttiva()) {
$submit = true;
}
?>
= __("Gara") ?> #= $record["id"] ?> - = $record["oggetto"] ?>
= __("Lotto") ?> = $lotto["cig"] ?> - = $lotto["oggetto"] ?>
if (!empty($gara->getRisposteElaborazione()["asta"]) && $gara->getRisposteElaborazione()["asta"] == "S") {
$asta = $gara->getAsta(true);
if (!empty($asta)) {
if (strtotime($asta->info["inizio"]) < time()) {
if ($asta->getScadenza(true)) {
alertManager::printSuccessBox(__("Asta scaduta"));
$labelAsta = __("Pannello asta");
} else {
alertManager::printWarningBox(__("Asta in corso"));
$labelAsta = __("Partecipa all'asta");
}
?>
&codice_lotto== $gara->lotto["codice"] ?>&codice_round== $gara->round["codice"] ?>" class="btn btn-lg btn-block btn-success mb-3">
= $labelAsta; ?>
} else {
alertManager::printInfoBox(__("Asta programmata",__("Inizio asta") . ": " . mysql2completedate($asta->info["inizio"])));
}
}
}
?>
= $msg_modalita_lotti; ?>
$pannello = $gara->getManagerPartecipazione();
if (!empty($pannello) && $pannello->check()) {
$pannello->printPanel();
$partecipante = $pannello->partecipante;
?>
include __DIR__ . "/seduta.php"; ?>
if ($gara->canAccessAccessoAttiAutomatico()) {
?>
include __DIR__ . "/accesso/dashboard.php"; ?>
}
if ($pannello->submit) {
if (!empty($partecipante) && $partecipante["conferma"] == "N" && $pannello->checkDocumentiMinimi()) {
?>
} else if (!empty($partecipante)) { ?>
= __("Offerta inviata") ?>
,'gare/partecipa','codice_lotto== $lotto["codice"] ?>')" value="= __(($partecipante["conferma"] == "S") ? "Revoca partecipazione" : "Cancella partecipazione") ?>">
} ?>
}
} else {
alertManager::printAlertBox(__("Errore applicativo"),implode("
",$pannello->errori));
}
} else {
alertManager::printAlertBox(__("Lotto non abilitato"));
}
} else {
alertManager::printAlertBox(__("Errore inizializzaione lotto"));
}
} else {
alertManager::printAlertBox(__("Errore selezione lotto"));
}
}
include_once $root . "/layout/bottom.php";
} else {
echo '
';
die();
}
} else {
echo '
';
die();
}
?>