<?php echo $__env->make('admin.layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('admin.layouts.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('admin.layouts.top-nav', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="right_col" role="main">
  <div class="">
    <div class="page-title">
      <div class="title_left">
        <h3><?php echo e($title); ?></h3>
      </div>

      <div class="clearfix"></div>

      <div class="row" style="display: block;">
        <div class="col-md-12 col-sm-12  ">
          <div class="x_panel">
            <div class="x_title">
              <h2><?php echo e($title); ?></h2>
              <ul class="nav navbar-right panel_toolbox">
                <a href="<?php echo e(route('program-donasi.create')); ?>" class="btn btn-sm btn-primary mr-0"><i class="fa fa-plus"></i> Tambah</a>
              </ul>
              <div class="clearfix"></div>
            </div>
            <div class="x_content">
              <div class="row">
                <div class="col-sm-12">
                  <div class="card-box table-responsive">

                    <table id="datatable" class="table table-hover" style="width:100%">
                      <thead>
                        <tr>
                          <th>No</th>
                          <th>Judul Donasi</th>
                          <th>Jenis Kategori</th>
                          <th>Kebutuhan Donasi</th>
                          <th>Donasi Terkumpul</th>
                          <th>Batas Akhir</th>
                          <th>Status</th>
                          <th>Aksi</th>
                        </tr>
                      </thead>

                      <tbody>
                        <?php $no = 0; ?>
                        <?php $__currentLoopData = $data_program_donasi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $program_donasi): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php $no++; ?>
                        <tr>
                          <td><?php echo e($no); ?></td>
                          <td><?php echo e($program_donasi->judul); ?></td>
                          <td><?php echo e($program_donasi->kategori_donasi->nama_kategori); ?></td>
                          <td><?php echo e(rupiah($program_donasi->kebutuhan_dana)); ?></td>
                          <td><?php echo e(rupiah($program_donasi->terdanai)); ?></td>
                          <td><?php echo e($program_donasi->batas_akhir_donasi->format('d M Y')); ?></td>
                          <td>
                            <?php if($program_donasi->batas_akhir_donasi > date('Y-m-d H:i:s') ): ?>
                            <span class="badge badge-success">Aktif</span>
                            <?php else: ?>
                            <span class="badge badge-danger">Non Aktif</span>
                            <?php endif; ?>
                          </td>
                          <td>
                            <form action="<?php echo e(route('program-donasi.destroy', $program_donasi->id)); ?>" method="POST">
                              <?php echo csrf_field(); ?>
                              <?php echo method_field('DELETE'); ?>
                              <div class="btn-group">
                                <a href="<?php echo e(route('program-donasi.show', $program_donasi->id)); ?>" class="btn btn-primary btn-sm">Detail</a>
                                <button type="button" class="btn btn-primary btn-sm dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                  <span class="sr-only">Toggle Dropdown</span>
                                </button>
                                <div class="dropdown-menu">
                                  <a class="dropdown-item" href="<?php echo e(route('program-donasi.edit', $program_donasi->id)); ?>">Edit</a>
                                  <button type="submit" class="dropdown-item" onclick="return confirm('Hapus <?php echo e($title); ?> ?')">Hapus</button>
                                </div>
                              </div>
                            </form>
                          </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      </tbody>
                    </table>

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

<?php echo $__env->make('admin.layouts.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xampp74\htdocs\peduli\resources\views/admin/program-donasi/index.blade.php ENDPATH**/ ?>