fixed mescole space

This commit is contained in:
2026-07-24 14:21:41 +02:00
parent 0427c73e8a
commit d564561a4e
+62 -33
View File
@@ -92,6 +92,10 @@
white-space: nowrap; white-space: nowrap;
} }
#tabellaMescole td:nth-child(1) {
overflow: visible;
}
/* ID */ /* ID */
#tabellaMescole th:nth-child(1), #tabellaMescole th:nth-child(1),
#tabellaMescole td:nth-child(1) { #tabellaMescole td:nth-child(1) {
@@ -99,18 +103,25 @@
max-width: 70px; max-width: 70px;
} }
/* Stato (pallino) */
#tabellaMescole th:nth-child(1),
#tabellaMescole td:nth-child(1) {
width: 42px;
max-width: 42px;
padding-left: 4px;
padding-right: 4px;
}
/* Nome (interno) */ /* Nome (interno) */
#tabellaMescole th:nth-child(2), #tabellaMescole th:nth-child(2),
#tabellaMescole td:nth-child(2) { #tabellaMescole td:nth-child(2) {
width: 240px; width: 22%;
max-width: 240px;
} }
/* Nome Uscita */ /* Nome Uscita */
#tabellaMescole th:nth-child(3), #tabellaMescole th:nth-child(3),
#tabellaMescole td:nth-child(3) { #tabellaMescole td:nth-child(3) {
width: 300px; width: 26%;
max-width: 300px;
} }
#tabellaMescole td:nth-child(3) a { #tabellaMescole td:nth-child(3) a {
@@ -127,39 +138,60 @@
/* Q.tà totale */ /* Q.tà totale */
#tabellaMescole th:nth-child(4), #tabellaMescole th:nth-child(4),
#tabellaMescole td:nth-child(4) { #tabellaMescole td:nth-child(4) {
width: 130px; width: 110px;
max-width: 130px; max-width: 110px;
} }
/* Linee */ /* Linee */
#tabellaMescole th:nth-child(5), #tabellaMescole th:nth-child(5),
#tabellaMescole td:nth-child(5) { #tabellaMescole td:nth-child(5) {
width: 220px; width: auto;
max-width: 220px;
} }
/* Certificati */ /* Certificati */
#tabellaMescole th:nth-child(6), #tabellaMescole th:nth-child(6),
#tabellaMescole td:nth-child(6) { #tabellaMescole td:nth-child(6) {
width: 120px; width: 80px;
max-width: 120px; max-width: 80px;
}
/* Stato */
#tabellaMescole th:nth-child(7),
#tabellaMescole td:nth-child(7) {
width: 120px;
max-width: 120px;
} }
/* Azioni */ /* Azioni */
#tabellaMescole th:nth-child(8), #tabellaMescole th:nth-child(7),
#tabellaMescole td:nth-child(8) { #tabellaMescole td:nth-child(7) {
width: 190px; width: 190px;
max-width: 190px; max-width: 190px;
white-space: normal; white-space: normal;
} }
/* ---------- PALLINO STATO ---------- */
.dot-status {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
vertical-align: middle;
}
.dot-active {
background: #16a34a;
box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}
.dot-inactive {
background: #f59e0b;
box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}
/* Testo dello stato: invisibile ma ricercabile da DataTables */
.dot-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
.azioni-cell { .azioni-cell {
display: flex; display: flex;
justify-content: center; justify-content: center;
@@ -403,13 +435,12 @@
<table id="tabellaMescole" class="table table-striped align-middle text-center" style="width:100%;"> <table id="tabellaMescole" class="table table-striped align-middle text-center" style="width:100%;">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th title="Stato"></th>
<th>Nome</th> <th>Nome</th>
<th>Nome Uscita</th> <th>Nome Uscita</th>
<th>Q. Totale</th> <th>Q. Totale</th>
<th>Linee Associate</th> <th>Linee Associate</th>
<th>Certificati</th> <th>Cert.</th>
<th>Stato</th>
<th>Azioni</th> <th>Azioni</th>
</tr> </tr>
</thead> </thead>
@@ -470,7 +501,6 @@
<td class='text-muted'>-</td> <td class='text-muted'>-</td>
<td class='text-muted'>-</td> <td class='text-muted'>-</td>
<td class='text-muted'>-</td> <td class='text-muted'>-</td>
<td class='text-muted'>-</td>
</tr>"; </tr>";
} else { } else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -478,9 +508,9 @@
$qtyTot = number_format((float)$row['qty_totale'], 3, ',', '.'); $qtyTot = number_format((float)$row['qty_totale'], 3, ',', '.');
$isActive = (int)$row['is_active'] === 1; $isActive = (int)$row['is_active'] === 1;
$badge = $isActive $statoLabel = $isActive ? 'Attiva' : 'Inattiva';
? "<span class='badge bg-success'>Attiva</span>" $badge = "<span class='dot-status " . ($isActive ? 'dot-active' : 'dot-inactive') . "' title='{$statoLabel}'></span>"
: "<span class='badge bg-secondary'>Inattiva</span>"; . "<span class='dot-sr'>{$statoLabel}</span>";
$toggleText = $isActive ? "Disattiva" : "Attiva"; $toggleText = $isActive ? "Disattiva" : "Attiva";
$toggleClass = $isActive ? "btn-outline-warning" : "btn-outline-success"; $toggleClass = $isActive ? "btn-outline-warning" : "btn-outline-success";
@@ -492,21 +522,20 @@
$nCert = (int)($row['n_certificati'] ?? 0); $nCert = (int)($row['n_certificati'] ?? 0);
$certBadge = $nCert > 0 $certBadge = $nCert > 0
? "<span class='badge-files badge-files-ok' title='Certificati di analisi caricati'>📄 {$nCert}</span>" ? "<span class='badge-files badge-files-ok' title='{$nCert} certificati di analisi caricati'>📄 {$nCert}</span>"
: "<span class='badge-files badge-files-none' title='Nessun certificato di analisi'>— nessuno</span>"; : "<span class='badge-files badge-files-none' title='Nessun certificato di analisi'>0</span>";
echo "<tr data-mescola-id='{$row['id']}'> echo "<tr data-mescola-id='{$row['id']}'>
<td>{$row['id']}</td> <td>{$badge}</td>
<td class='text-start' title=\"" . htmlspecialchars($row['nome'] ?? '', ENT_QUOTES) . "\">{$nomeSafe}</td> <td class='text-start' title=\"" . htmlspecialchars($row['nome'] ?? '', ENT_QUOTES) . "\">{$nomeSafe}</td>
<td> <td>
<a href='scheda_mescola.php?id={$row['id']}' title='Apri scheda mescola'> <a href='scheda_mescola.php?id={$row['id']}' title='Apri scheda mescola (ID {$row['id']})'>
{$nomeUscitaSafe} {$nomeUscitaSafe}
</a> </a>
</td> </td>
<td><span class='fw-semibold'>{$qtyTot}</span></td> <td><span class='fw-semibold'>{$qtyTot}</span></td>
<td>{$linee}</td> <td>{$linee}</td>
<td>{$certBadge}</td> <td>{$certBadge}</td>
<td>{$badge}</td>
<td class='azioni-cell'> <td class='azioni-cell'>
<button type='button' class='btn btn-sm btn-outline-dark associa-fornitori' <button type='button' class='btn btn-sm btn-outline-dark associa-fornitori'
data-id='{$row['id']}' data-id='{$row['id']}'
@@ -774,10 +803,10 @@
// datatable // datatable
$('#tabellaMescole').DataTable({ $('#tabellaMescole').DataTable({
order: [ order: [
[0, 'desc'] [2, 'asc']
], ],
columnDefs: [{ columnDefs: [{
targets: [7], targets: [6],
orderable: false, orderable: false,
searchable: false searchable: false
}], }],