db->go($sql,[":cig"=>$cig]); if ($codici->rowCount() > 0) { while($id = $codici->fetch(PDO::FETCH_COLUMN)) { $allegati = filesManager::listFiles($id,"gare-public"); if (!empty($allegati)) { $esistenti = $this->getRefsAllegati(); if (!empty($esistenti)) { $esistenti = array_column($esistenti,"codice"); } foreach($allegati AS $allegato) { if (in_array($allegato["codice"],$esistenti) === false) { $data[] = $allegato; } } } } } } ?>