id"); $markUsed->execute([':id' => (int) $row['id']]); return true; } function dsa_build_order_timeline(array $order): array { $status = (string) ($order['status'] ?? 'pending_payment'); $hasProof = trim((string) ($order['payment_proof_path'] ?? '')) !== '' || trim((string) ($order['payment_ref'] ?? '')) !== ''; return [ ['label' => 'Order received', 'done' => true], ['label' => 'Payment proof submitted', 'done' => $hasProof || in_array($status, ['paid', 'fulfilled'], true)], ['label' => 'Payment approved', 'done' => in_array($status, ['paid', 'fulfilled'], true)], ['label' => 'Order fulfilled', 'done' => $status === 'fulfilled'], ]; }