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

    <div class="pagetitle">
      <h1>Absensi</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a>Dashboard</a></li>
          <li class="breadcrumb-item"><a>Presensi</a></li>
          <li class="breadcrumb-item active">Absensi (Terverifikasi / Ditolak)</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->

    <section class="section dashboard">
      <?php if(Session::get('msg')): ?>
      <div class="alert alert-success alert-dismissible fade show" role="alert">
          <i class="bi bi-check-circle me-1"></i>
                <?php echo e(Session::get('msg')); ?>

          <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
      </div>
      <?php endif; ?>


      <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Data Absensi (Terverifikasi / Ditolak)</h5>
              <br>
              
              <form method="GET" action="<?php echo e(url('dashboard/absensi/admin/approved')); ?>" class="row g-3 mt-1">
                <?php echo csrf_field(); ?>
                <div class="col-auto">
                  <select name="month" id="month" class="form-select" required>
                    <?php
                      $currentMonth = $month ?? now()->format('m');
                      $months = [
                        '01' => 'Januari',
                        '02' => 'Februari',
                        '03' => 'Maret',
                        '04' => 'April',
                        '05' => 'Mei',
                        '06' => 'Juni',
                        '07' => 'Juli',
                        '08' => 'Agustus',
                        '09' => 'September',
                        '10' => 'Oktober',
                        '11' => 'November',
                        '12' => 'Desember'
                      ];
                    ?>
                    <?php $__currentLoopData = $months; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $month): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($key); ?>" <?php echo e($currentMonth == $key ? 'selected' : ''); ?>><?php echo e($month); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                </div>
                <div class="col-auto">
                  <select name="year" id="year" class="form-select" required>
                    <?php
                      $currentYear = $year ?? now()->format('Y');
                      $startYear = 2020; // Change as per your requirement
                      $endYear = $currentYear + 5; // Future years range
                    ?>
                    <?php for($year = $startYear; $year <= $endYear; $year++): ?>
                      <option value="<?php echo e($year); ?>" <?php echo e($currentYear == $year ? 'selected' : ''); ?>><?php echo e($year); ?></option>
                    <?php endfor; ?>
                  </select>
                </div>
                <div class="col-auto">
                  <button type="submit" class="btn btn-primary">Filter</button>
                </div>
              </form>
              
              <br>
              
              <!-- Default Table -->
              <table class="table" id="table">
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Waktu Latihan</th>
                    <th scope="col">Venue</th>
                    <th scope="col">Trainer</th>
                    <th scope="col">Peserta</th>
                    <th scope="col">Tipe</th>
                    <!-- <th scope="col">Foto</th> -->
                    <th scope="col">Status</th>
                    <th scope="col">Action</th>
                  </tr>
                </thead>
                <tbody>
                  <?php 
                    $i = 1;
                  ?>
                  <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr>
                    <th scope="row"><?php echo e($i++); ?></th>
                    <td><?php echo e($datas->date); ?> <?php echo e($datas->time); ?></td>
                    <td><?php echo e($datas->Venue ? $datas->Venue->name : ''); ?></td>
                    <td><?php echo e($datas->Trainer->name); ?></td>
                    <?php if($datas->student_come == 0): ?>
                    <td><?php echo e($datas->student_name); ?><span class="badge bg-danger">tidak hadir</span></td>
                    <?php endif; ?>
                    <?php if($datas->student_come == 1): ?>
                    <td><?php echo e($datas->student_name); ?><span class="badge bg-success">hadir</span></td>
                    <?php endif; ?>
                    <td>
                    <?php if($datas->group_type == '0'): ?>
                            <?php echo e('Tunggal'); ?>

                        <?php elseif($datas->group_type == '1'): ?>
                            <?php echo e('Group'); ?>

                        <?php elseif($datas->group_type == '2'): ?>
                            <?php echo e('Therapy'); ?>

                        <?php else: ?>
                            <?php echo e('Club'); ?>

                        <?php endif; ?>
                        
                    </td>
<!-- <td><img src="/<?php echo e($datas->image); ?>" alt="" title="" style="width:50px" /></td> -->
                    <?php if($datas->status == 0): ?>
                    <td><span class="badge bg-warning">menunggu verifikasi</span></td>
                    <?php endif; ?>
                    <?php if($datas->status == 1): ?>
                    <td><span class="badge bg-success">terverifikasi</span></td>
                    <?php endif; ?>
                    <?php if($datas->status == 2): ?>
                    <td><span class="badge bg-danger">ditolak</span></td>
                    <?php endif; ?>
                    
                    <td>
                      <a href="/dashboard/absensi/detail/<?php echo e($datas->id); ?>" class="btn btn-secondary btn-sm" 
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Detail">
                        <i class="bi bi-info-square"></i>
                      </a>
                    </td>
                  </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                </tbody>
              </table>
              <!-- End Default Table Example -->
            </div>
          </div>
        </div>
      </div>
    </section>

  </main><!-- End #main -->
<?php $__env->stopSection(); ?>
<?php echo $__env->make('dashboard.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/tpsm5646/public_html/tpscmalang.com/tpscmalang/resources/views/dashboard/absensiApproved.blade.php ENDPATH**/ ?>