@extends('layouts.app', ['title' => __tr('Campaign Status')]) @section('content') @include('users.partials.header', [ 'title' => __tr('Campaign Report'), 'description' => '', 'class' => 'col-lg-7' ]) @php $campaignData = $campaign->__data; $selectedGroups = Arr::get($campaignData, 'selected_groups', []); $isRestrictByTemplateContactLanguage = Arr::get($campaignData, 'is_for_template_language_only'); $isAllContacts = Arr::get($campaignData, 'is_all_contacts'); $messageLog = $campaign->messageLog; $queueMessages = $campaign->queueMessages; @endphp
{{ __tr('Campaign Name') }}
{{ $campaign->title }}

{{ __tr('Execution Schedule') }}

{{ formatDiffForHumans($campaign->scheduled_at, 3) }}
@if ($campaign->timezone and getVendorSettings('timezone') != $campaign->timezone)
{!! __tr('__scheduledAt__ as per your account timezone which is __selectedTimezone__', [ '__scheduledAt__' => formatDateTime($campaign->scheduled_at), '__selectedTimezone__' => ''. getVendorSettings('timezone') .'' ]) !!}
{!! __tr('Campaign scheduled on __scheduledAt__ as per the __selectedTimezone__ timezone', [ '__scheduledAt__' => formatDateTime($campaign->scheduled_at_by_timezone, null, null, $campaign->timezone), '__selectedTimezone__' => ''. $campaign->timezone .'' ]) !!}
@else {{ formatDateTime($campaign->scheduled_at) }} @endif

{{ __tr('template Name') }}
{{ $campaign->template_name }}
{{ __tr('template language') }}
{{ $campaign->template_language }}
{{-- total contacts --}}
{{ __tr('Total Contacts') }}

@if ($isAllContacts) {{ __tr('All contacts ') }} @else {{ __tr('All contacts from: ') }} @foreach ($selectedGroups as $selectedGroup) {{ $selectedGroup['title'] }} @endforeach {{ __tr(' groups.') }} @endif @if ($isRestrictByTemplateContactLanguage) {!! __tr('Excluding those contacts which don\'t have __languageCode__ language', [ '__languageCode__' => "". e($campaign->template_language) ."" ]) !!} @endif

{{-- /total contacts --}} {{-- delivered to --}}
{{ __tr('Total Delivered') }}

{{ __tr('Contacts') }}

{{-- /delivered to --}} {{-- read by --}}
{{ __tr('Total Read') }}

{{ __tr('Contacts') }}

{{-- /read by --}} {{-- failed --}}
{{ __tr('Total Failed') }}

{{ __tr('Contacts') }}

{{-- /failed --}}
{{-- message log --}}

{{ __tr('Executed Log') }}

{{ __tr('Name') }} {{ __tr('Phone Number') }} {{ __tr('Status') }} {{ __tr('Message Delivered at') }} {{ __tr('Last Status Updated at') }}
{{-- /message log --}} {{-- message error log --}}

{{ __tr('Queue Log') }}

{{ __tr('Name') }} {{ __tr('Phone Number') }} {{ __tr('Last Status Updated at') }} {{ __tr('Messages') }}
{{-- /message error log --}}
@php $totalContacts = (int) Arr::get($campaignData, 'total_contacts'); $totalRead = $messageLog->where('status', 'read')->count(); $totalReadInPercent = round($totalRead / $totalContacts * 100, 2) . '%'; $totalDelivered = $messageLog->where('status', 'delivered')->count(); $totalDeliveredInPercent = round(($totalDelivered + $totalRead) / $totalContacts * 100, 2) . '%'; $totalFailed = $queueMessages->where('status', 2)->count() + $messageLog->where('status', 'failed')->count(); $totalFailedInPercent = round($totalFailed / $totalContacts * 100, 2) . '%'; @endphp @endsection()