{foreach from=$all_messages item=one_message}
    {if $one_message.type eq "text"}
        {$one_message.client_id}
        <div id="lv_mess{$one_message.id}" class="livechat_one_message_block" {if $one_message.forward eq "to_client"}data-author="manager"{else}data-author="client"{/if}>
            {if $one_message.type eq "text"}
                {if $one_message.forward eq "to_client"}
                    <span class="livechat_manager_name">{$one_message.manager_fio} ({$one_message.date_prinable})</span>
                    <div class="message__time">{$one_message.manager_fio}, {$one_message.date_prinable}</div>
                    <div class="livechat_manager_text">{$one_message.message}</div>
                {else}
                    <span class="livechat_client_name">{$one_message.client_fio} ({$one_message.date_prinable})</span>
                    <div class="message__time">{$one_message.client_fio}, {$one_message.date_prinable}</div>
                    <div class="livechat_client_text">{$one_message.message}</div>
                {/if}
            {else}
                <div class="livechat_manager_status">{$one_message.date_prinable} {$one_message.message}</div>
            {/if}
        </div>
    {/if}
{/foreach}