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

    <div class="pagetitle">
      <h1>Gaji Trainer</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a>Dashboard</a></li>
          <li class="breadcrumb-item"><a>Keuangan</a></li>
          <li class="breadcrumb-item active">Gaji 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 Saldo Trainer <?php echo e(now()->format('F Y')); ?></h5>
              <br>
              <br>
              <!-- Default Table -->
              <table class="table" id="table">
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Nama Trainer</th>
                    <th scope="col">Saldo</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->name); ?></td>
                    <td>Rp. <?php echo e(number_format($datas->balance,2,',','.')); ?></td>
                    <td>
                      <a class="btn btn-warning btn-sm"
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Tambah Mutasi">
                        <i class="bi bi-plus" data-bs-toggle="modal" data-bs-target="#addModal<?php echo e($datas->id); ?>"></i>
                      </a>
                      <a href="/dashboard/trainer-balance/pay/<?php echo e($datas->id); ?>" class="btn btn-success btn-sm" 
                        onclick="return confirm('Transfer Gaji Trainer Sekarang?')" 
                        data-bs-toggle="tooltip" data-bs-placement="top" title="Pay Out">
                        <i class="bi bi-arrow-bar-up"></i>
                      </a>

                    </td>
                  </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                </tbody>
              </table>
              <!-- End Default Table Example -->
            </div>
          </div>
        </div>
      </div>
    </section>


    <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="modal fade" id="addModal<?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-balance/reimburse" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>

            <div class="modal-header">
              <h5 class="modal-title">Transfer Reimburse</h5>
            </div>
            <div class="modal-body">
              <input type="hidden" name="id" value="<?php echo e($datas->id); ?>">
              <!-- <div class="col-6">
                <label for="title" class="form-label">Pertemuan ke</label>
                <input type="number" name="session_number" value="<?php echo e($datas->session_number); ?>">
              </div> -->
              <div class="col-12">
                <label for="title" class="form-label">Ke Trainer : </label>
                <input type="text" class="form-control" value="<?php echo e($datas->name); ?>" readonly="">
              </div>
              <div class="col-12">
                <label for="nominal" class="form-label">Nominal</label>
                <input type="number" id="nominal" class="form-control" name="nominal">
              </div>
              <div class="col-6">
                <label for="type" class="form-label">Jenis Mutasi</label>
                <select class="form-control" id="type" name="type" >
                  <option>-- Jenis Mutasi --</option>
                  <option value="1">Mutasi Masuk</option>
                  <option value="0">Mutasi Keluar</option>
                </select>
              </div>
              <div class="col-12">
                <label for="title" class="form-label">Keterangan</label>
                <textarea style="width: 100%" name="description"></textarea>
              </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/tpsm5646/public_html/tpscmalang.com/tpscmalang/resources/views/dashboard/trainerBalance.blade.php ENDPATH**/ ?>