added drag and photos
This commit is contained in:
@@ -7,19 +7,22 @@ try {
|
||||
$pdo = $db->getConnection();
|
||||
|
||||
$lineNumber = $_POST['lineNumber'] ?? null;
|
||||
$name = $_POST['lineName'] ?? '';
|
||||
$model = $_POST['model'] ?? '';
|
||||
$brand = $_POST['brand'] ?? '';
|
||||
$status = $_POST['status'] ?? 'active';
|
||||
$name = $_POST['lineName'] ?? '';
|
||||
$model = $_POST['model'] ?? '';
|
||||
$brand = $_POST['brand'] ?? '';
|
||||
$status = $_POST['status'] ?? 'active';
|
||||
$color = $_POST['color'] ?? '#dc2626';
|
||||
|
||||
if (!$lineNumber || !$name) {
|
||||
echo json_encode(['success' => false, 'message' => 'Numero linea e nome sono obbligatori.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare("INSERT INTO production_lines (line_number, name, model, brand, status)
|
||||
VALUES (?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$lineNumber, $name, $model, $brand, $status]);
|
||||
$stmt = $pdo->prepare("
|
||||
INSERT INTO production_lines (line_number, name, model, brand, status, color)
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
");
|
||||
$stmt->execute([$lineNumber, $name, $model, $brand, $status, $color]);
|
||||
|
||||
echo json_encode(['success' => true]);
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user