<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Certificado laboral</title>
    <link rel="stylesheet" type="text/css" href="{{asset('assets/css/fontawesome.min.css')}}">
    <link rel="stylesheet" href="{{asset('assets/css/cv_employee_pdf.css')}}">
    <link rel="stylesheet" href="{{asset('assets/css/general_pdf.css')}}">
</head>
<body>
    <section>
        <p class="f-right">{{$info['city_name']}}, {{ \Carbon\Carbon::parse($info['solicitation_date'])->day }} de
        {{ \Carbon\Carbon::parse($info['solicitation_date'])->monthName }} de {{ \Carbon\Carbon::parse($info['solicitation_date'])->year }}</p>
        <h3 class="text-center m-t-100">CERTIFICADO LABORAL</h3>
        <p class="m-t-30">{{ Request_to_Default($info['requested_to']) }}</p>
        <p class="m-t-40">Que {{ $info['prefix'] }} {{ $info['first_name'] }} {{ $info['last_name'] }}
            identificado con {{ $info['document_type_name'] }} número {{ $info['document_number'] }}
            expedido en {{ $info['document_expedition'] }}, por el presente certifica que labora en la
            empresa {{ $info['company_name'] }}, y registra las siguientes vinculaciones:</p>

            @foreach($info_contract as $contract)
        <table cellpadding="0" cellspacing="0" width="100%" class="m-t-30 table-border page-break-avoid">
            <tbody>
                <tr>
                    <td colspan="2" class="semi-bold p-l-10 p-t-10 p-r-10">{{ DataTypeContract($contract->type) }}</th>
                </tr>
                <tr>
                    <td colspan="{{ $info['salary_include'] == 1 ? 1 : 2  }}" class="p-l-10"><p class="semi-bold m-b-0">Cargo</p>
                        {{ $contract->job_position }}
                    </td>
                    @if ($info['salary_include'] == 1)
                    <td><p class="semi-bold m-b-0 p-r-10">Asignación salarial</p>
                        ${{ number_format($contract->salary, 2, '.', ',') }}
                    </td>
                    @endif
                </tr>
                <tr>
                    <td class="p-l-10 p-b-10">
                        <p class="semi-bold m-b-0">Fecha de ingreso</p>
                        {{ \Carbon\Carbon::parse($contract->start_date)->format('d/m/Y') }}
                    </td>
                    <td class="p-1-10 p-b-10">
                        <p class="semi-bold m-b-0">Fecha de salida</p>
                    @if ($contract->end_date == null)
                        No definida
                    @elseif ($contract->end_date > \Carbon\Carbon::now())
                        Actualmente trabajando
                    @else
                        {{ \Carbon\Carbon::parse($contract->end_date)->format('d/m/Y') }}
                    @endif
                    </td>
                </tr>
            </tbody>
    </table>
    @endforeach
    </section>
    <section class="position-absolute bottom-2cm">
        <p>Atentamente,</p>
        <img src="{{ asset('storage/users/'.$info['reviewed_id'].'/signature/'.$info['reviewed_signature']) }}" alt="Firma" class="m-t-0 max-h-100">
        <p class="m-t-0 m-b-0">{{ $info['reviewed_name'] }}</p>
        <p class="m-b-0 m-t-5">{{ $info['reviewed_document_type_name'] }} {{ $info['reviewed_document_number'] }}</p>
        <p class="m-b-0 m-t-5 semi-bold">{{ $info['reviewed_position'] }}</p>
    </section>
</body>
</html>
