diff --git a/public/userarea/ajax_update_priority.php b/public/userarea/ajax_update_priority.php index 482c88a..7cd5c30 100644 --- a/public/userarea/ajax_update_priority.php +++ b/public/userarea/ajax_update_priority.php @@ -3,22 +3,31 @@ require_once("include/headscript.php"); $db = DBHandlerSelect::getInstance(); $pdo = $db->getConnection(); -$programmati = json_decode($_POST["programmati"], true); -$daProgrammare = json_decode($_POST["daProgrammare"], true); +$programmati = json_decode($_POST["programmati"] ?? '[]', true); +$daProgrammare = json_decode($_POST["daProgrammare"] ?? '[]', true); $pdo->beginTransaction(); foreach ($programmati as $p) { - $stmt = $pdo->prepare("UPDATE productiondata SET id_status=6, priority=? WHERE id=?"); - $stmt->execute([$p["priority"], $p["id"]]); + if (empty($p['id'])) { + continue; + } + $stmt = $pdo->prepare( + "UPDATE productiondata SET id_status=6, priority=? WHERE id=?" + ); + $stmt->execute([(int)$p["priority"], (int)$p["id"]]); } foreach ($daProgrammare as $p) { - $stmt = $pdo->prepare("UPDATE productiondata SET id_status=1, priority=? WHERE id=?"); - $stmt->execute([$p["priority"], $p["id"]]); + if (empty($p['id'])) { + continue; + } + $stmt = $pdo->prepare( + "UPDATE productiondata SET id_status=1, priority=? WHERE id=?" + ); + $stmt->execute([(int)$p["priority"], (int)$p["id"]]); } - $pdo->commit(); echo json_encode(["success" => true]); diff --git a/public/userarea/assets/js/app.js b/public/userarea/assets/js/app.js index 60f9784..5002ea9 100644 --- a/public/userarea/assets/js/app.js +++ b/public/userarea/assets/js/app.js @@ -37,6 +37,16 @@ $(function () { }, )); }), + // NEW: se la pagina parte già con .wrapper.toggled, abilita subito l'hover + $(".wrapper").hasClass("toggled") && + $(".sidebar-wrapper").hover( + function () { + $(".wrapper").addClass("sidebar-hovered"); + }, + function () { + $(".wrapper").removeClass("sidebar-hovered"); + }, + ), $(document).ready(function () { $(window).on("scroll", function () { $(this).scrollTop() > 300 diff --git a/public/userarea/manager_produzione.php b/public/userarea/manager_produzione.php index b8ba1c9..5891ae1 100644 --- a/public/userarea/manager_produzione.php +++ b/public/userarea/manager_produzione.php @@ -167,7 +167,7 @@ $rows_special = array_filter($rows, function ($r) {
-| Conf. Ord. | Matrice | Mescola | Linea | @@ -220,6 +221,7 @@ $rows_special = array_filter($rows, function ($r) { data-id="= (int)$r['id'] ?>" data-seconds="= $sec ?>" style="--rowcolor: = htmlspecialchars($r['line_color']) ?>;"> += htmlspecialchars($r['conferma_ordine'] ?? '') ?> | = htmlspecialchars($r['matrice']) ?> | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Conf. Ord. | Matrice | Mescola | Linea | @@ -334,6 +337,7 @@ $rows_special = array_filter($rows, function ($r) {||||||||
| = htmlspecialchars($r['conferma_ordine'] ?? '') ?> | = htmlspecialchars($r['matrice']) ?> | { + html += `