
<?php $__env->startSection('title', 'Moyenne'); ?>
<?php $__env->startSection('link'); ?>
<!-- Data Table Css -->
<link rel="stylesheet" href="<?php echo e(asset('bower_components/datatables.net-bs4/css/dataTables.bootstrap4.min.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('assets/pages/data-table/css/buttons.dataTables.min.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('bower_components/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css')); ?>">
<style>
    .dataTables_length label{
        display: none;
    }
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="pcoded-inner-content">
    <?php echo $__env->make('includes._alert', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="card">
                            <div class="card-header mb-0 pb-0">
                                <div class="d-flex justify-content-between pb-0 mb-0">
                                    <h4>Détail - <?php echo e(ucwords($cutting->cutting->libelle)); ?></h4>
                                    <span class="form-control-variant" style="font-size: 15px">
                                        <strong class="mr-2"><?php echo e($classe['libelle']); ?></strong>[<?php echo e($enseignant ? ($enseignant->user->sexe == "F" ? 'Mde. ':'Mr. ').strtoupper($enseignant->user->first_name).' '.ucwords($enseignant->user->last_name):'Non défini'); ?>]
                                    </span>
                                    <span>
                                        <button class="btn btn-inverse btn-outline-inverse  btn-sm py-1 mx-1" id="btnEdit" title="Edit moyen..."><i class="fab fa-cloudsmith mx-0"></i></button>
                                        <a href="<?php echo e(route('moyenne.unclassified', $classe->id.'_'.$cutting->id)); ?>" class="btn btn-inverse btn-outline-inverse  btn-sm py-1 mx-1" title="unclassified"><i class="fas fa-asterisk mx-0"></i></a>
                                        <a href="<?php echo e(route('moyenne.file', $classe->id.'_'.$cutting->id)); ?>"target="_blank" class="btn btn-inverse btn-outline-inverse btn-sm py-1" title="Download pdf"><i class="fas fa-download mx-0"></i></a>
                                        <a href="<?php echo e(route('moyenne.index')); ?>" class="btn btn-inverse btn-outline-inverse  btn-sm py-1 mx-1" title="Return Back"><i class="fas fa-reply mx-0"></i></a>
                                    </span>
                                </div>
                            </div>
                            <hr class="mx-3 mt-0">
                            <div class="card-block">
                                <div class="dt-responsive table-responsive px-0">
                                    <table class="table table-striped table-bordered nowrap" id="myTable" style="width: 100%">
                                        <thead>
                                            <tr>
                                              <th class="text-center" style="width: 3%"></th>
                                              <th class="text-center">Matricule</th>
                                              <th class="text-center">Nom & Prénoms</th>
                                              <th class="text-center">Sexe</th>
                                              <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $matters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                                              <th class="text-center" title="<?php echo e($matter['libelle']); ?>"><?php echo e($matter['abbreviated'] ?? $matter['libelle']); ?></th>
                                              <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                              <th class="text-center" title="Moyenne">Moy</th>
                                              <th class="text-center">Rang</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php $i = 1; ?>
                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $datas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                                            <tr>
                                              <th class="text-center py-1">
                                                <img src="<?php echo e(asset($data['sexe'] == 'F' ? 'assets/images/stdt1_woman.png':'assets/images/stdt1_man.png')); ?>" class="img-radius m-0 p-0" alt="Photo Stuedent" style="height: 40px; width: 40px; border: 1px solid grey">
                                              </th>
                                              <td class="text-center"><?php echo e($data['matricule']); ?></td>
                                              <td class="text-left" title="<?php echo e($data['name']); ?>"><?php echo e(Str::limit($data['name'], 17, '...')); ?></td>
                                              <td class="text-center"><?php echo e($data['sexe']); ?></td>
                                              <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $data['moyens']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $moyen): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                                              <td class="text-center"><?php echo e($moyen ? $moyen['moyenne']:'--'); ?></td>
                                              <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                              <th class="text-center"><?php echo e($data['moyen'] ?? '--'); ?></th>
                                              <td class="text-center"><?php echo e($data['rang'] ?? '--'); ?></td>
                                            </tr>
                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Modal Edit -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <form action="<?php echo e(route('moyenne.edit')); ?>" method="post">
          <?php echo csrf_field(); ?>
          <?php echo method_field('get'); ?>
          <div class="modal-header bg-dark py-2">
              <h5 class="modal-title" id="myModalLongTitle">Select one matter</h5>
              <span style="font-style: 19px" id="editTitle"></span>
          </div>
          <div class="modal-body py-3">
              <label for="matter">Select matter<span class="text-danger">*</span> :</label>
              <select name="matter" id="matter" class="form-control"required>
                  <option value="">Select one option</option>
              </select>
              <input type="hidden" name="cutting" value="<?php echo e($cutting['id']); ?>" id="idCutting">
              <input type="hidden" name="classe" value="<?php echo e($classe['id']); ?>" id="idClasse">
          </div>
          <div class="modal-footer mt-2">
              <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2" data-dismiss="modal">Annuler</button>
              <button type="submit" class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2">Valider</button>
          </div>
      </form>
    </div>
  </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <!-- data-table js -->
    <script src="<?php echo e(asset('bower_components/datatables.net/js/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('bower_components/datatables.net-buttons/js/dataTables.buttons.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/pages/data-table/extensions/autofill/js/dataTables.autoFill.min.js')); ?>"></script>
    <script src="<?php echo e(asset('bower_components/datatables.net-buttons/js/buttons.print.min.js')); ?>"></script>
    <script src="<?php echo e(asset('bower_components/datatables.net-buttons/js/buttons.html5.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/pages/data-table/js/dataTables.bootstrap4.min.js')); ?>"></script>
    <script src="<?php echo e(asset('bower_components/datatables.net-responsive/js/dataTables.responsive.min.js')); ?>"></script>
    <script src="<?php echo e(asset('bower_components/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js')); ?>"></script>
    <!-- Custom js -->
    <script src="<?php echo e(asset('assets/pages/data-table/extensions/colreorder/js/colreorder-custom.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/pcoded.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/vartical-layout.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/jquery.mCustomScrollbar.concat.min.js')); ?>"></script>
    <script>
      $(document).ready(function(){

        $('#myTable').DataTable({
            ordering: false
        });

        $('#btnEdit').on('click', function() {
          $idClass = $('#idClasse').val(); $idCtting = $('#idCutting').val();
          $('.matters').remove();
          if($idClass && $idCtting){
            $.ajax({
              url: '<?php echo e(route('moyenne.matter')); ?>',
              method: 'GET',
              data: {
                class: $idClass,
                cutting: $idCtting
              },
              success: function(data){
                $('#editTitle').text(data['cutting']);
                $i = 0;
                while ($i < data['matters'].length) {
                  $mats = data['matters'][$i].abbreviated ?  (data['matters'][$i].abbreviated):data['matters'][$i].libelle;
                  $('#matter').append('<option class="matters" value="'+data['matters'][$i].id+'" title="'+data['matters'][$i].libelle+'">'+$mats+'</option>');
                  $i++;
                }
                $('#myModal').modal('show');
              }
            });
          }
        });
      })
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\EDUCAS\Desktop\App\V4_001\resources\views\pages\moyenne\detail.blade.php ENDPATH**/ ?>