
<?php $__env->startSection('title', 'Gate Pass Details'); ?>

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-header">
        <div class="d-flex justify-content-between align-items-center">
            <h5 class="card-title mb-0">Gate Pass Details</h5>
            <div class="d-flex gap-2">
                <a href="<?php echo e(route('gatepasses.index')); ?>" class="btn btn-secondary">
                    <i class="fas fa-arrow-left me-2"></i>Back to List
                </a>
            </div>
        </div>
    </div>
    <div class="card-body">
        <?php if(session('success')): ?>
            <div class="alert alert-success"><?php echo e(session('success')); ?></div>
        <?php endif; ?>

        <!-- Basic Information -->
        <div class="row mb-4">
            <div class="col-md-6">
                <h6 class="text-muted mb-3">Basic Information</h6>
                <table class="table table-borderless">
                    <tr>
                        <td class="fw-bold" style="width: 150px;">GP Number:</td>
                        <td><?php echo e($gatePass->gate_pass_number); ?></td>
                    </tr>
                    <tr>
                        <td class="fw-bold">Status:</td>
                        <td>
                            <span class="badge bg-<?php echo e($gatePass->status === 'completed' ? 'success' : ($gatePass->status === 'cancelled' ? 'danger' : 'secondary')); ?>">
                                <?php echo e(ucfirst($gatePass->status)); ?>

                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="fw-bold">PO Number:</td>
                        <td><?php echo e(optional($gatePass->purchaseOrder)->po_number ?? 'N/A'); ?></td>
                    </tr>
                    <tr>
                        <td class="fw-bold">Created Date:</td>
                        <td><?php echo e($gatePass->created_at->format('M d, Y H:i')); ?></td>
                    </tr>
                </table>
            </div>
            <div class="col-md-6">
                <h6 class="text-muted mb-3">Vehicle Details</h6>
                <table class="table table-borderless">
                    <tr>
                        <td class="fw-bold" style="width: 150px;">Vehicle Number:</td>
                        <td><?php echo e($gatePass->vehicle_no); ?></td>
                    </tr>
                    <tr>
                        <td class="fw-bold">Driver Name:</td>
                        <td><?php echo e($gatePass->driver_name); ?></td>
                    </tr>
                </table>
            </div>
        </div>

        <!-- Items -->
        <div class="row mb-4">
            <div class="col-12">
                <h6 class="text-muted mb-3">Items</h6>
                <div class="table-responsive">
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Item</th>
                                <th>PO Quantity</th>
                                <th>DN Quantity</th>
                                <th>Unit</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__empty_1 = true; $__currentLoopData = $gatePass->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td><?php echo e($index + 1); ?></td>
                                <td><?php echo e(optional($item->item)->name ?? 'N/A'); ?></td>
                                <td><?php echo e(number_format(optional($item->purchaseOrderItem)->quantity ?? 0, 2)); ?></td>
                                <td><?php echo e(number_format($item->dn_quantity, 2)); ?></td>
                                <td><?php echo e(optional($item->item->uom)->name ?? 'N/A'); ?></td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="5" class="text-center text-muted">No items found</td>
                            </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </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:\laragon\www\habibcables-ERP\resources\views\gate_passes\show.blade.php ENDPATH**/ ?>