From 98f4f004ed25237bae79845ce59719b5270ffa44 Mon Sep 17 00:00:00 2001 From: solocla Date: Fri, 23 Oct 2026 20:21:11 +0200 Subject: [PATCH] added scorta to mescola --- ...d_support_weight_to_work_sheet_mescole.php | 22 +++++++++++++++++ public/userarea/manage-worksheet.php | 24 +++++++++++++++---- public/userarea/worksheets.php | 7 ++++-- 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php diff --git a/db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php b/db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php new file mode 100644 index 00000000..40749cd5 --- /dev/null +++ b/db/migrations/20261023181637_add_support_weight_to_work_sheet_mescole.php @@ -0,0 +1,22 @@ +table('work_sheet_mescole') + ->addColumn('support_weight_g_m', 'decimal', [ + 'precision' => 10, + 'scale' => 2, + 'null' => true, + 'default' => null, + 'after' => 'mix_weight_g_m', + 'comment' => 'Peso metro sostegno mescola (g/m)', + ]) + ->update(); + } +} diff --git a/public/userarea/manage-worksheet.php b/public/userarea/manage-worksheet.php index bf4fae8b..c91b070f 100644 --- a/public/userarea/manage-worksheet.php +++ b/public/userarea/manage-worksheet.php @@ -242,6 +242,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj if ($pos <= 0) $pos = 1; $mix_weight = $_POST['mix_weight_g_m'] !== '' ? (float)$_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'] ?? ''); @@ -255,6 +258,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj UPDATE work_sheet_mescole SET idmescola = ?, mix_weight_g_m = ?, + support_weight_g_m = ?, required_density = ?, required_hardness_shore_a = ?, lubrication_type = ?, @@ -263,7 +267,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj "); $stmt->execute([ $idmescola, - $mix_weight, $density !== '' ? $density : null, $hardness !== '' ? $hardness : null, $lub_type, @@ -291,16 +294,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj INSERT INTO work_sheet_mescole ( worksheet_id, idmescola, mix_position, mix_weight_g_m, + support_weight_g_m, required_density, required_hardness_shore_a, lubrication_type, lubrication_notes ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) "); $stmt->execute([ $worksheet_id, $idmescola, $pos, $mix_weight, + $support_weight, $density !== '' ? $density : null, $hardness !== '' ? $hardness : null, $lub_type, @@ -1389,6 +1394,7 @@ $isEdit = ($worksheet_id > 0); Pos Mescola Peso (g/m) + Sostegno (g/m) Densità Durezza Lubr. @@ -1406,6 +1412,7 @@ $isEdit = ($worksheet_id > 0); + @@ -1456,7 +1463,7 @@ $isEdit = ($worksheet_id > 0);
-
+
-
+
+
+ + +
+
@@ -1708,6 +1720,7 @@ $isEdit = ($worksheet_id > 0); $('#idmescola').val(row.idmescola).trigger('change'); $('#mix_weight_g_m').val(row.mix_weight_g_m ?? ''); + $('#support_weight_g_m').val(row.support_weight_g_m ?? ''); $('#required_density').val(row.required_density ?? ''); $('#required_hardness_shore_a').val(row.required_hardness_shore_a ?? ''); $('#lubrication_type').val(row.lubrication_type ?? ''); @@ -1961,6 +1974,7 @@ $isEdit = ($worksheet_id > 0); '
' + nome + '
' + '
dal file: ' + (m.raw || '') + '
' + '' + (m.mix_weight_g_m ?? '-') + '' + + '' + (m.support_weight_g_m ?? '-') + '' + '' + (m.required_density ?? '-') + '' + '' + (m.required_hardness_shore_a ?? '-') + '' + '' + (m.lubrication_type ?? '-') + '' + @@ -2063,6 +2077,7 @@ $isEdit = ($worksheet_id > 0); worksheet_id: newId, idmescola: m.idmescola, mix_weight_g_m: m.mix_weight_g_m ?? '', + support_weight_g_m: m.support_weight_g_m ?? '', required_density: m.required_density ?? '', required_hardness_shore_a: m.required_hardness_shore_a ?? '', lubrication_type: m.lubrication_type ?? '', @@ -2110,6 +2125,7 @@ $isEdit = ($worksheet_id > 0); $('#mixRowId').val(0); $('#mixWorksheetId').val(newId); $('#mix_weight_g_m').val(m.mix_weight_g_m ?? ''); + $('#support_weight_g_m').val(m.support_weight_g_m ?? ''); $('#required_density').val(m.required_density ?? ''); $('#required_hardness_shore_a').val(m.required_hardness_shore_a ?? ''); $('#lubrication_type').val(m.lubrication_type ?? ''); diff --git a/public/userarea/worksheets.php b/public/userarea/worksheets.php index f2559622..25d57590 100644 --- a/public/userarea/worksheets.php +++ b/public/userarea/worksheets.php @@ -204,12 +204,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj $newWorksheetId = (int)$pdo->lastInsertId(); - // Duplica le mescole collegate + // Duplica le mescole collegate $stmtMixes = $pdo->prepare(" SELECT idmescola, mix_position, mix_weight_g_m, + support_weight_g_m, required_density, required_hardness_shore_a, lubrication_type, @@ -228,11 +229,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj idmescola, mix_position, mix_weight_g_m, + support_weight_g_m, required_density, required_hardness_shore_a, lubrication_type, lubrication_notes - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) "); foreach ($mixRows as $mix) { @@ -241,6 +243,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['ajax']) && $_POST['aj $mix['idmescola'], $mix['mix_position'], $mix['mix_weight_g_m'], + $mix['support_weight_g_m'], $mix['required_density'], $mix['required_hardness_shore_a'], $mix['lubrication_type'],