fixed nuovo

This commit is contained in:
2026-09-07 15:02:36 +02:00
parent 8425a7d90c
commit c394d92ef3
16 changed files with 2629 additions and 70 deletions
+6 -3
View File
@@ -12,6 +12,9 @@ try {
$brand = $_POST['brand'] ?? '';
$status = $_POST['status'] ?? 'active';
$color = $_POST['color'] ?? '#dc2626';
$maxHours = isset($_POST['max_hours_per_day']) ? (float)$_POST['max_hours_per_day'] : 24;
if ($maxHours < 0) $maxHours = 0;
if ($maxHours > 24) $maxHours = 24;
if (!$lineNumber || !$name) {
echo json_encode(['success' => false, 'message' => 'Numero linea e nome sono obbligatori.']);
@@ -19,10 +22,10 @@ try {
}
$stmt = $pdo->prepare("
INSERT INTO production_lines (line_number, name, model, brand, status, color)
VALUES (?, ?, ?, ?, ?, ?)
INSERT INTO production_lines (line_number, name, model, brand, status, color, max_hours_per_day)
VALUES (?, ?, ?, ?, ?, ?, ?)
");
$stmt->execute([$lineNumber, $name, $model, $brand, $status, $color]);
$stmt->execute([$lineNumber, $name, $model, $brand, $status, $color, $maxHours]);
echo json_encode(['success' => true]);
} catch (Exception $e) {