<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('sweet::alert', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <div class="portlet light portlet-fit portlet-datatable bordered">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green sbold uppercase"> Mis cursos </span>
            </div>
        </div>
        <div class="portlet-body">

            <div class="Forum-ForumTopicList row" style="margin:20px">
                <div class="col-lg-12" id="divTable">
                    <table class="table table-striped table-bordered table-hover table-bg tbCursos"
                           id="tbCursos"
                           width="100%" role="grid" aria-describedby="tbCursos_info">
                        <thead class="thead-default">
                        <tr>
                            <th>Código curso</th>
                            <th>Nombre curso</th>
                            <th>Sección</th>
                            <th>Ver notas</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php $__currentLoopData = $cursos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td> <?php echo e($item->CodigoCurso); ?></td>
                                <td> <?php echo e($item->Curso); ?></td>
                                <td> <?php echo e($item->Seccion); ?></td>
                                <td>
                                    <a id="<?php echo e($item->cursoID); ?>" onclick="modalshow(<?php echo e($item->id); ?>,this)"
                                       class="btn btn-outline btn-circle btn-sm blue">
                                        Ver notas
                                    </a>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>


        </div>

    </div>

    <div id="modalDetalle" class="modal fade" tabindex="-1" aria-hidden="true" style="display: none; padding-right: 17px;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                    <h4 class="modal-title">Detalle Nota</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div id="mbody"></div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" data-dismiss="modal" class="btn dark btn-outline">cerrar</button>
                </div>
            </div>
        </div>
    </div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script>

        var tbCursos = $('#tbCursos').DataTable({
            "lengthMenu": [[25, 20, 50, -1], [25, 20, 50, "Todas"]],
            bFilter: true,
            "bLengthChange": false,
            bInfo: true,
            responsive: true,
            "autoWidth": true,
            "language": {
                "lengthMenu": "Mostrar _MENU_ Entradas",
                "zeroRecords": "No se encontraron registros",
                "info": "Mostrando la página _PAGE_ de _PAGES_",
                "infoEmpty": "No hay registros disponibles",
                "infoFiltered": "(filtrado de _MAX_ registros totales)",
                "search": "Buscar: ",
                "paginate": {
                    "first": "Primero",
                    "last": "Último",
                    "next": "Siguiente",
                    "previous": "Anterior"
                },
            },
            "order": [],
            "aoColumns": [
                {"bSearchable": true},
                {"bSearchable": true},
                {"bSearchable": true},
                {"bSearchable": false},
            ],
            "columns": [
                {"orderable": true},
                {"orderable": true},
                {"orderable": true},
                {"orderable": false},
            ],
            dom: 'Bfrtip',
            buttons: [
                {
                    extend: 'excel',
                    exportOptions: {
                        columns: [0, 1, 2]
                    },
                    title: 'Reporte de cursos alumnos'
                }, {
                    extend: 'pdf',
                    exportOptions: {
                        columns: [0, 1, 2]
                    },
                    pageSize: 'LEGAL',
                    customize: function (doc) {
                        //pageMargins [left, top, right, bottom]
                        doc.pageMargins = [120, 20, 20, 20];
                    },
                    title: 'Reporte de cursos alumnos'
                }

            ]
        });

        function modalshow(idseccionalumno, item) {
            var cursoID = item.id
            $.ajax({

                url: "<?php echo e(url('misnotas/cursos')); ?>" + "/" + idseccionalumno + "/" + cursoID,

                success: function (data) {
                    $("#mbody").empty();
                    $("#mbody").html(data);
                }

            });

            $("#modalDetalle").modal('show');

        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('template.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>