

<?php $__env->startSection('title','Tambah Transaksi'); ?>

<?php $__env->startSection('content'); ?>

<div class="container" style="max-width:920px">
    <div class="card-modern p-4">
        <h3 class="mb-2">Tambah Transaksi</h3>
        <p class="text-muted-sm">Buat transaksi manual (admin).</p>

        <?php if($errors->any()): ?>
            <div class="alert alert-danger"><ul class="mb-0"><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><li><?php echo e($error); ?></li><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></ul></div>
        <?php endif; ?>

        <form action="<?php echo e(route('transaksi.store')); ?>" method="POST">
            <?php echo csrf_field(); ?>
            <div class="row g-3">
                <div class="col-md-6">
                    <label class="form-label small">Tiket</label>
                    <select name="tiket_id" class="form-control input-rounded" required>
                        <option value="">Pilih Tiket</option>
                        <?php $__currentLoopData = $tikets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tiket): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($tiket->id); ?>" <?php echo e(old('tiket_id') == $tiket->id ? 'selected' : ''); ?>><?php echo e($tiket->event->nama_event); ?> - <?php echo e($tiket->jenis); ?> - Rp <?php echo e(number_format($tiket->harga,0,',','.')); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="col-md-6">
                    <div class="floating-label">
                        <input type="text" name="nama_pembeli" class="input-rounded form-control" placeholder=" " value="<?php echo e(old('nama_pembeli')); ?>" required>
                        <label>Nama Pembeli</label>
                    </div>
                </div>

                <div class="col-md-4">
                    <div class="floating-label">
                        <input type="number" name="jumlah" class="input-rounded form-control" placeholder=" " min="1" value="<?php echo e(old('jumlah',1)); ?>" required>
                        <label>Jumlah Tiket</label>
                    </div>
                </div>

                <div class="col-md-4">
                    <label class="form-label small">Metode Pembayaran</label>
                    <select name="metode_pembayaran" class="form-control input-rounded">
                        <option value="Tunai" <?php echo e(old('metode_pembayaran')=='Tunai' ? 'selected':''); ?>>Tunai</option>
                        <option value="QRIS" <?php echo e(old('metode_pembayaran')=='QRIS' ? 'selected':''); ?>>QRIS</option>
                        <option value="Transfer" <?php echo e(old('metode_pembayaran')=='Transfer' ? 'selected':''); ?>>Transfer</option>
                    </select>
                </div>

                <div class="col-md-4">
                    <label class="form-label small">Status</label>
                    <select name="status" class="form-control input-rounded">
                        <option value="Pending" <?php echo e(old('status')=='Pending' ? 'selected':''); ?>>Pending</option>
                        <option value="Confirmed" <?php echo e(old('status')=='Confirmed' ? 'selected':''); ?>>Confirmed</option>
                        <option value="Rejected" <?php echo e(old('status')=='Rejected' ? 'selected':''); ?>>Rejected</option>
                    </select>
                </div>
            </div>

            <div class="mt-3 d-flex gap-2">
                <button class="btn btn-primary">Simpan</button>
                <a href="<?php echo e(route('transaksi.index')); ?>" class="btn btn-outline-secondary">Batal</a>
            </div>
        </form>
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\tugas pa asur\konser-ticket\resources\views/transaksi/create.blade.php ENDPATH**/ ?>