false, 'ERROR' => 'missing_businessid', 'MESSAGE' => 'BusinessID is required.']); } if ($stationId <= 0) { apiAbort(['OK' => false, 'ERROR' => 'missing_stationid', 'MESSAGE' => 'StationID is required.']); } try { queryTimed("UPDATE Stations SET IsActive = 0 WHERE ID = ? AND BusinessID = ?", [$stationId, $bizId]); queryTimed("UPDATE Items SET StationID = 0 WHERE StationID = ? AND BusinessID = ?", [$stationId, $bizId]); jsonResponse(['OK' => true, 'ERROR' => '', 'StationID' => $stationId]); } catch (Exception $e) { jsonResponse(['OK' => false, 'ERROR' => 'server_error', 'MESSAGE' => 'Failed to delete station', 'DETAIL' => $e->getMessage()]); }