Seseorang telah mengajukan penawaran untuk produk di website Anda.
@php // Parse message untuk request type dan addons $raw = $inquiry->message ?? ''; $lines = preg_split("/(\r\n|\n|\r)/", $raw); $type = null; $addons = []; $hasAddonsLine = false; if (!empty($lines)) { $first = $lines[0] ?? ''; $second = $lines[1] ?? ''; if (substr($first, 0, 14) === '[REQUEST_TYPE]') { $type = trim(substr($first, 14)); } if (substr($second, 0, 8) === '[ADDONS]') { $hasAddonsLine = true; $matches = []; if (preg_match('/^\[ADDONS\]\s*(\[[\s\S]*\])$/', $second, $matches)) { $decoded = json_decode($matches[1], true); if (is_array($decoded)) { $addons = $decoded; } } } } $startIdx = 0; if ($type) { $startIdx++; } if ($hasAddonsLine) { $startIdx++; } if (!empty($lines) && isset($lines[$startIdx]) && trim($lines[$startIdx]) === '') { $startIdx++; } $plainMessage = implode("\n", array_slice($lines, $startIdx)); $typeLabel = $type === 'custom_addon' ? 'Custom Add-on' : ($type === 'custom_new' ? 'Custom Baru' : ($type === 'template' ? 'Katalog' : null)); $typeClass = $type === 'custom_addon' ? 'custom-addon' : ($type === 'custom_new' ? 'custom-new' : 'katalog'); @endphp| Nama | Nilai |
|---|---|
| {{ is_array($addon) ? ($addon['name'] ?? '-') : '-' }} | {{ is_array($addon) ? ($addon['value'] ?? '-') : '-' }} |