fix report details
This commit is contained in:
@@ -244,7 +244,7 @@ $partsAndResults = $stmtParts->get_result();
|
|||||||
echo '<table class="table table-bordered table-part">
|
echo '<table class="table table-bordered table-part">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="fixed-width-analyts">Analyts Name</th>
|
<th class="fixed-width-analyts">Components/Analyts Name</th>
|
||||||
<th class="fixed-width-value">Result Value</th>
|
<th class="fixed-width-value">Result Value</th>
|
||||||
<th class="fixed-width-rating">Rating</th>
|
<th class="fixed-width-rating">Rating</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -359,9 +359,9 @@ $partsAndResults = $stmtParts->get_result();
|
|||||||
|
|
||||||
// Mostra/nasconde la riga in base al filtro di rating
|
// Mostra/nasconde la riga in base al filtro di rating
|
||||||
if (selectedRating === '' ||
|
if (selectedRating === '' ||
|
||||||
(selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies')) ||
|
(selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies' || ratingText === 'p')) ||
|
||||||
(selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply")) ||
|
(selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply" || ratingText === "f")) ||
|
||||||
(selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//'))) {
|
(selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//' || ratingText === ''))) {
|
||||||
$(this).show();
|
$(this).show();
|
||||||
visibleRows++;
|
visibleRows++;
|
||||||
} else {
|
} 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) {
|
if (visibleRows === 0) {
|
||||||
table.hide();
|
table.hide(); // Nasconde la tabella
|
||||||
table.prev('h6').hide(); // Nasconde anche il titolo della parte
|
table.prev('h6').hide(); // Nasconde il titolo della parte
|
||||||
table.prevAll('.section-separator:first').hide(); // Nasconde il titolo dell'analisi
|
table.prevAll('.section-separator:first').hide(); // Nasconde il titolo dell'analisi
|
||||||
} else {
|
} else {
|
||||||
table.show();
|
table.show(); // Mostra la tabella se ci sono righe visibili
|
||||||
table.prev('h6').show(); // Mostra il titolo della parte
|
table.prev('h6').show(); // Mostra il titolo della parte
|
||||||
table.prevAll('.section-separator:first').show(); // Mostra il titolo dell'analisi
|
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
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- plugin JS -->
|
<!-- plugin JS -->
|
||||||
@@ -445,9 +456,9 @@ $partsAndResults = $stmtParts->get_result();
|
|||||||
|
|
||||||
// Se l'utente non seleziona alcun valore (tutti i rating) o il rating corrisponde
|
// Se l'utente non seleziona alcun valore (tutti i rating) o il rating corrisponde
|
||||||
if (selectedRating === '' ||
|
if (selectedRating === '' ||
|
||||||
(selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies')) ||
|
(selectedRating === 'pass' && (ratingText === 'pass' || ratingText === 'complies' || ratingText === 'p')) ||
|
||||||
(selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply")) ||
|
(selectedRating === 'fail' && (ratingText === 'fail' || ratingText === "doesn't comply" || ratingText === "f")) ||
|
||||||
(selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//'))) {
|
(selectedRating === 'ambiguous' && (ratingText === 'n/a' || ratingText === 'data' || ratingText === '//' || ratingText === ''))) {
|
||||||
$(this).show();
|
$(this).show();
|
||||||
} else {
|
} else {
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user