<?php $__env->startSection('intitule'); ?>
    <h5 class="font-weight-medium text-uppercase mb-0">Statistiques : <?php echo e($data['titre']); ?></h5>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <li class="breadcrumb-item active" aria-current="page">Statistiques</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>
    <link href="<?php echo e(asset('assets/extra-libs/datatables.net-bs4/css/dataTables.bootstrap4.css')); ?>" rel="stylesheet">

    <link rel="stylesheet" type="text/css"
        href="<?php echo e(asset('assets/extra-libs/datatables.net-bs4/css/responsive.dataTables.min.css')); ?>">

    <link rel="stylesheet" href="<?php echo e(asset('assets/libs/apexcharts/dist/apexcharts.css')); ?>">

    <link href="<?php echo e(asset('assets/libs/morris.js/morris.css')); ?>" rel="stylesheet">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('main'); ?>
    <div class="row justify-content-center mt-4" style="min-height: calc(85vh - 60px)">
        <div class="col-lg-12">
            <div class="" style=" background:#fff;">
                <div class="card-group py-5 mb-0 ">
                    <div class=" col-lg-3 col-sm-12 " style="border-right:1px solid rgba(120,130,140,.13);">
                        <div class="p-lg-3 p-2">
                            <div class="d-flex align-items-center">

                                <h3 class="mb-0 display-10"><i class="icon-people text-pulpe"></i></h3>

                                <div class="ms-2 container-sm ">
                                    <h2 class="fs-5 ">Effectif Total</h2>
                                    <div class="progress">
                                        <div class="progress-bar bg-cyan" role="progressbar" style="width: 100%"
                                            aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                </div>
                                <div class="ms-auto">
                                    <h2 class="display-7 mb-0"><?php echo e($data['nb2']); ?></h2>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class=" col-lg-2 col-sm-12 " style="border-right:1px solid rgba(120,130,140,.13);">
                        <div class="p-lg-3 p-2">
                            <div class="d-flex align-items-center">

                                <h3 class="mb-0 display-10"><i class="icon-people text-pulpe"></i></h3>

                                <div class="ms-2 container-sm ">
                                    <h2 class="fs-5 ">Admis</h2>
                                    <div class="progress">
                                        <div class="progress-bar bg-success" role="progressbar"
                                            style="width: <?php echo e($data['padmis']); ?>%" aria-valuenow="<?php echo e($data['padmis']); ?>"
                                            aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                </div>
                                <div class="ms-auto">
                                    <h2 class="display-7 mb-0"><?php echo e($data['nbadmis']); ?></h2>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class=" col-lg-2 col-sm-12 " style="border-right:1px solid rgba(120,130,140,.13);">
                        <div class="p-lg-3 p-2">
                            <div class="d-flex align-items-center">

                                <h3 class="mb-0 display-10"><i class="icon-people text-pulpe"></i></h3>
                                <div class="ms-2 container-sm ">
                                    <h2 class="fs-5">Enjambé</h2>
                                    <div class="progress">
                                        <div class="progress-bar bg-info" role="progressbar"
                                            style="width: <?php echo e($data['penjambe']); ?>%" aria-valuenow="<?php echo e($data['penjambe']); ?>"
                                            aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                </div>
                                <div class="ms-auto">
                                    <h2 class="display-7 mb-0"><?php echo e($data['nbenjambe']); ?></h2>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class=" col-lg-2 col-sm-12 " style="border-right:1px solid rgba(120,130,140,.13);">
                        <div class="p-lg-3 p-2">
                            <div class="d-flex align-items-center">

                                <h3 class="mb-0 display-10"><i class="icon-people text-pulpe"></i></h3>

                                <div class="ms-2 container-sm">
                                    <h2 class="fs-5">Redouble</h2>
                                    <div class="progress">
                                        <div class="progress-bar bg-warning" role="progressbar"
                                            style="width: <?php echo e($data['predouble']); ?>%"
                                            aria-valuenow="<?php echo e($data['predouble']); ?>" aria-valuemin="0" aria-valuemax="100">
                                        </div>
                                    </div>
                                </div>
                                <div class="ms-auto">
                                    <h2 class="display-7 mb-0"><?php echo e($data['nbredouble']); ?></h2>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class=" col-lg-3 col-sm-12 " style="border-right:1px solid rgba(120,130,140,.13);">
                        <div class="p-lg-3 p-2">
                            <div class="d-flex align-items-center">

                                <h3 class="mb-0 display-10"><i class="icon-people text-pulpe"></i></h3>

                                <div class="ms-2 container-sm">
                                    <h2 class="fs-5">Exclu</h2>
                                    <div class="progress">
                                        <div class="progress-bar bg-danger" role="progressbar"
                                            style="width: <?php echo e($data['pexclu']); ?>%" aria-valuenow="<?php echo e($data['pexclu']); ?>"
                                            aria-valuemin="0" aria-valuemax="100">
                                        </div>
                                    </div>
                                </div>
                                <div class="ms-auto">
                                    <h2 class="display-7 mb-0"><?php echo e($data['nbexclu']); ?></h2>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="mt-5 ms-4">

                <h3>Statistiques Générales</h3>
                <h4>Pourcentage des admis</h4>

                <div class="progress mt-2" style="height: 40px;">
                    <div class="progress-bar fs-6 bg-success" style="width: <?php echo e($data['padmis']); ?>%;" role="progressbar">
                        <?php echo e($data['padmis']); ?>%</div>
                </div>

                <h4>Pourcentage des enjambés</h4>

                <div class="progress mt-2" style="height: 40px;">
                    <div class="progress-bar fs-6 bg-info" style="width: <?php echo e($data['penjambe']); ?>%;" role="progressbar">
                        <?php echo e($data['penjambe']); ?>%</div>
                </div>

                <h4>Pourcentage des redoublants</h4>

                <div class="progress mt-2" style="height: 40px;">
                    <div class="progress-bar fs-6 bg-warning" style="width: <?php echo e($data['predouble']); ?>%;"
                        role="progressbar"><?php echo e($data['predouble']); ?>%</div>
                </div>

                <div>
                    <h4>Pourcentage des exclus</h4>
                </div>

                <div class="progress mt-2" style="height: 40px;">
                    <div class="progress-bar fs-6 bg-danger" style="width: <?php echo e($data['pexclu']); ?>%;" role="progressbar">
                        <?php echo e($data['pexclu']); ?>%</div>
                </div>

            </div>

            <div class="col-12 mt-5">

                <div class="row">
                    <div class="col-sm-12">
                        <div class="">
                            <div class="card-body">
                                <div class="table-responsive">
                                    <div id="zero_config_wrapper"
                                        class="dataTables_wrapper container-fluid dt-bootstrap4">

                                        <div class="row">
                                            <div class="col-sm-12">

                                                <h4>Option d'exportation :</h4>

                                                <table id="file_export" cellpadding="5px"
                                                    class="table table-striped table-bordered display" role="grid"
                                                    style="width:100%">

                                                    <thead>
                                                        <tr>
                                                            <th>Filiere</th>
                                                            <th>Admis</th>
                                                            <th>Enjambe</th>
                                                            <th>Redouble</th>
                                                            <th>Exclu</th>

                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <?php
                                                            $admis = 'A';
                                                            $enjambe = 'ENJ';
                                                            $redouble = 'R';
                                                            $exclu = 'E';
                                                            $acadYear = Session::get('RESULTAT_DATA')['RESULTAT_YEAR']->annee_acad;
                                                        ?>
                                                        <?php $__currentLoopData = $data['lines']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $line): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <?php
                                                                $filiere = App\Models\Filieres::where('idFiliere', $line->idFiliere)->first();

                                                                //Admis
                                                                $admis = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                                    ->where([['resultat', $admis], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                                    ->count();

                                                                //Enjambe
                                                                $enjambe = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                                    ->where([['resultat', $enjambe], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                                    ->count();
                                                                //Redouble
                                                                $redouble = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                                    ->where([['resultat', $redouble], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                                    ->count();

                                                                //Exclu
                                                                $exclu = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                                    ->where([['resultat', $exclu], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                                    ->count();

                                                            ?>
                                                            <tr role="row" class="odd">
                                                                <td class="sorting_1">
                                                                    <?php echo e($filiere->sigleFilieres . $line->annee); ?></td>
                                                                <td><?php echo e($admis); ?></td>
                                                                <td><?php echo e($enjambe); ?></td>
                                                                <td><?php echo e($redouble); ?></td>
                                                                <td><?php echo e($exclu); ?></td>
                                                            </tr>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </div>

                            <div class="card-body" style="display:none">


                                <table id="graphe" cellpadding="5px"
                                    class="table table-striped table-bordered display" role="grid" style="width:100%">

                                    <thead>
                                        <tr>
                                            <th>Filiere</th>
                                            <th>Admis</th>
                                            <th>Enjambe</th>
                                            <th>Redouble</th>
                                            <th>Exclu</th>

                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                            $admis = 'A';
                                            $enjambe = 'ENJ';
                                            $redouble = 'R';
                                            $exclu = 'E';
                                            $acadYear = Session::get('RESULTAT_DATA')['RESULTAT_YEAR']->annee_acad;
                                        ?>
                                        <?php $__currentLoopData = $data['lines']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $line): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $filiere = App\Models\Filieres::where('idFiliere', $line->idFiliere)->first();

                                                //Admis
                                                $admis = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                    ->where([['resultat', $admis], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                    ->count();

                                                //Enjambe
                                                $enjambe = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                    ->where([['resultat', $enjambe], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                    ->count();
                                                //Redouble
                                                $redouble = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                    ->where([['resultat', $redouble], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                    ->count();

                                                //Exclu
                                                $exclu = App\Models\TabEtudiant::select('tabetudiant.matricule')
                                                    ->join('tabinscription', 'tabinscription.matricule', '=', 'tabetudiant.matricule')
                                                    ->where([['resultat', $exclu], ['tabinscription.annee_acad', $acadYear], ['idFiliere', $line->idFiliere], ['niveauFormation', $data['formation']], ['annee', $line->annee]])
                                                    ->count();

                                            ?>
                                            <tr role="row" class="odd">
                                                <td class="sorting_1">
                                                    <?php echo e($filiere->sigleFilieres . $line->annee); ?></td>
                                                <td><?php echo e($admis); ?></td>
                                                <td><?php echo e($enjambe); ?></td>
                                                <td><?php echo e($redouble); ?></td>
                                                <td><?php echo e($exclu); ?></td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                    </tbody>
                                </table>

                            </div>

                            <div class="col-lg-12">
                                <div class="card mt-5 ">
                                    <script src="<?php echo e(asset('dist/js/highcharts.js')); ?>"></script>
                                    <script src="<?php echo e(asset('dist/js/data.js')); ?>"></script>
                                    <script src="<?php echo e(asset('dist/js/exporting.js')); ?>"></script>
                                    <script src="<?php echo e(asset('dist/js/accessibility.js')); ?>"></script>

                                    <figure class="highcharts-figure">
                                        <div id="container" class="fs-lg-4"></div>
                                    </figure>
                                </div>
                            </div>

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

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('assets/extra-libs/datatables.net/js/jquery.dataTables.min.js')); ?>"></script>

    <script src="<?php echo e(asset('assets/extra-libs/datatables.net-bs4/js/dataTables.responsive.min.js')); ?>"></script>

    <script src="<?php echo e(asset('dist/js/pages/datatable/datatable-basic.init.js')); ?>"></script>

    <script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>

    <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.flash.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>

    <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script>

    <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.print.min.js"></script>

    <script src="<?php echo e(asset('dist/js/pages/datatable/datatable-advanced.init.js')); ?>"></script>

    <script>
        let studentsList =
            initDT({
                table: "#file_export",
                cLang: {
                    name: "étudiant",
                    plural: "étudiants",
                    gender: "M",
                    lang: "fr"
                },
                tbTitle: "Liste des étudiants"
            });
        studentsList.on('search.dt', function() {
            Highcharts.chart('container', {
                colors: [
                    '#2CD07E',
                    '#2CABE3',
                    '#FFC36D',
                    '#FF5050'
                ],
                data: {
                    table: 'file_export'
                },
                chart: {
                    type: 'column'
                },
                title: {
                    text: 'GRAPHIQUE'
                },
                subtitle: {
                    text: 'Statistique de validation par filière'
                },
                xAxis: {
                    type: 'category'
                },
                yAxis: {
                    allowDecimals: false,
                    title: {
                        text: 'Statistique de validation'
                    }
                },
                tooltip: {
                    formatter: function() {
                        return '<b>' + this.series.name + '</b><br/>' +
                            this.point.y + ' ' + this.point.name.toLowerCase();
                    }
                }
            });
        })
        Highcharts.chart('container', {
            colors: [
                '#2CD07E',
                '#2CABE3',
                '#FFC36D',
                '#FF5050'
            ],
            data: {
                table: 'file_export'
            },
            chart: {
                type: 'column'
            },
            title: {
                text: 'GRAPHIQUE'
            },
            subtitle: {
                text: 'Statistique de validation par filière'
            },
            xAxis: {
                type: 'category'
            },
            yAxis: {
                allowDecimals: false,
                title: {
                    text: 'Statistique de validation'
                }
            },
            tooltip: {
                formatter: function() {
                    return '<b>' + this.series.name + '</b><br/>' +
                        this.point.y + ' ' + this.point.name.toLowerCase();
                }
            }
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/africawebstudent/public_html/aws/results/resources/views/statistiques/statGlobale.blade.php ENDPATH**/ ?>