<table>
    <thead>
        <tr>

            <th style="width: 15px;">
                <img class="escudo" src="{{public_path('assets/img/escudo.png')}}" height='100cm' width="10cm"
                    left="30px">
            </th>
            <th colspan="6" style="text-align: center; vertical-align: center; font-weight: bold; font-size: 14pt">
                ALCALDÍA DE UBATÉ<br>Sistema de Información de Ventanilla Única<br>Reporte Detallado<br>COMUNICACIONES OFICIALES {{date('Y')}}
            </th>
            <th style="width: 15px;">
                <img class="escudo" src="{{public_path('assets/img/photo.png')}}" height='100cm' width="10cm"
                    left="30px">
            </th>
        </tr>

        <tr>
            <th style="width: 15px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                CODIGO
            </th>
            <th style="width: 20px; text-align: center; font-weight: bold ; border: 1px, solid black; background: #009045; color:#fffff">
                FECHA Y HORA
            </th>
            <th style="width: 40px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                REMITENTE
            </th>
            <th style="width: 40px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                ASUNTO
            </th>
            <th style="width: 25px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                DEPENDENCIA
            </th>
            <th style="width: 30px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                TIPO RADICADO
            </th>
            <th style="width: 15px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                ESTADO
            </th>
            <th style="width: 25px; text-align: center; font-weight: bold; border: 1px, solid black; background: #009045; color:#fffff">
                FECHA ULTIMA ACTUACIÓN
            </th>
        </tr>
    </thead>
    <tbody>
        {{-- <tr>
                <td>
                    {{count($rads)}}
        </td>
        </tr> --}}
        @foreach ($rads as $r)
        <tr>
            <td class="codigo" style="border: 1px, solid black">
                {{$r->codigo}}
            </td>
            <td style="max-width: 2cm!important; border: 1px, solid black">
                {{date('d-m-Y H:m', strtotime($r->created_at))}}
            </td>
            <td style="max-width: 2cm!important; vertical-align: justify; border: 1px, solid black">
                {{$r->solicitantes[0]->nombres}}&nbsp;{{$r->solicitantes[0]->apellidos}}
            </td>
            <td style="max-width: 4cm!important; vertical-align: justify; border: 1px, solid black">
                {{$r->asunto}}
            </td>
            <td style="max-width: 2cm!important; vertical-align: justify; border: 1px, solid black">
                {{$r->area->nombre}}
            </td>
            <td style="max-width: 2cm!important; border: 1px, solid black">
                {{$r->TipoRadicado->nombre}}
            </td>
            <td style="max-width: 2cm!important; border: 1px, solid black">
                {{$r->estado->nombre}}
            </td>
            <td style="max-width: 2cm!important; border: 1px, solid black">
                @if($r->UltimoTramite != null)
                {{date('d-m-Y H:m', strtotime($r->UltimoTramite->created_at))}}
                @endif
            </td>
        </tr>
        @endforeach
    </tbody>
    <tfoot>
        <tr>
            <th>

            </th>
        </tr>
        <tr>
            <th colspan="2" style="font-weight: bold">
                Fecha Generacion: {{date('d-m-Y H:m')}}
            </th>
            <th>

            </th>
            <th style="font-weight: bold">
                Usuario que genera: {{Auth::user()->name}}
            </th>
        </tr>
    </tfoot>
</table>