diff --git a/public/userarea/index.php b/public/userarea/index.php
index 0d78553..c33092f 100644
--- a/public/userarea/index.php
+++ b/public/userarea/index.php
@@ -1,4 +1,25 @@
+prepare($query);
+$stmt->bind_param("i", $idcompany);
+$stmt->execute();
+$result = $stmt->get_result();
+
+$modulesStatus = [];
+while ($row = $result->fetch_assoc()) {
+ $modulesStatus[$row['idmodules']] = $row['activemod'];
+}
+?>
+
diff --git a/public/userarea/products/reportdetails.php b/public/userarea/products/reportdetails.php
index 03dd9cd..ce340c6 100644
--- a/public/userarea/products/reportdetails.php
+++ b/public/userarea/products/reportdetails.php
@@ -22,13 +22,15 @@ $queryPartsAndResults = "
SELECT rp.*,
a.nameanalysisvoc AS testName,
cv.namecompoundsvocabulary AS analytsName,
- pr.partsDescription
+ pr.partsDescription,
+ rp.result_UnitofMeasure -- Aggiunge l'unità di misura
FROM result_project rp
LEFT JOIN analysisvocabulary a ON rp.result_TestName = a.idanalysisvocabulary
LEFT JOIN compundsvocabulary cv ON rp.result_AnalytsName = cv.idcompoundsvocabulary
LEFT JOIN parts pr ON rp.idPart = pr.idParts
WHERE rp.idreports = ?
ORDER BY rp.result_TestName, rp.idPart";
+
$stmtParts = $conn->prepare($queryPartsAndResults);
$stmtParts->bind_param("i", $idreports);
$stmtParts->execute();
@@ -256,7 +258,14 @@ $partsAndResults = $stmtParts->get_result();
// Stampa i dettagli dell'analita
echo '
';
echo '| ' . (!empty($row['analytsName']) ? $row['analytsName'] . ' (ID: ' . $row['result_AnalytsName'] . ')' : ' ') . ' | ';
- echo '' . (!empty($row['result_Value']) ? htmlspecialchars($row['result_Value'], ENT_QUOTES, 'UTF-8') : ' ') . ' | ';
+ echo '' . (!empty($row['result_Value']) ? htmlspecialchars($row['result_Value'], ENT_QUOTES, 'UTF-8') : ' ');
+
+ // Aggiungi l'unità di misura se presente
+ if (!empty($row['result_UnitofMeasure'])) {
+ echo ' ' . htmlspecialchars($row['result_UnitofMeasure'], ENT_QUOTES, 'UTF-8'); // Aggiunge l'unità di misura accanto al valore
+ }
+
+ echo ' | ';
echo '' . (!empty($row['test_Rating']) ? htmlspecialchars($row['test_Rating'], ENT_QUOTES, 'UTF-8') : ' ') . ' | ';
echo '
';
}
@@ -299,18 +308,35 @@ $partsAndResults = $stmtParts->get_result();
// Filtro per Part Name
$('#searchPart').on('keyup', function() {
var value = $(this).val().toLowerCase();
+
+ // Filtra le parti
$('h6').each(function() {
var part = $(this);
+ var partTable = part.next('table');
+
if (part.text().toLowerCase().includes(value)) {
part.show();
- part.next('table').show();
+ partTable.show();
} else {
part.hide();
- part.next('table').hide();
+ partTable.hide();
+ }
+ });
+
+ // Dopo aver filtrato le parti, verifica se l'analisi ha parti visibili
+ $('.section-separator').each(function() {
+ var analysisTitle = $(this); // Il titolo dell'analisi
+ var hasVisibleParts = analysisTitle.nextUntil('.section-separator', 'h6:visible').length > 0; // Verifica se ci sono parti visibili
+
+ if (!hasVisibleParts) {
+ analysisTitle.hide(); // Nasconde l'intestazione dell'analisi se nessuna parte è visibile
+ } else {
+ analysisTitle.show(); // Mostra l'intestazione dell'analisi se almeno una parte è visibile
}
});
});
+
// Filtro per Rating
$('#searchRating').on('change', function() {
var selectedRating = $(this).val().toLowerCase(); // Prende il rating selezionato
@@ -340,12 +366,15 @@ $partsAndResults = $stmtParts->get_result();
if (visibleRows === 0) {
table.hide();
table.prev('h6').hide(); // Nasconde anche il titolo della parte
+ table.prevAll('.section-separator:first').hide(); // Nasconde il titolo dell'analisi
} else {
table.show();
table.prev('h6').show(); // Mostra il titolo della parte
+ table.prevAll('.section-separator:first').show(); // Mostra il titolo dell'analisi
}
});
});
+
});