niente SQL injection). */ // N. TRF dell'utente loggato $numbertrfuser = $db->count( "SELECT idtrfdetails FROM `trf-details` WHERE iduser = ?", [$iduserlogin] ); // N. TRF della company $numbertrfcompany = $db->count( "SELECT idtrfdetails FROM `trf-details` WHERE idcompany = ?", [$idcompany] ); // N. parti totali collegate ai TRF dell'utente // NOTA: l'originale usava $user (oggetto Auth), qui uso $iduserlogin per coerenza. $totalpartstrf = $db->count( "SELECT identificationparts.ididentificationparts FROM identificationparts LEFT JOIN `trf-details` ON identificationparts.idtrfdetails = `trf-details`.idtrfdetails WHERE `trf-details`.iduser = ?", [$iduserlogin] ); // Modulo "GO" in sospeso (secondo certificato non ancora firmato) $modulego = $db->selectOne( "SELECT csgo FROM `trf-details` WHERE iduser = ? AND csgo = 'Y' AND signedonsecondcert IS NULL LIMIT 1", [$iduserlogin] ); $csgoyes = (!empty($modulego['csgo'])) ? 'Y' : null; ?>