From 06092e24aae160a34b1b5e904776f3fb5c0abdf5 Mon Sep 17 00:00:00 2001 From: solocla Date: Mon, 21 Sep 2026 09:17:53 +0200 Subject: [PATCH] added production to fill --- public/userarea/include/navbar.php | 5 + public/userarea/production_da_compilare.php | 204 ++++++++++++++------ 2 files changed, 153 insertions(+), 56 deletions(-) diff --git a/public/userarea/include/navbar.php b/public/userarea/include/navbar.php index 2b82c05a..ed63cfae 100644 --- a/public/userarea/include/navbar.php +++ b/public/userarea/include/navbar.php @@ -164,6 +164,11 @@ Line View +
  • + + Dati Prod + +
  • diff --git a/public/userarea/production_da_compilare.php b/public/userarea/production_da_compilare.php index 93dcd64e..b7400a54 100644 --- a/public/userarea/production_da_compilare.php +++ b/public/userarea/production_da_compilare.php @@ -120,36 +120,47 @@ if (!empty($_GET['ajax'])) { $teoKg = number_format((float)($r['kg_sp'] ?? 0), 2, '.', ''); $teoMt = number_format((float)($r['metri'] ?? 0), 2, '.', ''); + $descr = trim($r['note_extra'] ?? ''); + $descrShow = $descr !== '' ? $descr : '—'; + echo '
    '; - echo '
    '; - echo '
    ' . htmlspecialchars($r['matrice'] ?? '—') . '
    '; - echo '
    Da compilare
    '; + // --- RIGA COMPATTA (sempre visibile) --- + echo '
    '; + echo '
    '; + echo '
    ' . htmlspecialchars($r['matrice'] ?? '—') . '
    '; + echo '
    ' . htmlspecialchars($descrShow) . '
    '; + echo '
    '; + echo ' ' . htmlspecialchars($r['cliente'] ?? '—') . ''; + echo ' ' . $endTime . ''; + echo '
    '; + echo '
    '; + echo '
    '; + echo ' Compila dati'; + echo ' '; + echo '
    '; echo '
    '; - echo '
    '; - echo '
    Linea' . htmlspecialchars($r['linea'] ?? '—') . '
    '; - echo '
    Cliente' . htmlspecialchars($r['cliente'] ?? '—') . '
    '; - echo '
    Fine produzione' . $endTime . '
    '; - echo '
    Tempo occupato' . $occupato . '
    '; - echo '
    Tempo pause' . $pause . '
    '; - echo '
    Tempo netto' . $netto . '
    '; - echo '
    '; + // --- DETTAGLIO (collassato) --- + echo '
    '; + echo '
    '; + echo '
    Linea' . htmlspecialchars($r['linea'] ?? '—') . '
    '; + echo '
    Tempo occupato' . $occupato . '
    '; + echo '
    Tempo pause' . $pause . '
    '; + echo '
    Tempo netto' . $netto . '
    '; + echo '
    '; if (!empty($r['mescole_list'])) { - echo '
    Mescole: ' + echo '
    Mescole: ' . htmlspecialchars($r['mescole_list']) . '
    '; } - if (!empty($r['note_extra'])) { - echo '
    Descrizione: ' - . htmlspecialchars($r['note_extra']) . '
    '; - } - echo '
    '; - echo ''; - echo '
    '; + echo '
    '; + echo ' '; + echo '
    '; + echo '
    '; // .compile-detail echo '
    '; // .compile-card } @@ -209,7 +220,7 @@ if (!empty($_GET['ajax'])) { } .card-header { - background: linear-gradient(135deg, #6d28d9, #7c3aed); + background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: white; padding: 1.2rem 1.5rem; flex-shrink: 0; @@ -242,95 +253,171 @@ if (!empty($_GET['ajax'])) { #recordsContainer { flex: 1; overflow-y: auto; - padding: 1.2rem 1.5rem 5rem 1.5rem; + padding: 1rem 1.5rem 5rem 1.5rem; background: #f8fafc; } + /* --- CARD COMPATTA --- */ .compile-card { background: #fff; - border-radius: 1rem; - border-left: 6px solid #7c3aed; - box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06); - padding: 1.1rem 1.3rem; - margin-bottom: 1rem; + border-radius: 0.7rem; + border: 1px solid #e2e8f0; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); + margin-bottom: 0.6rem; + overflow: hidden; + transition: box-shadow 0.2s; } - .compile-head { + .compile-card:hover { + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); + } + + .compile-row { display: flex; - justify-content: space-between; align-items: center; - margin-bottom: 0.8rem; + justify-content: space-between; + gap: 1rem; + padding: 0.7rem 1rem; + cursor: pointer; + } + + .compile-main { + min-width: 0; + flex: 1; } .compile-title { - font-size: 1.3rem; - font-weight: 800; + font-size: 1.05rem; + font-weight: 700; color: #1e293b; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .compile-descr { + font-size: 0.85rem; + color: #64748b; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-top: 0.1rem; + } + + .compile-meta { + display: flex; + gap: 1.2rem; + flex-wrap: wrap; + margin-top: 0.35rem; + font-size: 0.82rem; + color: #475569; + } + + .compile-meta span { + display: inline-flex; + align-items: center; + gap: 0.35rem; + } + + .compile-meta i { + color: #94a3b8; + } + + .compile-right { + display: flex; + align-items: center; + gap: 0.7rem; + flex-shrink: 0; } .compile-badge { - background: #ede9fe; - color: #6d28d9; - padding: 0.35rem 0.85rem; + background: #dbeafe; + color: #1e40af; + border: 1px solid #bfdbfe; + padding: 0.3rem 0.8rem; border-radius: 2rem; - font-size: 0.75rem; + font-size: 0.72rem; font-weight: 700; text-transform: uppercase; - letter-spacing: 0.5px; + letter-spacing: 0.4px; + white-space: nowrap; + } + + .expand-arrow { + font-size: 1.1rem; + color: #94a3b8; + transition: transform 0.3s ease; + } + + .compile-card.expanded .expand-arrow { + transform: rotate(180deg); + } + + /* --- DETTAGLIO COLLASSATO --- */ + .compile-detail { + max-height: 0; + overflow: hidden; + transition: max-height 0.35s ease, padding 0.35s ease; + padding: 0 1rem; + border-top: 0 solid #e2e8f0; + } + + .compile-card.expanded .compile-detail { + max-height: 500px; + padding: 0.9rem 1rem 1rem 1rem; + border-top: 1px solid #e2e8f0; } .compile-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); - gap: 0.7rem 1rem; - margin-bottom: 0.6rem; + grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); + gap: 0.6rem 1rem; } .compile-grid strong { display: block; color: #64748b; - font-size: 0.7rem; + font-size: 0.68rem; text-transform: uppercase; - letter-spacing: 0.5px; - margin-bottom: 0.15rem; + letter-spacing: 0.4px; + margin-bottom: 0.1rem; } .compile-grid span { color: #1e293b; font-weight: 600; - font-size: 1.05rem; + font-size: 1rem; } .compile-mescole { color: #475569; - font-size: 0.95rem; - margin-top: 0.3rem; + font-size: 0.9rem; + margin-top: 0.7rem; } .compile-actions { - margin-top: 1rem; + margin-top: 0.9rem; display: flex; justify-content: flex-end; } .compile-btn { - padding: 0.9rem 1.6rem; - font-size: 1.05rem; + padding: 0.75rem 1.4rem; + font-size: 1rem; font-weight: 700; border: none; - border-radius: 0.8rem; + border-radius: 0.7rem; cursor: pointer; color: white; - text-transform: uppercase; - letter-spacing: 0.8px; + letter-spacing: 0.5px; } .btn-fill { - background: linear-gradient(135deg, #7c3aed, #6d28d9); + background: linear-gradient(135deg, #10b981, #059669); } .btn-fill:hover { - background: linear-gradient(135deg, #6d28d9, #5b21b6); + background: linear-gradient(135deg, #059669, #047857); } .no-records { @@ -342,7 +429,7 @@ if (!empty($_GET['ajax'])) { .no-records i { font-size: 3.5rem; - color: #a78bfa; + color: #cbd5e1; } /* --- MODALE --- */ @@ -442,7 +529,7 @@ if (!empty($_GET['ajax'])) { } .modal-confirm { - background: #7c3aed; + background: #10b981; color: white; } @@ -529,7 +616,7 @@ if (!empty($_GET['ajax'])) { function loadRecords() { $('#recordsContainer').html( - '
    ' + '
    ' ); $.get('', { ajax: 1 @@ -540,6 +627,11 @@ if (!empty($_GET['ajax'])) { }); } + // Collasso/espansione riga (clic sulla riga, non sui bottoni) + $(document).on('click', '.compile-row', function() { + $(this).closest('.compile-card').toggleClass('expanded'); + }); + function recalcScrapPerc() { const kg = parseFloat($('#kgprod').val()) || 0; const sc = parseFloat($('#scarto').val()) || 0;