

<?php $__env->startSection('content_header'); ?>
    <h1><b>Bienvenido, <?php echo e(Auth::user()->roles->pluck('name')->implode(', ')); ?>:</b> <?php echo e(Auth::user()->name); ?> </h1>
    <hr>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">

        <?php if(Auth::user()->roles->pluck('name')->implode(', ') == 'ESTUDIANTE'): ?>
            <div class="card col-md-6 col-sm-6 col-12">
                <div class="card-header">
                    Datos del usuario
                </div>
                <div class="card-body">
                    <table class="table table-bordered table-striped table-hover table-sm">
                        <tr>
                            <td style="background-color: #dbdbdb;width:200px"><b>Nombres:</b> </td>
                            <td><?php echo e(Auth::user()->estudiante->nombres); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #dbdbdb"><b>Apellidos:</b> </td>
                            <td><?php echo e(Auth::user()->estudiante->apellidos); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #dbdbdb"><b>Carnet de identidad:</b> </td>
                            <td><?php echo e(Auth::user()->estudiante->ci); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #dbdbdb"><b>Fecha de nacimiento:</b> </td>
                            <td><?php echo e(Auth::user()->estudiante->fecha_nacimiento); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #dbdbdb"><b>Teléfono:</b> </td>
                            <td><?php echo e(Auth::user()->estudiante->telefono); ?></td>
                        </tr>
                    </table>
                </div>
            </div>
        <?php endif; ?>



        <?php if(Auth::user()->roles->pluck('name')->implode(', ') == 'DOCENTE'): ?>
            <div class="card col-md-6 col-sm-6 col-12">
                <div class="card-header">
                    Datos del usuario
                </div>
                <div class="card-body">
                    <table class="table table-bordered table-striped table-hover table-sm">
                        <tr>
                            <td style="background-color: #d4f4fa;width:200px"><b>Nombres:</b> </td>
                            <td><?php echo e(Auth::user()->docente->nombres); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #d4f4fa"><b>Apellidos:</b> </td>
                            <td><?php echo e(Auth::user()->docente->apellidos); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #d4f4fa"><b>Carnet de identidad:</b> </td>
                            <td><?php echo e(Auth::user()->docente->ci); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #d4f4fa"><b>Fecha de nacimiento:</b> </td>
                            <td><?php echo e(Auth::user()->docente->fecha_nacimiento); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #d4f4fa"><b>Teléfono:</b> </td>
                            <td><?php echo e(Auth::user()->docente->telefono); ?></td>
                        </tr>
                        <tr>
                            <td style="background-color: #d4f4fa"><b>Profesión:</b> </td>
                            <td><?php echo e(Auth::user()->docente->profesion); ?></td>
                        </tr>
                    </table>
                </div>
            </div>
        <?php endif; ?>



        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.gestiones.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/calendario.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Gestiones registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_gestiones); ?> gestiones</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>



        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.carreras.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/diploma.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Carreras registradas</b></span>
                        <span class="info-box-number"><?php echo e($total_carreras); ?> carreras</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.niveles.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/grafico-de-linea.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Niveles registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_niveles); ?> niveles</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.turnos.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/reloj.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Turnos registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_turnos); ?> turnos</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.paralelos.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/carpetas.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Paralelos registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_paralelos); ?> paralelos</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.periodos.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/completar.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Periodos registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_periodos); ?> Periodos</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.materias.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/materias.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Materias registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_materias); ?> Materias</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.roles.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/roles.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Roles registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_roles); ?> Roles</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.administrativos.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/administrativos.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Administrativos registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_administrativos); ?> Administrativos</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.docentes.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/docente.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Docentes registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_docentes); ?> Docentes</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.estudiantes.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/estudiantes.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Estudiantes registrados</b></span>
                        <span class="info-box-number"><?php echo e($total_estudiantes); ?> Estudiantes</span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.pagos.index')): ?>
            <div class="col-md-3 col-sm-6 col-12">
                <div class="info-box zoomP">
                    <img src="<?php echo e(url('/img/pago.gif')); ?>" width="70px" alt="">
                    <div class="info-box-content">
                        <span class="info-box-text"><b>Pagos registrados</b></span>
                        <span class="info-box-number">Total Pagado: <?php echo e($total_pagos); ?></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
        <?php endif; ?>

    </div>

    <div class="row">

        <div class="col-md-4">
            <div class="card card-outline card-primary">
                <div class="card-header">
                    <h3 class="card-title">Total de Estudiantes matriculados</h3>
                </div>
                <div class="card-body">
                    <div>
                        <canvas id="myChart"></canvas>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card card-outline card-primary">
                <div class="card-header">
                    <h3 class="card-title">Total pagos por mes</h3>
                </div>
                <div class="card-body">
                    <div>
                        <canvas id="myChart2"></canvas>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card card-outline card-primary">
                <div class="card-header">
                    <h3 class="card-title">Estado de los estudiantes</h3>
                </div>
                <div class="card-body">
                    <div>
                        <canvas id="myChart3"></canvas>
                    </div>
                </div>
            </div>
        </div>

    </div>

<?php $__env->stopSection(); ?>

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

<?php $__env->startSection('js'); ?>
    <script>
        var gestiones = <?php echo json_encode($gestionesArray, 15, 512) ?>;
        var matriculados = <?php echo json_encode($datosMatriculados, 15, 512) ?>;
        new Chart(document.getElementById('myChart'), {
            type: 'line',
            data: {
                labels: gestiones,
                datasets: [{
                    label: 'Total de Estudiantes matriculados',
                    data: matriculados,
                    backgroundColor: 'rgba(54, 162, 235, 0.2)',
                    borderColor: 'rgba(54, 162, 235, 1)',
                    borderWidth: 2,
                    fill: true,
                    tension: 0.3
                }]
            },
            options: {
                scales: {
                    y: {
                        beginAtZero: true
                    }
                }
            }
        });


        var meses = <?php echo json_encode($meses, 15, 512) ?>;
        var montos = <?php echo json_encode($montos, 15, 512) ?>;
        new Chart(document.getElementById('myChart2'), {
            type: 'bar',
            data: {
                labels: meses,
                datasets: [{
                    label: 'Total de pagos por mes',
                    data: montos,
                    backgroundColor: 'rgba(75, 192, 192, 0.6)',
                borderColor: 'rgba(75, 192, 192, 1)',
                    borderWidth: 2,
                    fill: true,
                    tension: 0.3
                }]
            },
            options: {
                scales: {
                    y: {
                        beginAtZero: true
                    }
                }
            }
        });



        var estado = ['Aprobados','Reprobados'];
        var cantidad = [<?php echo e($cantidadAprobados); ?>, <?php echo e($cantidadReprobados); ?>];
        new Chart(document.getElementById('myChart3'), {
            type: 'pie',
            data: {
                labels: estado,
                datasets: [{
                    label: 'Cantidad de aprobados y reprobados',
                    data: cantidad,
                    backgroundColor: ['#f39c12', '#17a2b8'],
                    
                    borderWidth: 2,
                    fill: true,
                    tension: 0.3
                }]
            },
            options: {
                scales: {
                    y: {
                        beginAtZero: true
                    }
                }
            }
        });

        console.log("Hi, I'm using the Laravel-AdminLTE package!");
    </script>





<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\sisuniversitario\resources\views/admin/index.blade.php ENDPATH**/ ?>