From 1c793384ff03de34c489e6b7291d3f0ad8070e67 Mon Sep 17 00:00:00 2001 From: solocla Date: Fri, 23 Oct 2026 20:25:14 +0200 Subject: [PATCH] fixed sostegno --- public/userarea/manage-worksheet.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/public/userarea/manage-worksheet.php b/public/userarea/manage-worksheet.php index c91b070f..1aec219c 100644 --- a/public/userarea/manage-worksheet.php +++ b/public/userarea/manage-worksheet.php @@ -233,23 +233,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj $row_id = (int)($_POST['row_id'] ?? 0); $idmescola = (int)($_POST['idmescola'] ?? 0); - $pos = 0; // auto-assign if ($idmescola <= 0) { echo json_encode(['success' => false, 'message' => 'Seleziona una mescola']); exit; } - if ($pos <= 0) $pos = 1; - $mix_weight = $_POST['mix_weight_g_m'] !== '' ? (float)$_POST['mix_weight_g_m'] : null; + $mix_weight = ($_POST['mix_weight_g_m'] ?? '') !== '' + ? (float)str_replace(',', '.', $_POST['mix_weight_g_m']) + : null; $support_weight = ($_POST['support_weight_g_m'] ?? '') !== '' ? (float)str_replace(',', '.', $_POST['support_weight_g_m']) : null; - $density = trim($_POST['required_density'] ?? ''); - $hardness = trim($_POST['required_hardness_shore_a'] ?? ''); - - $lub_type = ($_POST['lubrication_type'] ?? '') !== '' ? $_POST['lubrication_type'] : null; - $lub_note = trim($_POST['lubrication_notes'] ?? ''); + $density = trim($_POST['required_density'] ?? ''); + $hardness = trim($_POST['required_hardness_shore_a'] ?? ''); + $lub_type = ($_POST['lubrication_type'] ?? '') !== '' ? $_POST['lubrication_type'] : null; + $lub_note = trim($_POST['lubrication_notes'] ?? ''); $pdo->beginTransaction(); @@ -267,6 +266,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj "); $stmt->execute([ $idmescola, + $mix_weight, + $support_weight, $density !== '' ? $density : null, $hardness !== '' ? $hardness : null, $lub_type, @@ -293,8 +294,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj $stmt = $pdo->prepare(" INSERT INTO work_sheet_mescole ( - worksheet_id, idmescola, mix_position, mix_weight_g_m, - support_weight_g_m, + worksheet_id, idmescola, mix_position, + mix_weight_g_m, support_weight_g_m, required_density, required_hardness_shore_a, lubrication_type, lubrication_notes )