<div class="">
    <div class="page-title">
        <div class="title_left">
            <h3>Temario</h3>
        </div>
    </div>

    <div class="clearfix"></div>

    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>Listado de Temarios</h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    @include('temario.filtro', ['tem' => $tem, 'data' => $data])
                    <br>
                    <div class="">
                        @if (count($tem) > 0)
                            <table id="tabla" class="table table-striped jambo_table bulk_action">
                                <thead>
                                    <tr class="headings">
                                        <td class="column-title text-center">No.</td>
                                        <td class="column-title text-center">Clave </td>
                                        <td class="column-title text-center">Materia </td>
                                        <td class="column-title text-center no-link last"><span
                                                class="nobr">Acción</span>
                                        </td>

                                    </tr>
                                </thead>

                                <tbody>
                                    @foreach ($tem as $t)
                                        <tr class="even pointer">
                                            <td class="text-md-center" data-label="No.">{{ $loop->iteration }}</td>
                                            <td class="text-md-center" data-label="Clave: ">
                                                {{ $t->materia->clave_mat }}
                                            </td>
                                            <td class="text-md-center" data-label="Materia: ">
                                                {{ $t->materia->nombre_mat }}
                                            </td>
                                            <td class="text-md-center text-sm-center py-1" data-label="Acción: ">
                                                <div class="">
                                                    <button type="button"
                                                        class="btn btn-success btn-sm"data-toggle="tooltip"
                                                        data-placement="top" title=""
                                                        data-original-title="Vista Previa"
                                                        onclick="consultar_temario({{ $t->cve_tem }})"><i
                                                            class="fa fa-eye"></i></button>
                                                    <button type="button"
                                                        class="btn btn-info btn-sm"data-toggle="tooltip"
                                                        data-placement="top" title=""
                                                        data-original-title="Modificar"
                                                        onclick="edit_temario({{ $t->cve_tem }})"><i
                                                            class="fa fa-pencil"></i></button>

                                                    <!--modal de confirmacion para la eliminacion de un registro-->
                                                    <button type="button" class="btn btn-danger btn-sm"
                                                        data-toggle="tooltip" data-placement="top" title=""
                                                        data-original-title="Eliminar" title="Confirmacion"
                                                        onclick="modalConfirm('¿Está seguro(a) qué deseas eliminar el registro <span > {{ $t->materia->nombre_mat }} - {{ $t->materia->clave_mat }}</span>?','delete_temario({{ $t->cve_tem }});');"><i
                                                            class="fa fa-trash-o tam-ico"></i></button>
                                                    <!--modal de confirmacion para la eliminacion de un registro-->
                                                </div>
                                            </td>
                                        </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        @else
                            <div class="text-center">
                                <label class="" for="">No se encontraron resultados</label>
                            </div>
                        @endif
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function() {
        $('[data-toggle="tooltip"]').tooltip();
    });
</script>
<script>
    $(document).ready(function() {
        $('[data-toggle="tooltip"]').click(function() {
            $('[data-toggle="tooltip"]').tooltip("hide");

        });
    });
</script>
