'That reply no longer exists.']); exit; } $ticket_reply_type = escapeHtml($row['ticket_reply_type']); $ticket_reply_time_worked = date_create($row['ticket_reply_time_worked']); $ticket_reply_time_worked_formatted = date_format($ticket_reply_time_worked, 'H:i:s'); $ticket_reply = escapeHtml($row['ticket_reply']); $client_id = intval($row['ticket_client_id']); if ($client_id) { enforceClientAccess(); } // Who it was emailed to - they have it as it was sent $emailed_to = ''; if (intval($row['ticket_reply_emailed']) === 1) { $emailed_names = array_map(function ($recipient) { return (string) (($recipient['name'] ?? '') !== '' ? $recipient['name'] : ($recipient['email'] ?? '')); }, (array) json_decode((string) $row['ticket_reply_emailed_to'], true)); $emailed_names = array_values(array_filter($emailed_names)); $emailed_to = $emailed_names ? $emailed_names[0] . (count($emailed_names) > 1 ? ' and ' . (count($emailed_names) - 1) . ' more' : '') : 'the client'; } // Generate the HTML form content using output buffering. ob_start(); ?>