

<?php $__env->startSection('title', 'Detail Pesanan'); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-12">
        <h2 class="mb-4">
            <a href="<?php echo e(route('menu.orders')); ?>" class="text-decoration-none">
                <i class="fas fa-arrow-left me-2"></i>
            </a>
            Detail Pesanan #<?php echo e($order->id); ?>

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

<div class="row">
    <div class="col-lg-8">
        <div class="card mb-4">
            <div class="card-body">
                <h5 class="card-title mb-4">Item Pesanan</h5>
                
                <?php $__currentLoopData = $order->orderItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="row align-items-center border-bottom py-3">
                    <div class="col-md-2">
                        <?php if($item->menu->image): ?>
                        <img src="<?php echo e(asset('images/menus/' . $item->menu->image)); ?>" class="img-fluid rounded" alt="<?php echo e($item->menu->name); ?>">
                        <?php else: ?>
                        <div class="bg-secondary rounded p-2 text-center">
                            <i class="fas fa-utensils text-white"></i>
                        </div>
                        <?php endif; ?>
                    </div>
                    <div class="col-md-4">
                        <h6 class="mb-0"><?php echo e($item->menu->name); ?></h6>
                        <small class="text-muted">Rp <?php echo e(number_format($item->price, 0, ',', '.')); ?> per item</small>
                    </div>
                    <div class="col-md-2 text-center">
                        <span><?php echo e($item->quantity); ?>x</span>
                    </div>
                    <div class="col-md-4 text-end">
                        <strong>Rp <?php echo e(number_format($item->price * $item->quantity, 0, ',', '.')); ?></strong>
                    </div>
                </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>
    
    <div class="col-lg-4">
        <div class="card mb-4">
            <div class="card-body">
                <h5 class="card-title">Informasi Pesanan</h5>
                <hr>
                <div class="mb-3">
                    <label class="text-muted small">Status</label>
                    <div>
                        <span class="status-badge status-<?php echo e($order->status); ?>">
                            <?php switch($order->status):
                                case ('pending'): ?> Menunggu <?php break; ?>
                                <?php case ('confirmed'): ?> Dikonfirmasi <?php break; ?>
                                <?php case ('processing'): ?> Diproses <?php break; ?>
                                <?php case ('completed'): ?> Selesai <?php break; ?>
                                <?php case ('cancelled'): ?> Dibatalkan <?php break; ?>
                            <?php endswitch; ?>
                        </span>
                    </div>
                </div>
                <div class="mb-3">
                    <label class="text-muted small">Tanggal Pesanan</label>
                    <div><?php echo e($order->created_at->format('d M Y, H:i')); ?></div>
                </div>
<?php if($order->table_number): ?>
                <div class="mb-3">
                    <label class="text-muted small">No. Meja</label>
                    <div>
                        <i class="fas fa-chair me-1"></i>
                        <?php echo e($order->table_number); ?>

                    </div>
                </div>
                <?php endif; ?>
                <?php if($order->payment_method): ?>
                <div class="mb-3">
                    <label class="text-muted small">Metode Pembayaran</label>
                    <div>
                        <i class="fas fa-credit-card me-1"></i>
                        <?php echo e($order->payment_method === 'cash' ? 'Cash' : 'QRIS'); ?>

                    </div>
                </div>
                <?php endif; ?>
                <?php if($order->notes): ?>
                <div class="mb-3">
                    <label class="text-muted small">Catatan</label>
                    <div><?php echo e($order->notes); ?></div>
                </div>
                <?php endif; ?>
            </div>
        </div>
        
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">Total Pembayaran</h5>
                <hr>
                <div class="d-flex justify-content-between mb-2">
                    <span>Subtotal</span>
                    <span>Rp <?php echo e(number_format($order->total_price, 0, ',', '.')); ?></span>
                </div>
                <div class="d-flex justify-content-between mb-3">
                    <span>Pajak (10%)</span>
                    <span>Rp <?php echo e(number_format($order->total_price * 0.1, 0, ',', '.')); ?></span>
                </div>
                <hr>
                <div class="d-flex justify-content-between">
                    <strong>Total</strong>
                    <strong class="text-success">Rp <?php echo e(number_format($order->total_price * 1.1, 0, ',', '.')); ?></strong>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\HP\MenuQr\resources\views/user/order-detail.blade.php ENDPATH**/ ?>