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

    <div class="pagetitle">
      <h1>Trainer</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a>Dashboard</a></li>
          <li class="breadcrumb-item"><a>Master Data</a></li>
          <li class="breadcrumb-item active">Trainer</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 Trainer</h5>
              <Button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
                <i class="bi bi-plus"></i>
                  Tambah Data  
              </Button>
              <br>
              <br>
              <!-- Default Table -->
              <table class="table" id="table">
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Foto Profil</th>
                    <th scope="col">Nama</th>
                    <th scope="col">Username</th>
                    <th scope="col">Fee (Tunggal & Group)</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><img src="/<?php echo e($datas->image); ?>" alt="" title="" style="width:50px" /></td>
                    <td><?php echo e($datas->name); ?></td>
                    <td><?php echo e($datas->email); ?></td>
                    <td><?php echo e($datas->individual_fee); ?> & <?php echo e($datas->group_fee); ?></td>
                    <td>
                      <a href="" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#editModal<?php echo e($datas->id); ?>" >
                        <i class="bi bi-pencil-square"></i>
                      </a>
                      <a href="/dashboard/trainer/reset/<?php echo e($datas->id); ?>" class="btn btn-danger btn-sm" 
                        onclick="return confirm('Anda yakin ingin reset password akun?')" 
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Reset Password">
                        <i class="bi bi-key"></i>
                      </a>
                      <a href="/dashboard/trainer/delete/<?php echo e($datas->id); ?>" class="btn btn-danger btn-sm" 
                        onclick="return confirm('Anda yakin ingin menghapus data?')" 
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Hapus">
                        <i class="bi bi-trash"></i>
                      </a>
                    </td>
                  </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                </tbody>
              </table>
              <!-- End Default Table Example -->
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- Modal -->
    <div class="modal fade" id="addModal" tabindex="-1">
      <div class="modal-dialog">
        <div class="modal-content">
          <form class="row g-3" method="POST" action="/dashboard/trainer/add" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>

            <div class="modal-header">
              <h5 class="modal-title">Tambah Data</h5>
              <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
              <div class="col-12">
                <label for="title" class="form-label">Nama</label>
                <input type="text" class="form-control" id="name" name="name">
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Username</label>
                <input type="text" class="form-control" id="email" name="email">
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Fee Tunggal</label>
                <input type="number" class="form-control" id="individual_fee" name="individual_fee">
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Fee Grup</label>
                <input type="number" class="form-control" id="group_fee" name="group_fee">
              </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 $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="modal fade" id="editModal<?php echo e($datas->id); ?>" tabindex="-1">
      <div class="modal-dialog">
        <div class="modal-content">
          <form class="row g-3" method="POST" action="/dashboard/trainer/update" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>

            <div class="modal-header">
              <h5 class="modal-title">Edit Data</h5>
              <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </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">Nama</label>
                <input type="text" class="form-control" id="name" name="name" value="<?php echo e($datas->name); ?>">
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Username</label>
                <input type="text" class="form-control" id="email" name="email" value="<?php echo e($datas->email); ?>">
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Fee Tunggal</label>
                <input type="number" class="form-control" id="individual_fee" name="individual_fee" value="<?php echo e($datas->individual_fee); ?>">
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Fee Grup</label>
                <input type="number" class="form-control" id="group_fee" name="group_fee" value="<?php echo e($datas->group_fee); ?>">
              </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 /home/tpsa4296/public_html/tpscmalang/resources/views/dashboard/trainer.blade.php ENDPATH**/ ?>