<!DOCTYPE html>
<html lang="en">
<?php $mes = date('d/m/Y');
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=InformeKyocerafecha$mes.xls");
header("Pragma: no-cache");
header("Expires: 0");  ?>
<body>
    <table class="table table-bordered table-responsive-lg table-striped table-hover" style="margin: 0" id="gridData">
        <!-- ENCABEZADO -->
        <thead>
            <tr>
                <th>
                    <h3>Fecha instalaci&oacute;n</h3>
                </th>
                <th>
                    <h3>Cliente</h3>
                </th>
                <th>
                    <h3>Regi&oacute;n</h3>
                </th>
                <th>
                    <h3>Comuna</h3>
                </th>
                <th>
                    <h3>Direcci&oacute;n</h3>
                </th>
                <th>
                    <h3>CUI</h3>
                </th>
                <th>
                    <h3>Serie</h3>
                </th>
                <th>
                    <h3>Estado</h3>
                </th>
                <th>
                    <h3>Serie Saliente</h3>
                </th>
                <th>
                    <h3>Modelo Saliente</h3>
                </th>
                <th>
                    <h3>Marca Saliente</h3>
                </th>
            </tr>
        </thead>
        <!-- FIN ENCABEZADO -->
        <!-- RESULTADOS -->
        <tbody>
            @if(!empty($rutapdf))
            @foreach ($rutapdf as $datos)
            <tr>
                <td>{{Carbon\Carbon::createFromDate($datos->fecha_instalacion_coordinadora)->format('d-m-Y')}}</td>
                <td>{{$datos->sCliente}}</td>
                <td>{{$datos->sRegion}}</td>
                <td>{{$datos->sComuna}}</td>
                <td>{{$datos->sDireccion}}</td>
                <td>{{$datos->sCui}}</td>
                <td>{{$datos->sSerie}}</td>
                <td>{{$datos->sEstado_instalacion}}</td>
                <!-- EQQUIPO SALIENTE-->
                @php
                    $checklist = DB::table('checklist_instalacions')
                    ->select('checklist_instalacions.CsMarca_es','checklist_instalacions.CsSerie_es','checklist_instalacions.CsModelo_es')
                    ->where('checklist_instalacions.asignacion_instalacion_retiro_id','=',$datos->id_asig)
                    //->orderBy('')
                    ->get();
                @endphp
                <td>{{$checklist[0]->CsSerie_es}}</td>
                <td>{{$checklist[0]->CsModelo_es}}</td>
                <td>{{$checklist[0]->CsMarca_es}}</td>
            </tr>
            @endforeach
            @endif
        </tbody>
        <!-- FIN RESULTADOS -->
    </table>
</body>
</html>