added foto matrice everywhere

This commit is contained in:
2025-12-03 12:21:26 +01:00
parent 5b7a8b57d5
commit 9447f3cf00
3 changed files with 92 additions and 15 deletions
+47 -4
View File
@@ -12,6 +12,7 @@ $sql = "
SELECT
p.*,
m.nome AS matrice,
m.photo AS matrice_photo,
l.name AS linea,
c.nome AS cliente,
s.nome AS status_nome,
@@ -222,7 +223,20 @@ $rows_special = array_filter($rows, function ($r) {
data-seconds="<?= $sec ?>"
style="--rowcolor: <?= htmlspecialchars($r['line_color']) ?>;">
<td><?= htmlspecialchars($r['conferma_ordine'] ?? '') ?></td>
<td><?= htmlspecialchars($r['matrice']) ?></td>
<td>
<?= htmlspecialchars($r['matrice']) ?>
<?php if (!empty($r['matrice_photo'])): ?>
<br>
<img src="photos/matrici/<?= htmlspecialchars($r['matrice_photo']) ?>"
data-full="photos/matrici/<?= htmlspecialchars($r['matrice_photo']) ?>"
class="photo-thumb"
style="width:42px;height:42px;object-fit:cover;
border-radius:6px;border:1px solid #ced4da;
cursor:pointer;margin-top:3px;">
<?php endif; ?>
</td>
<?php
$mescRaw = $r['mescole_list'] ?? '';
$mescArray = $mescRaw !== '' ? explode(' | ', $mescRaw) : [];
@@ -338,7 +352,20 @@ $rows_special = array_filter($rows, function ($r) {
data-status="<?= (int)$r['id_status'] ?>"
style="background-color: <?= htmlspecialchars($r['line_color']) ?>;">
<td><?= htmlspecialchars($r['conferma_ordine'] ?? '') ?></td>
<td><?= htmlspecialchars($r['matrice']) ?></td>
<td>
<?= htmlspecialchars($r['matrice']) ?>
<?php if (!empty($r['matrice_photo'])): ?>
<br>
<img src="photos/matrici/<?= htmlspecialchars($r['matrice_photo']) ?>"
data-full="photos/matrici/<?= htmlspecialchars($r['matrice_photo']) ?>"
class="photo-thumb"
style="width:42px;height:42px;object-fit:cover;
border-radius:6px;border:1px solid #ced4da;
cursor:pointer;margin-top:3px;">
<?php endif; ?>
</td>
<?php
$mescRaw = $r['mescole_list'] ?? '';
$mescArray = $mescRaw !== '' ? explode(' | ', $mescRaw) : [];
@@ -565,6 +592,19 @@ $rows_special = array_filter($rows, function ($r) {
$("#photoModal").css("display", "flex");
});
// ❌ Chiudi modale foto (delegato)
$(document).on("click", "#photoModalCloseX, #photoCancel", function() {
$("#photoModal").hide();
});
// ❌ Chiudi cliccando sul backdrop (delegato)
$(document).on("click", "#photoModal", function(e) {
if (e.target.id === "photoModal") {
$("#photoModal").hide();
}
});
$("#photoModalCloseX, #photoCancel").on("click", function() {
$("#photoModal").hide();
});
@@ -610,16 +650,19 @@ $rows_special = array_filter($rows, function ($r) {
$("#imagePreviewModal").css("display", "flex");
});
$("#previewCloseX").on("click", function() {
// ❌ Chiudi preview con la X (delegato)
$(document).on("click", "#previewCloseX", function() {
$("#imagePreviewModal").hide();
});
$("#imagePreviewModal").on("click", function(e) {
// ❌ Chiudi cliccando fuori (delegato)
$(document).on("click", "#imagePreviewModal", function(e) {
if (e.target.id === "imagePreviewModal") {
$("#imagePreviewModal").hide();
}
});
// ===== MODALE MESCOLE (Multi) =====
$(document).on("click", ".showMescole", function(e) {
e.preventDefault();