reportsdetails fixed
This commit is contained in:
parent
0e4f47038f
commit
4583537638
@ -1,4 +1,25 @@
|
||||
<?php include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// Connessione al database
|
||||
$conn = new mysqli($servername, $username, $password, $database);
|
||||
// Query per ottenere i moduli attivi e disattivi
|
||||
|
||||
$query = "
|
||||
SELECT idmodules, activemod
|
||||
FROM activemodules
|
||||
WHERE idcompany = ?
|
||||
";
|
||||
$stmt = $conn->prepare($query);
|
||||
$stmt->bind_param("i", $idcompany);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
|
||||
$modulesStatus = [];
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$modulesStatus[$row['idmodules']] = $row['activemod'];
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
@ -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 '<tr>';
|
||||
echo '<td>' . (!empty($row['analytsName']) ? $row['analytsName'] . ' (ID: ' . $row['result_AnalytsName'] . ')' : ' ') . '</td>';
|
||||
echo '<td>' . (!empty($row['result_Value']) ? htmlspecialchars($row['result_Value'], ENT_QUOTES, 'UTF-8') : ' ') . '</td>';
|
||||
echo '<td>' . (!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 '</td>';
|
||||
echo '<td class="' . $ratingClass . '">' . (!empty($row['test_Rating']) ? htmlspecialchars($row['test_Rating'], ENT_QUOTES, 'UTF-8') : ' ') . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- plugin JS -->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user