<div class="p-5">
    <center>

        <h3>Núcleo Académico Básico (NAB)</h3>
        <br>
        <div class="">
            <div class="col-lg-10 col-md-10 offset-lg-1">
                <table class="table">
                    <thead>
                        <tr>
                            <th scope="col">Nombre</th>
                            <th scope="col">Grado</th>
                            <th scope="col">Perfil</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($personal as $per)
                            <tr>
                                <td>{{ ucwords(mb_strtolower($per->nombre . ' ' . $per->apellido_paterno . ' ' . $per->apellido_materno)) }}
                                </td>
                                <td>
                                    @if ($per->sexo == 'F')
                                        {{ $per->grado_femenino }}
                                    @else
                                        @if ($per->sexo == 'M')
                                            {{ $per->grado_masculino }}
                                        @endif
                                    @endif
                                </td>
                                <?php $lineas = '<ul>'; ?>

                                @foreach ($per->personalLinea as $profe)
                                    <?php $lineas .= '<li>' . $profe->linea->linea . '</li>'; ?>
                                @endforeach
                                <?php
                                $cvu = '';
                                if ($per->docenteCVU != null) {
                                    $cvu = '<a href="https://depi.zitacuaro.tecnm.mx/pdf/cvu/' . $per->docenteCVU->cvu . '" target="_blank" class="btn btn-primary" style="width: 100%;" rel="noopener noreferrer">Curriculum Vitae Único</a>';
                                }
                                
                                $auxImg = "https://poa.zitacuaro.tecnm.mx/laravel/public/perfiles/$per->imagen";
                                $imagen = '<div class="text-center"><img src="' . $auxImg . '" width="70%" height="70%" alt="En este momento no esta disponible."></div><br><br> Correo electronico: ' . $per->correo . '<br><br> Líneas de Investigación <br>' . $lineas . '</ul><br>' . $cvu;
                                ?>
                                <img src="" width="100px" alt="">
                                <td><button type="button" class="btn btn-outline-primary"
                                        onclick="modalConfirmacion2('Información del Docente','{{ $imagen }}','');">Ver
                                    </button></td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </center>
</div>

<!-- Modal -->
<div class="modal fade" id="myModalHtml" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title text-dark" id="myModalTitulo">Modal title</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" id="myModalContenido">
                ...
            </div>
            <div class="modal-footer align-self-center" id="myModalFooder">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div>
        </div>
    </div>
</div>
