@extends('backend.layouts.app')
@section('title', @$data['title'])

@section('content')
    {!! breadcrumb([
        'title' => @$data['title'],
        route('admin.dashboard') => _trans('common.Dashboard'),
        '#' => @$data['title'],
    ]) !!}

    <div class="card ot-card">
        <div class="card-body">

            <div class="d-flex align-items-center justify-content-between gap-2 mb-3">
                @if (env('TRAVEL'))
                    <h3 class="mb-0">{{ _trans('Daily Work Report') }} #{{ $data['travelWorkflow']->id }}</h3>
                @else
                    <h3 class="mb-0">{{ _trans('Travel Workflow') }} #{{ $data['travelWorkflow']->id }}</h3>
                @endif
                
                @if ($data['travelWorkflow']->file_id)
                    <a href="{{ uploaded_asset($data['travelWorkflow']->file_id) }}" download class="btn btn-primary btn-sm">
                        <i class="fas fa-download"></i>
                    </a>
                @else
                    {{ _trans('common.No File') }}
                @endif
            </div>

            <div class="row">
                <div class="col-lg-6">
                    <table class="table table-striped table-borderless w-100">
                        <tr>
                            <th class="w-50">{{ _trans('common.Employee Name') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->employee->name }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Department') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->employee->department->title }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Designation') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->employee->designation->title }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Email') }}</th>
                            <td class="w-50">: <a href="mailto:{{ $data['travelWorkflow']->employee->email }}">{{ $data['travelWorkflow']->employee->email }}</a></td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Phone') }}</th>
                            <td class="w-50">: <a href="tel:{{ $data['travelWorkflow']->employee->phone }}">{{ $data['travelWorkflow']->employee->phone }}</a></td>
                        </tr>
                    </table>
                </div>
                <div class="col-lg-6">
                    <table class="table table-striped table-borderless w-100">
                        <tr>
                            <th class="w-50">{{ _trans('common.Date') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->date }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Start Time') }}</th>
                            <td class="w-50">: {{ date('h:i A', strtotime($data['travelWorkflow']->start_time)) }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Calls Made') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->calls_made }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Positive Leads') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->positive_leads }}</td>
                        </tr>
                        <tr>
                            <th class="w-50">{{ _trans('common.Total Sales') }}</th>
                            <td class="w-50">: {{ $data['travelWorkflow']->total_sales }}</td>
                        </tr>
                    </table>
                </div>
            </div>

            <small class="text-muted mb-3">{{ _trans('common.Did you update your pending and leads?') }}</small>
            <p class="mb-3">
                @if ($data['travelWorkflow']->is_update_pending_and_leads == 'Other')
                    {{ $data['travelWorkflow']->pending_and_leads_other_note }} 
                @else
                    {{ $data['travelWorkflow']->is_update_pending_and_leads }}
                @endif
            </p>

            <small class="text-muted mb-3">{{ _trans('common.Did you worked on recovery today?') }}</small>
            <p class="mb-3">
                @if ($data['travelWorkflow']->is_worked_on_recovery_today == 'Other')
                    {{ $data['travelWorkflow']->recovery_today_other_note }} 
                @else
                    {{ $data['travelWorkflow']->is_worked_on_recovery_today }}
                @endif
            </p>

            <small class="text-muted mb-3">{{ _trans('common.Daily Report Summary') }}: </small>
            <p class="mb-3">{!! nl2br($data['travelWorkflow']->daily_report_summary) !!}</p>

            <small class="text-muted mb-3">{{ _trans('common.Complaints, Questions, Comments') }}: </small>
            <p class="mb-3">{!! nl2br($data['travelWorkflow']->complaints_questions_comments) !!}</p>

            <div class="d-flex flex-column">
                <small class="text-muted">{{ _trans('common.How was your day') }}</small>
                <span>{{ $data['travelWorkflow']->how_was_your_day_mark }} {{ _trans('common.out of 10') }}</span>
            </div>
        </div>
    </div>
@endsection
