<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Data Transaksi</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">

<div class="container mt-5">

    <h2 class="mb-4 text-center">📋 Data Transaksi</h2>

    
    <?php if(session('success')): ?>
        <div class="alert alert-success text-center"><?php echo e(session('success')); ?></div>
    <?php elseif(session('error')): ?>
        <div class="alert alert-danger text-center"><?php echo e(session('error')); ?></div>
    <?php endif; ?>

    
    <div class="mb-3 text-end">
        <a href="<?php echo e(route('transaksi.create')); ?>" class="btn btn-primary">+ Tambah Transaksi</a>
    </div>

    
    <div class="card shadow-sm">
        <div class="card-body table-responsive">
            <table class="table table-bordered table-striped align-middle">
                <thead class="table-dark">
                    <tr class="text-center">
                        <th>No</th>
                        <th>Nama Jamaah</th>
                        <th>Tanggal</th>
                        <th>Metode Pembayaran</th>
                        <th>Total (Rp)</th>
                        <th>Keterangan</th>
                        <th>Aksi</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $transaksis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td class="text-center"><?php echo e($loop->iteration); ?></td>
                            <td><?php echo e($t->user->name ?? '-'); ?></td>
                            <td><?php echo e(\Carbon\Carbon::parse($t->tanggal)->format('d-m-Y')); ?></td>
                            <td><?php echo e($t->metode_pembayaran); ?></td>
                            <td>Rp <?php echo e(number_format($t->total, 0, ',', '.')); ?></td>
                            <td><?php echo e($t->keterangan ?? '-'); ?></td>
                            <td class="text-center">
                                <form action="<?php echo e(route('transaksi.destroy', $t->id)); ?>" method="POST" onsubmit="return confirm('Yakin hapus transaksi ini?')">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button class="btn btn-sm btn-danger">Hapus</button>
                                </form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="7" class="text-center text-muted">Belum ada data transaksi.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>

</div>

</body>
</html>
<?php /**PATH C:\xampp\htdocs\travel-app\resources\views/transaksi/index.blade.php ENDPATH**/ ?>