@extends('layouts.app') @section('title', __('crm::lang.crm')) @section('content') @include('crm::layouts.nav')
@if (auth()->user()->can('crm.access_all_schedule') || auth()->user()->can('crm.access_own_schedule'))
@component('components.static', [ 'svg_bg' => 'tw-bg-cyan-400', 'svg_text' => 'tw-text-white', 'svg' => '', ])

{{ __('crm::lang.todays_followups') }}

{{ $todays_followups }}

@endcomponent
@endif @if (auth()->user()->can('crm.access_all_leads') || auth()->user()->can('crm.access_own_leads'))
@component('components.static', [ 'svg_bg' => 'tw-bg-cyan-400', 'svg_text' => 'tw-text-white', 'svg' => '', ])

{{ __('crm::lang.my_leads') }}

{{ $my_leads }}

@endcomponent
@endif
@component('components.static', [ 'svg_bg' => 'tw-bg-cyan-400', 'svg_text' => 'tw-text-white', 'svg' => '', ])

{{ __('crm::lang.my_leads_to_customer_conversion') }}

{{ $my_conversion }}

@endcomponent
@if (auth()->user()->can('crm.access_all_schedule') || auth()->user()->can('crm.access_own_schedule'))
@component('components.widget', ['class' => 'box-solid', 'title' => __('crm::lang.my_followups')]) @foreach ($statuses as $key => $value) @endforeach @if (isset($my_follow_ups_arr['__other'])) @endif
{{ $value }} @if (isset($my_follow_ups_arr[$key])) {{ $my_follow_ups_arr[$key] }} @else 0 @endif
@lang('lang_v1.others') {{ $my_follow_ups_arr['__other'] }}
@endcomponent
@endif @if (config('constants.enable_crm_call_log'))
@component('components.widget', ['class' => 'box-solid', 'title' => __('crm::lang.my_call_logs')])
@lang('crm::lang.calls_today') {{ $my_call_logs->calls_today ?? 0 }}
@lang('crm::lang.calls_yesterday') {{ $my_call_logs->calls_yesterday ?? 0 }}
@lang('crm::lang.calls_this_month') {{ $my_call_logs->calls_this_month ?? 0 }}
@endcomponent
@endif
@if ($is_admin)
@component('components.static', [ 'svg_bg' => 'tw-bg-cyan-400', 'svg_text' => 'tw-text-white', 'svg' => '', ])

{{ __('lang_v1.customers') }}

{{ $total_customers }}

@endcomponent
@component('components.static', [ 'svg_bg' => 'tw-bg-cyan-400', 'svg_text' => 'tw-text-white', 'svg' => ''] , )

{{ __('crm::lang.leads') }}

{{ $total_leads }}

@endcomponent
@component('components.static', [ 'svg_bg' => 'tw-bg-yellow-400', 'svg_text' => 'tw-text-white', 'svg' => '', ])

{{ __('crm::lang.sources') }}

{{ $total_sources }}

@endcomponent
@component('components.static', [ 'svg_bg' => 'tw-bg-yellow-400', 'svg_text' => 'tw-text-white', 'svg' => '', ])

{{ __('crm::lang.life_stages') }}

{{ $total_life_stage }}

@endcomponent
@component('components.widget', ['class' => 'box-solid']) @forelse($sources as $source) @empty @endforelse
{{ __('crm::lang.sources') }} {{ __('sale.total') }} {{ __('crm::lang.conversion') }}
{{ $source->name }} @if (!empty($leads_count_by_source[$source->id])) {{ $leads_count_by_source[$source->id]['count'] }} @else 0 @endif @if (!empty($customers_count_by_source[$source->id]) && !empty($contacts_count_by_source[$source->id])) @php $conversion = ($customers_count_by_source[$source->id]['count'] / $contacts_count_by_source[$source->id]['count']) * 100; @endphp {{ $conversion . '%' }} @else {{ '0 %' }} @endif
@lang('lang_v1.no_data')
@endcomponent
@component('components.widget', ['class' => 'box-solid']) @forelse($life_stages as $life_stage) @empty @endforelse
{{ __('crm::lang.life_stages') }} {{ __('sale.total') }}
{{ $life_stage->name }} @if (!empty($leads_by_life_stage[$life_stage->id])) {{ count($leads_by_life_stage[$life_stage->id]) }} @else 0 @endif
@lang('lang_v1.no_data')
@endcomponent
@component('components.widget', ['class' => 'box-solid'])

@lang('crm::lang.birthdays')

@lang('crm::lang.send_wishes')
@forelse($todays_birthdays as $key => $birthday) @empty @endforelse
@lang('home.today')
# @lang('user.name')
@lang('lang_v1.no_data')
@if (!empty($upcoming_birthdays))
@endif @forelse($upcoming_birthdays as $key => $birthday) @empty @endforelse
@lang('crm::lang.upcoming')
# @lang('user.name') @lang('crm::lang.birthday_on')
{{ Carbon::createFromFormat('m-d', $birthday['dob'])->format('jS M') }}
@lang('lang_v1.no_data')
@endcomponent

@component('components.widget', ['class' => 'box-solid', 'title' => __('crm::lang.follow_ups_by_user')])
{!! Form::label('follow_up_user_date_range', __('report.date_range') . ':') !!} {!! Form::text('follow_up_user_date_range', null, [ 'placeholder' => __('lang_v1.select_a_date_range'), 'class' => 'form-control', 'readonly', ]) !!}
{!! Form::label('followup_category_id', __('crm::lang.followup_category') . ':*') !!} {!! Form::select('followup_category_id', $followup_category, null, [ 'class' => 'form-control select2', 'style' => 'width: 100%;', 'placeholder' => __('messages.all'), ]) !!}

@foreach ($statuses as $key => $value) @endforeach
@lang('role.user') {{ $value }} @lang('lang_v1.none') @lang('crm::lang.total_follow_ups')
@endcomponent
@component('components.widget', ['class' => 'box-solid', 'title' => __('crm::lang.lead_to_customer_conversion')])
  @lang('crm::lang.converted_by') @lang('sale.total')
@endcomponent
@if (config('constants.enable_crm_call_log'))

@lang('crm::lang.all_users_call_log')

@lang('role.user') @lang('crm::lang.calls_today') @lang('crm::lang.calls_this_month') @lang('lang_v1.all')
@endif
@endif
@endsection @section('css') @stop @section('javascript') @include('crm::reports.report_javascripts') @endsection