diff --git a/public/userarea/products/reportdetails.php b/public/userarea/products/reportdetails.php index bfcce5c..f159541 100644 --- a/public/userarea/products/reportdetails.php +++ b/public/userarea/products/reportdetails.php @@ -244,7 +244,7 @@ $partsAndResults = $stmtParts->get_result(); echo ' - + @@ -359,9 +359,9 @@ $partsAndResults = $stmtParts->get_result(); // Mostra/nasconde la riga in base al filtro di rating if (selectedRating === '' || - (selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies')) || - (selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply")) || - (selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//'))) { + (selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies' || ratingText === 'p')) || + (selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply" || ratingText === "f")) || + (selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//' || ratingText === ''))) { $(this).show(); visibleRows++; } else { @@ -369,19 +369,30 @@ $partsAndResults = $stmtParts->get_result(); } }); - // Nasconde l'intera tabella se non ci sono righe visibili + // Nascondi l'intera tabella e il titolo della parte se non ci sono righe visibili if (visibleRows === 0) { - table.hide(); - table.prev('h6').hide(); // Nasconde anche il titolo della parte + table.hide(); // Nasconde la tabella + table.prev('h6').hide(); // Nasconde il titolo della parte table.prevAll('.section-separator:first').hide(); // Nasconde il titolo dell'analisi } else { - table.show(); + table.show(); // Mostra la tabella se ci sono righe visibili table.prev('h6').show(); // Mostra il titolo della parte table.prevAll('.section-separator:first').show(); // Mostra il titolo dell'analisi } }); - }); + // Controlla se ci sono sezioni dell'analisi senza parti visibili + $('.section-separator').each(function() { + var section = $(this); + var hasVisibleParts = section.nextUntil('.section-separator', 'h6:visible').length > 0; // Verifica se ci sono parti visibili + + if (!hasVisibleParts) { + section.hide(); // Nasconde l'intestazione dell'analisi se non ci sono parti visibili + } else { + section.show(); // Mostra l'intestazione dell'analisi se ci sono parti visibili + } + }); + }); }); @@ -445,9 +456,9 @@ $partsAndResults = $stmtParts->get_result(); // Se l'utente non seleziona alcun valore (tutti i rating) o il rating corrisponde if (selectedRating === '' || - (selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies')) || - (selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply")) || - (selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//'))) { + (selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies' || ratingText === 'p')) || + (selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply" || ratingText === "f")) || + (selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//' || ratingText === ''))) { $(this).show(); } else { $(this).hide();
Analyts NameComponents/Analyts Name Result Value Rating