if (isset($this)) { $submit = false; if ($this->partecipazioneAttiva()) { $submit = true; } $partecipante = $this->miaPartecipazione(); $formManager = new FormManager(); $formManager->stripEnte = true; $formManager->init($codice_form,$this->modulo."-".$_SESSION["ente"]->codice,$partecipante["codice"] ?? null); if (empty($formManager->getValues())) { $partecipantiTable = static::getOeTable(); $sources = []; $check = $this->db->prepare("SELECT codice, `timestamp` FROM {$partecipantiTable} WHERE codice_operatore = :operatore AND codice_elenco = :elenco ORDER BY codice DESC"); $check->bindValue(":operatore",$_SESSION["utente"]->oe["codice"]); if (empty($_GET["duplicateFrom"])) { $formTable = static::getFormTable(); $altriElenchi = $this->db->go("SELECT codice_elenco FROM {$formTable} WHERE codice_form = :form",[":form"=>$codice_form])->fetchAll(PDO::FETCH_COLUMN); if (!empty($altriElenchi)) { foreach($altriElenchi AS $altroElenco) { $check->bindValue(":elenco",$altroElenco); $check->execute(); if ($check->rowCount() > 0) { $altraPartecipazione = $check->fetch(PDO::FETCH_ASSOC); $existingForm = new FormManager(); $existingForm->init($codice_form,$this->modulo."-{$_SESSION["ente"]->codice}",$altraPartecipazione["codice"]); $values = $existingForm->getValues(); if (!empty($values)) { $altraPartecipazione["codice_elenco"] = $altroElenco; $sources[] = $altraPartecipazione; break; } } } } } else { $altraPartecipazione = $_GET["duplicateFrom"]; $check->bindValue(":elenco",$_GET["duplicateElenco"]); $check->execute(); if ($check->rowCount() > 0) { $check = $check->fetch(PDO::FETCH_ASSOC); if ($check["codice"] == $altraPartecipazione) { $formManager->duplicateID = $altraPartecipazione; } } } } if ($submit) { if (!empty($sources)) { if (count($sources) > 1) { ?>