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

    <div class="pagetitle">
      <h1>Penilaian Peserta</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">Penilaian Peserta</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-6">
          <div class="card">
            <div class="card-body">
              <div class="tab-pane fade show active profile-overview" id="profile-overview">
                  <h5 class="card-title">Detail Absensi</h5>

                  <div class="row">
                    <div class="col-lg-3 col-md-4 label ">Tgl Latihan</div>
                    <div class="col-lg-9 col-md-8"><b><?php echo e($absensi->date); ?></b></div>
                  </div>

                  <div class="row">
                    <div class="col-lg-3 col-md-4 label">Jml Peserta</div>
                    <div class="col-lg-9 col-md-8"><b><?php echo e($absensi->student_count); ?></b></div>
                  </div>

                  <div class="row">
                    <div class="col-lg-3 col-md-4 label">Lokasi</div>
                    <div class="col-lg-9 col-md-8"><b><?php echo e($absensi->Venue->name); ?></b></div>
                  </div>
                </div>
            </div>
          </div>

        </div>
        <?php if(Session::get('user')->role == 2): ?>
        <div class="col-lg-6">
          <div class="card">
            <div class="card-body">
              <div class="tab-pane fade show active profile-overview" id="profile-overview" >
                <table class="table" id="table-nilai">
                <thead style="display: table; width: 100%; table-layout: fixed">
                  <tr style="display: table; width: 100%; table-layout: fixed">
                    <th scope="col">#</th>
                    <th scope="col">Nama</th>
                    <th scope="col">Action</th>
                  </tr>
                </thead>
                <tbody class="table" style="height: 200px;
                    overflow: scroll; display: block;">
                  <?php 
                    $i = 1;
                  ?>
                  <?php $__currentLoopData = $student; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $st): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr style="display: table; width: 100%; table-layout: fixed">
                    <th scope="row"><?php echo e($i++); ?></th>
                    <td><?php echo e($st->name); ?></td>
                    <td>
                      <a class="btn btn-secondary btn-sm" 
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Nilai Peserta">
                        <i class="bi bi-plus" data-bs-toggle="modal"data-bs-target="#editModal<?php echo e($st->id); ?>"></i>
                      </a>
                    </td>
                  </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                </tbody>
              </table>
              </div>
            </div>
          </div>
        </div>
        <?php endif; ?>

        <div class="col-lg-12">
          <div class="card">
            <div class="card-body">
              <div class="tab-pane fade show active profile-overview" id="profile-overview">
                <h5 class="card-title">Hasil Penilaian</h5>
                <table class="table" id="table2">
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Nama</th>
                    <th scope="col">Tanggal Latihan</th>
                    <th scope="col">Venue</th>
                    <th scope="col">Trainer</th>
                    <th scope="col">Pertemuan</th>
                    <th scope="col">Penilaian</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>
                    <td scope="row"><?php echo e($i++); ?></td>
                    <td><?php echo e($datas->Student->name); ?></td>
                    <td><?php echo e($datas->Absensi->date); ?></td>
                    <td><?php echo e($datas->Absensi->Venue->name); ?></td>
                    <td><?php echo e($datas->Trainer->name); ?></td>
                    <td><?php echo e($datas->session_number); ?></td>
                    <td><?php echo e($datas->trainer_notes); ?></td>
                    <td><a class="btn btn-secondary btn-sm" 
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Nilai Peserta">
                        <i class="bi bi-plus" data-bs-toggle="modal"data-bs-target="#editModalNilai<?php echo e($datas->id); ?>"></i>
                      </a></td>
                  </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                </tbody>
              </table>
              </div>
            </div>
          </div>

        </div>
      </div>
    </section>


    <?php $__currentLoopData = $student; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $st): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="modal fade" id="editModal<?php echo e($st->id); ?>" tabindex="-1">
      <div class="modal-dialog">
        <div class="modal-content">
          <form class="row g-3" method="POST" action="/dashboard/absensi/nilai" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>

            <div class="modal-header">
              <h5 class="modal-title">Penilaian Peserta</h5>
            </div>
            <div class="modal-body">
              <input type="hidden" name="student_id" value="<?php echo e($st->id); ?>">
              <input type="hidden" name="absensi_id" value="<?php echo e($absensi->id); ?>">
              <div class="col-12">

                <label for="title" class="form-label">Catatan Penilaian</label>
                <textarea name="trainer_notes" style="width: 100%"></textarea>
                <!-- <div class="quill-editor-default">
                </div> -->
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
              <button type="submit" class="btn btn-primary">Save</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

    <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="modal fade" id="editModalNilai<?php echo e($datas->id); ?>" tabindex="-1">
      <div class="modal-dialog">
        <div class="modal-content">
          <form class="row g-3" method="POST" action="/dashboard/absensi/nilai/update" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>

            <div class="modal-header">
              <h5 class="modal-title">Penilaian Peserta</h5>
            </div>
            <div class="modal-body">
              <input type="hidden" name="id" value="<?php echo e($datas->id); ?>">
              <div class="col-12">

                <label for="title" class="form-label">Catatan Penilaian</label>
                <textarea name="trainer_notes" style="width: 100%"><?php echo e($datas->trainer_notes); ?></textarea>
                <!-- <div class="quill-editor-default">
                </div> -->
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
              <button type="submit" class="btn btn-primary">Save</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </main><!-- End #main -->
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\PT. DAHA JAYABAYA TEKNOLOGI\Project\tpscmalang\resources\views/dashboard/absensiDetail.blade.php ENDPATH**/ ?>