fixed mescole space
This commit is contained in:
+62
-33
@@ -92,6 +92,10 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#tabellaMescole td:nth-child(1) {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* ID */
|
||||
#tabellaMescole th:nth-child(1),
|
||||
#tabellaMescole td:nth-child(1) {
|
||||
@@ -99,18 +103,25 @@
|
||||
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) */
|
||||
#tabellaMescole th:nth-child(2),
|
||||
#tabellaMescole td:nth-child(2) {
|
||||
width: 240px;
|
||||
max-width: 240px;
|
||||
width: 22%;
|
||||
}
|
||||
|
||||
/* Nome Uscita */
|
||||
#tabellaMescole th:nth-child(3),
|
||||
#tabellaMescole td:nth-child(3) {
|
||||
width: 300px;
|
||||
max-width: 300px;
|
||||
width: 26%;
|
||||
}
|
||||
|
||||
#tabellaMescole td:nth-child(3) a {
|
||||
@@ -127,39 +138,60 @@
|
||||
/* Q.tà totale */
|
||||
#tabellaMescole th:nth-child(4),
|
||||
#tabellaMescole td:nth-child(4) {
|
||||
width: 130px;
|
||||
max-width: 130px;
|
||||
width: 110px;
|
||||
max-width: 110px;
|
||||
}
|
||||
|
||||
/* Linee */
|
||||
#tabellaMescole th:nth-child(5),
|
||||
#tabellaMescole td:nth-child(5) {
|
||||
width: 220px;
|
||||
max-width: 220px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* Certificati */
|
||||
#tabellaMescole th:nth-child(6),
|
||||
#tabellaMescole td:nth-child(6) {
|
||||
width: 120px;
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
/* Stato */
|
||||
#tabellaMescole th:nth-child(7),
|
||||
#tabellaMescole td:nth-child(7) {
|
||||
width: 120px;
|
||||
max-width: 120px;
|
||||
width: 80px;
|
||||
max-width: 80px;
|
||||
}
|
||||
|
||||
/* Azioni */
|
||||
#tabellaMescole th:nth-child(8),
|
||||
#tabellaMescole td:nth-child(8) {
|
||||
#tabellaMescole th:nth-child(7),
|
||||
#tabellaMescole td:nth-child(7) {
|
||||
width: 190px;
|
||||
max-width: 190px;
|
||||
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 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -403,13 +435,12 @@
|
||||
<table id="tabellaMescole" class="table table-striped align-middle text-center" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th title="Stato">●</th>
|
||||
<th>Nome</th>
|
||||
<th>Nome Uscita</th>
|
||||
<th>Q.tà Totale</th>
|
||||
<th>Linee Associate</th>
|
||||
<th>Certificati</th>
|
||||
<th>Stato</th>
|
||||
<th>Cert.</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</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>
|
||||
</tr>";
|
||||
} else {
|
||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
@@ -478,9 +508,9 @@
|
||||
$qtyTot = number_format((float)$row['qty_totale'], 3, ',', '.');
|
||||
|
||||
$isActive = (int)$row['is_active'] === 1;
|
||||
$badge = $isActive
|
||||
? "<span class='badge bg-success'>Attiva</span>"
|
||||
: "<span class='badge bg-secondary'>Inattiva</span>";
|
||||
$statoLabel = $isActive ? 'Attiva' : 'Inattiva';
|
||||
$badge = "<span class='dot-status " . ($isActive ? 'dot-active' : 'dot-inactive') . "' title='{$statoLabel}'></span>"
|
||||
. "<span class='dot-sr'>{$statoLabel}</span>";
|
||||
|
||||
$toggleText = $isActive ? "Disattiva" : "Attiva";
|
||||
$toggleClass = $isActive ? "btn-outline-warning" : "btn-outline-success";
|
||||
@@ -492,21 +522,20 @@
|
||||
|
||||
$nCert = (int)($row['n_certificati'] ?? 0);
|
||||
$certBadge = $nCert > 0
|
||||
? "<span class='badge-files badge-files-ok' title='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-ok' title='{$nCert} certificati di analisi caricati'>📄 {$nCert}</span>"
|
||||
: "<span class='badge-files badge-files-none' title='Nessun certificato di analisi'>0</span>";
|
||||
|
||||
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>
|
||||
<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}
|
||||
</a>
|
||||
</td>
|
||||
<td><span class='fw-semibold'>{$qtyTot}</span></td>
|
||||
<td>{$linee}</td>
|
||||
<td>{$certBadge}</td>
|
||||
<td>{$badge}</td>
|
||||
<td class='azioni-cell'>
|
||||
<button type='button' class='btn btn-sm btn-outline-dark associa-fornitori'
|
||||
data-id='{$row['id']}'
|
||||
@@ -774,10 +803,10 @@
|
||||
// datatable
|
||||
$('#tabellaMescole').DataTable({
|
||||
order: [
|
||||
[0, 'desc']
|
||||
[2, 'asc']
|
||||
],
|
||||
columnDefs: [{
|
||||
targets: [7],
|
||||
targets: [6],
|
||||
orderable: false,
|
||||
searchable: false
|
||||
}],
|
||||
|
||||
Reference in New Issue
Block a user