fixed resize and analysis

This commit is contained in:
Claudio 2026-04-15 14:37:49 +02:00
parent d40fc7d177
commit 6b9cf20ab9
3 changed files with 644 additions and 340 deletions

File diff suppressed because it is too large Load Diff

View File

@ -342,8 +342,8 @@ $gridMeta = [
?> ?>
<script> <script>
window.gridData = <?= json_encode($gridDataArray, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>; window.gridData = <?= json_encode($gridDataArray, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>;
window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>; window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>;
</script> </script>
<!doctype html> <!doctype html>
@ -797,7 +797,7 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
} }
#photosModal > .modal-content { #photosModal>.modal-content {
background-color: #fff; background-color: #fff;
margin: 5% auto; margin: 5% auto;
padding: 20px; padding: 20px;
@ -892,9 +892,17 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
} }
@keyframes new-row-pulse { @keyframes new-row-pulse {
0%, 100% { background-color: transparent; }
50% { background-color: #cce5ff; } 0%,
100% {
background-color: transparent;
}
50% {
background-color: #cce5ff;
}
} }
.row-just-created { .row-just-created {
animation: new-row-pulse 1s ease-in-out 3; animation: new-row-pulse 1s ease-in-out 3;
} }
@ -1029,21 +1037,25 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
font-size: 13px; font-size: 13px;
color: #495057; color: #495057;
} }
.pager-rows-per-page { .pager-rows-per-page {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
} }
.pager-label { .pager-label {
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
} }
.pager-limit-group { .pager-limit-group {
display: inline-flex; display: inline-flex;
border: 1px solid #ced4da; border: 1px solid #ced4da;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
} }
.pager-limit-btn { .pager-limit-btn {
padding: 3px 10px; padding: 3px 10px;
text-decoration: none; text-decoration: none;
@ -1052,24 +1064,41 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
transition: background .15s, color .15s; transition: background .15s, color .15s;
font-weight: 500; font-weight: 500;
} }
.pager-limit-btn:last-child { border-right: none; }
.pager-limit-btn:hover { background: #e9ecef; text-decoration: none; color: #212529; } .pager-limit-btn:last-child {
border-right: none;
}
.pager-limit-btn:hover {
background: #e9ecef;
text-decoration: none;
color: #212529;
}
.pager-limit-btn.active { .pager-limit-btn.active {
background: #0d6efd; background: #0d6efd;
color: #fff; color: #fff;
} }
.pager-limit-btn.active:hover { background: #0b5ed7; color: #fff; }
.pager-limit-btn.active:hover {
background: #0b5ed7;
color: #fff;
}
.pager-nav { .pager-nav {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
} }
.pager-info { .pager-info {
margin-right: 8px; margin-right: 8px;
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
} }
.pager-btn, .pager-num {
.pager-btn,
.pager-num {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -1083,16 +1112,25 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
font-weight: 500; font-weight: 500;
transition: background .15s, color .15s, border-color .15s; transition: background .15s, color .15s, border-color .15s;
} }
.pager-btn:hover, .pager-num:hover { background: #e9ecef; text-decoration: none; color: #212529; }
.pager-btn:hover,
.pager-num:hover {
background: #e9ecef;
text-decoration: none;
color: #212529;
}
.pager-num.active { .pager-num.active {
background: #0d6efd; background: #0d6efd;
color: #fff; color: #fff;
border-color: #0d6efd; border-color: #0d6efd;
} }
.pager-btn.disabled { .pager-btn.disabled {
pointer-events: none; pointer-events: none;
opacity: .4; opacity: .4;
} }
.pager-dots { .pager-dots {
padding: 0 2px; padding: 0 2px;
color: #adb5bd; color: #adb5bd;
@ -1112,20 +1150,20 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
<a href="imported.php?id=<?= $template_id ?>" class="btn btn-warning me-2">Imported (i)</a> <a href="imported.php?id=<?= $template_id ?>" class="btn btn-warning me-2">Imported (i)</a>
<a href="tolims.php?id=<?= $template_id ?>" class="btn btn-success">To LIMS (l)</a> <a href="tolims.php?id=<?= $template_id ?>" class="btn btn-success">To LIMS (l)</a>
<?php if ($importref === ''): ?> <?php if ($importref === ''): ?>
<span class="ms-3"> <span class="ms-3">
<label class="form-check-label" style="font-size: 13px; cursor: pointer;"> <label class="form-check-label" style="font-size: 13px; cursor: pointer;">
<input type="checkbox" class="form-check-input" id="showAllUsers" <?= $show_all_users ? 'checked' : '' ?> <input type="checkbox" class="form-check-input" id="showAllUsers" <?= $show_all_users ? 'checked' : '' ?>
onchange="window.location.href='imported.php?id=<?= $template_id ?>' + (this.checked ? '&all_users=1' : '')"> onchange="window.location.href='imported.php?id=<?= $template_id ?>' + (this.checked ? '&all_users=1' : '')">
Show all users Show all users
</label> </label>
</span> </span>
<span class="text-muted" style="font-size: 12px;"> <span class="text-muted" style="font-size: 12px;">
(<?= $usePagination ? count($importedData) . " of {$totalRows}" : count($importedData) ?> records<?= !$show_all_users ? ' — my records only' : '' ?>) (<?= $usePagination ? count($importedData) . " of {$totalRows}" : count($importedData) ?> records<?= !$show_all_users ? ' — my records only' : '' ?>)
</span> </span>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php if ($usePagination): ?> <?php if ($usePagination): ?>
<?php <?php
$baseQuery = $_GET; $baseQuery = $_GET;
unset($baseQuery['limit'], $baseQuery['page']); unset($baseQuery['limit'], $baseQuery['page']);
$pageQuery = $_GET; $pageQuery = $_GET;
@ -1133,43 +1171,43 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
$pageBase = 'imported.php?' . http_build_query($pageQuery); $pageBase = 'imported.php?' . http_build_query($pageQuery);
$fromRow = ($page - 1) * $perPage + 1; $fromRow = ($page - 1) * $perPage + 1;
$toRow = min($page * $perPage, $totalRows); $toRow = min($page * $perPage, $totalRows);
?> ?>
<div class="pager-bar mb-2"> <div class="pager-bar mb-2">
<div class="pager-rows-per-page"> <div class="pager-rows-per-page">
<span class="pager-label">Rows per page</span> <span class="pager-label">Rows per page</span>
<div class="pager-limit-group"> <div class="pager-limit-group">
<?php foreach ($allowedLimits as $lim): <?php foreach ($allowedLimits as $lim):
$isActive = ($perPage === $lim); $isActive = ($perPage === $lim);
$url = 'imported.php?' . http_build_query(array_merge($baseQuery, ['limit' => $lim])); $url = 'imported.php?' . http_build_query(array_merge($baseQuery, ['limit' => $lim]));
?> ?>
<a href="<?= htmlspecialchars($url) ?>" class="pager-limit-btn <?= $isActive ? 'active' : '' ?>"><?= $lim ?></a> <a href="<?= htmlspecialchars($url) ?>" class="pager-limit-btn <?= $isActive ? 'active' : '' ?>"><?= $lim ?></a>
<?php endforeach; ?> <?php endforeach; ?>
</div>
</div> </div>
</div> <?php if ($totalPages > 1): ?>
<?php if ($totalPages > 1): ?> <div class="pager-nav">
<div class="pager-nav"> <span class="pager-info"><?= $fromRow ?><?= $toRow ?> of <?= $totalRows ?></span>
<span class="pager-info"><?= $fromRow ?><?= $toRow ?> of <?= $totalRows ?></span> <a href="<?= htmlspecialchars($pageBase . '&page=1') ?>" class="pager-btn <?= $page <= 1 ? 'disabled' : '' ?>" title="First"><i class="fas fa-angle-double-left"></i></a>
<a href="<?= htmlspecialchars($pageBase . '&page=1') ?>" class="pager-btn <?= $page <= 1 ? 'disabled' : '' ?>" title="First"><i class="fas fa-angle-double-left"></i></a> <a href="<?= htmlspecialchars($pageBase . '&page=' . ($page - 1)) ?>" class="pager-btn <?= $page <= 1 ? 'disabled' : '' ?>" title="Previous"><i class="fas fa-angle-left"></i></a>
<a href="<?= htmlspecialchars($pageBase . '&page=' . ($page - 1)) ?>" class="pager-btn <?= $page <= 1 ? 'disabled' : '' ?>" title="Previous"><i class="fas fa-angle-left"></i></a> <?php
<?php $startPage = max(1, $page - 2);
$startPage = max(1, $page - 2); $endPage = min($totalPages, $page + 2);
$endPage = min($totalPages, $page + 2); if ($startPage > 1): ?>
if ($startPage > 1): ?> <a href="<?= htmlspecialchars($pageBase . '&page=1') ?>" class="pager-num">1</a>
<a href="<?= htmlspecialchars($pageBase . '&page=1') ?>" class="pager-num">1</a> <?php if ($startPage > 2): ?><span class="pager-dots">...</span><?php endif; ?>
<?php if ($startPage > 2): ?><span class="pager-dots">...</span><?php endif; ?> <?php endif;
<?php endif; for ($p = $startPage; $p <= $endPage; $p++): ?>
for ($p = $startPage; $p <= $endPage; $p++): ?> <a href="<?= htmlspecialchars($pageBase . '&page=' . $p) ?>" class="pager-num <?= $p === $page ? 'active' : '' ?>"><?= $p ?></a>
<a href="<?= htmlspecialchars($pageBase . '&page=' . $p) ?>" class="pager-num <?= $p === $page ? 'active' : '' ?>"><?= $p ?></a> <?php endfor;
<?php endfor; if ($endPage < $totalPages): ?>
if ($endPage < $totalPages): ?> <?php if ($endPage < $totalPages - 1): ?><span class="pager-dots">...</span><?php endif; ?>
<?php if ($endPage < $totalPages - 1): ?><span class="pager-dots">...</span><?php endif; ?> <a href="<?= htmlspecialchars($pageBase . '&page=' . $totalPages) ?>" class="pager-num"><?= $totalPages ?></a>
<a href="<?= htmlspecialchars($pageBase . '&page=' . $totalPages) ?>" class="pager-num"><?= $totalPages ?></a> <?php endif; ?>
<a href="<?= htmlspecialchars($pageBase . '&page=' . ($page + 1)) ?>" class="pager-btn <?= $page >= $totalPages ? 'disabled' : '' ?>" title="Next"><i class="fas fa-angle-right"></i></a>
<a href="<?= htmlspecialchars($pageBase . '&page=' . $totalPages) ?>" class="pager-btn <?= $page >= $totalPages ? 'disabled' : '' ?>" title="Last"><i class="fas fa-angle-double-right"></i></a>
</div>
<?php endif; ?> <?php endif; ?>
<a href="<?= htmlspecialchars($pageBase . '&page=' . ($page + 1)) ?>" class="pager-btn <?= $page >= $totalPages ? 'disabled' : '' ?>" title="Next"><i class="fas fa-angle-right"></i></a>
<a href="<?= htmlspecialchars($pageBase . '&page=' . $totalPages) ?>" class="pager-btn <?= $page >= $totalPages ? 'disabled' : '' ?>" title="Last"><i class="fas fa-angle-double-right"></i></a>
</div> </div>
<?php endif; ?>
</div>
<?php endif; ?> <?php endif; ?>
<div class="card radius-10"> <div class="card radius-10">
<div class="card-header"> <div class="card-header">
@ -1208,6 +1246,7 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
</div> </div>
</form> </form>
<div id="partsModalContainer"></div> <div id="partsModalContainer"></div>
<div id="analysisModalContainer"></div>
<div id="annotationsModalContainer"></div> <div id="annotationsModalContainer"></div>
<?php include 'photos_functions.php'; ?> <?php include 'photos_functions.php'; ?>
</div> </div>
@ -1218,7 +1257,12 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
<a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a> <a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a>
<?php include('include/footer.php'); ?> <?php include('include/footer.php'); ?>
</div> </div>
<style>.btn i { margin-top: 0 !important; margin-bottom: 0 !important; }</style> <style>
.btn i {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
</style>
<?php include('jsinclude.php'); ?> <?php include('jsinclude.php'); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/5.3.1/fabric.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/5.3.1/fabric.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script>
@ -1231,6 +1275,7 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
<script src="photos.js"></script> <script src="photos.js"></script>
<script src="annotationsModal.js"></script> <script src="annotationsModal.js"></script>
<script src="partsTable.js"></script> <script src="partsTable.js"></script>
<script src="analysisModal.js"></script>
<div class="modal fade" id="exportConfirmModal" tabindex="-1" aria-labelledby="exportConfirmModalLabel" aria-hidden="true"> <div class="modal fade" id="exportConfirmModal" tabindex="-1" aria-labelledby="exportConfirmModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
@ -1394,4 +1439,4 @@ window.gridMeta = <?= json_encode($gridMeta, JSON_UNESCAPED_UNICODE | JSON_UNESC
</body> </body>
</html> </html>

View File

@ -760,7 +760,7 @@
{ {
"IdSchemaCustomFields": 182, "IdSchemaCustomFields": 182,
"ConteggioClienti": 0, "ConteggioClienti": 0,
"Nome": "Ralph Lauren - All testing V.6", "Nome": "Ralph Lauren - All testing V.10",
"Descrizione": "AGGIORNAMENTO AL 16\/03\/2026 per estrazione fatturazione" "Descrizione": "AGGIORNAMENTO AL 16\/03\/2026 per estrazione fatturazione"
}, },
{ {
@ -876,6 +876,12 @@
"ConteggioClienti": 0, "ConteggioClienti": 0,
"Nome": "ROSSIMODA", "Nome": "ROSSIMODA",
"Descrizione": "Per tutti i campioni di ROSSIMODA\r\n\r\n" "Descrizione": "Per tutti i campioni di ROSSIMODA\r\n\r\n"
},
{
"IdSchemaCustomFields": 202,
"ConteggioClienti": 0,
"Nome": "LIMS-CIM - MAX MARA",
"Descrizione": "Schema per MAX MARA scambio dati Database"
} }
] ]
} }