go("SELECT * FROM r_partecipanti_gare WHERE codice_operatore = :oe AND conferma = 'S'",[":oe"=>$codice_oe]); $risInviti = $pdo->go("SELECT * FROM r_inviti_gare WHERE codice_operatore = :oe",[":oe"=>$codice_oe]); $checkRound = $pdo->prepare("SELECT b_gare.oggetto, b_gare.codice FROM b_gare_round JOIN b_gare ON b_gare_round.codice_gara = b_gare.codice WHERE b_gare.stato >= 20 AND b_gare.stato NOT IN (80,90) AND b_gare_round.codice = :round"); $results = ["totale"=>0,"schede" => []]; if ($risPartecipanti->rowCount() > 0) { $results["schede"]["partecipazioni"] = ["label"=>"Partecipazioni","data"=>[]]; while($p = $risPartecipanti->fetch(PDO::FETCH_ASSOC)) { $checkRound->execute([":round"=>$p["codice_round"]]); if (!empty($checkRound->rowCount())) { $info = $checkRound->fetch(PDO::FETCH_ASSOC); $stato = "Partecipato"; $color = ""; $icon = ""; if ($p["escluso"] == "S") { $stato = "Escluso"; $color = "text-danger"; $icon = "fa fa-ban"; } if ($p["aggiudicatario"] == "S") { $stato = "Aggiudicatario"; $color = "text-success"; $icon = "fa fa-trophy"; } $results["schede"]["partecipazioni"]["data"][] = [ "modulo" => "gare", "id" => $info["codice"], "oggetto" => $info["oggetto"], "url" => "/backend/gare/panel.php?codice={$info["codice"]}", "stato" => $stato, "color" => $color, "icon" => $icon, "timestamp" => $p["timestamp"] ]; $results["totale"]++; } } } if ($risInviti->rowCount() > 0) { $results["schede"]["inviti"] = ["label"=>"Inviti","data"=>[]]; while($p = $risInviti->fetch(PDO::FETCH_ASSOC)) { $checkRound->execute([":round"=>$p["codice_round"]]); if (!empty($checkRound->rowCount())) { $info = $checkRound->fetch(PDO::FETCH_ASSOC); $results["schede"]["inviti"]["data"][] = [ "modulo" => "gare", "id" => $info["codice"], "oggetto" => $info["oggetto"], "url" => "/backend/gare/panel.php?codice={$info["codice"]}", "stato" => "Invitato", "color" => "", "icon" => "", "timestamp" => $p["timestamp"] ]; $results["totale"]++; } } } return $results; } ?>