

    <?php if (isset($component)) { $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AppLayout::class, []); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
        <div class="container mx-auto my-6 px-4">
            <!-- Back Button -->
            <div class="flex justify-between items-center mb-6">
                <a href="<?php echo e(url()->previous()); ?>" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded flex items-center">
                    <i class="fas fa-arrow-left mr-2"></i> Back
                </a>
            </div>

            <!-- Profile Header -->
            <h2 class="text-center text-2xl font-bold mb-6">Delivery Agent Approval Profile  - <?php echo e($singleDeliveryAgentDetails->user_id); ?></h2>

            <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
                <!-- Profile Section -->
                <div class="bg-white shadow-md rounded-lg p-6">
                    <div class="flex flex-col items-center">
                        <img src="<?php echo e($profile); ?>" alt="Profile Photo" class="w-24 h-24 rounded-full mb-4 shadow">
                        <h3 class="text-xl font-semibold"><?php echo e($singleDeliveryAgentDetails->name); ?></h3>
                        <p class="text-gray-600"><?php echo e($singleDeliveryAgentDetails->email); ?></p>
                        <p class="text-gray-600"><?php echo e($singleDeliveryAgentDetails->phone); ?></p>
                        <p class="mt-2 text-sm <?php echo e($singleDeliveryAgentDetails->online_status ? 'text-green-500' : 'text-red-500'); ?>">
                            <?php echo e($singleDeliveryAgentDetails->online_status ? 'Online' : 'Offline'); ?>

                        </p>
                    </div>
                    <div class="mt-4 text-center">
                     <form action="<?php echo e(route('updateApprovalStatus', $singleDeliveryAgentDetails->user_id)); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <label for="approval_status" class="form-label">Approval Status:</label>
                <select name="approval_status" id="approval_status" class="form-select" required>
                    <option value="approved">Approve</option>
                    <option value="rejected">Reject</option>
                </select>

                <div id="reason-container" class="mt-3" style="display: none;">
                    <label for="reason" class="form-label">Reason for Rejection:</label>
                    <textarea name="reason" id="reason" class="form-control" rows="3"></textarea>
                </div>

                <button type="submit" class="btn btn-primary mt-3">Submit</button>
            </form>
            <script>
    document.getElementById('approval_status').addEventListener('change', function () {
        var reasonContainer = document.getElementById('reason-container');
        if (this.value === 'rejected') {
            reasonContainer.style.display = 'block';
        } else {
            reasonContainer.style.display = 'none';
        }
    });
</script>
                </div>
                </div>

                <!-- Documents and Photos Section -->
                <div class="bg-white shadow-md rounded-lg p-6">
                    <h4 class="text-xl font-semibold mb-4">Documents & Photos</h4>

                    <!-- Driver Details -->
                    <div class="mb-6">
                        <h5 class="font-medium text-lg">Driver Details</h5>
                        <table class="table-auto w-full text-sm mt-2">
                            <tbody>
                                <tr><td class="font-semibold">License Number</td><td><?php echo e($singleDeliveryAgentDetails->driving_license_number); ?></td></tr>
                                <tr><td class="font-semibold">License Expiry</td><td><?php echo e($singleDeliveryAgentDetails->driving_license_expiry); ?></td></tr>
                                <tr>
                                    <td colspan="2" class="text-center">
                                        <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($drivingLicenseFront); ?>">View Front</button>
                                        <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($drivingLicenseBack); ?>">View Back</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <!-- PAN Card -->
                    <div class="mb-6">
                        <h5 class="font-medium text-lg">PAN Card</h5>
                        <table class="table-auto w-full text-sm mt-2">
                            <tbody>
                                <tr><td class="font-semibold">Number</td><td><?php echo e($singleDeliveryAgentDetails->pan_card_number); ?></td></tr>
                                <tr>
                                    <td colspan="2" class="text-center">
                                        <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($panCardPhoto); ?>">View Photo</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <!-- Aadhar Card -->
                    <div class="mb-6">
                        <h5 class="font-medium text-lg">Aadhar Card</h5>
                        <table class="table-auto w-full text-sm mt-2">
                            <tbody>
                                <tr><td class="font-semibold">Number</td><td><?php echo e($singleDeliveryAgentDetails->aadhar_card_number); ?></td></tr>
                                <tr>
                                    <td colspan="2" class="text-center">
                                        <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($aadharCardFront); ?>">View Front</button>
                                        <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($aadharCardBack); ?>">View Back</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <!-- Vehicle Information -->
                    <div class="mb-6">
                        <h5 class="font-medium text-lg">Vehicle Information</h5>
                        <table class="table-auto w-full text-sm mt-2">
                            <tbody>
                                <tr><td class="font-semibold">Bike Brand</td><td><?php echo e($singleDeliveryAgentDetails->bike_brand); ?></td></tr>
                                <tr><td class="font-semibold">Model</td><td><?php echo e($singleDeliveryAgentDetails->bike_model); ?></td></tr>
                                <tr><td class="font-semibold">Year</td><td><?php echo e($singleDeliveryAgentDetails->bike_year); ?></td></tr>
                                <tr><td class="font-semibold">Registration Plate</td><td><?php echo e($singleDeliveryAgentDetails->bike_registration_plate); ?></td></tr>
                                <tr>
                                    <td colspan="2" class="text-center">
                                        <?php $__currentLoopData = $vehiclePictures; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $picture): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($picture): ?>
                                                <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($picture); ?>">View <?php echo e(ucfirst($key)); ?></button>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <!-- Vehicle Documents -->
                    <div class="mb-6">
                        <h5 class="font-medium text-lg">Vehicle Documents</h5>
                        <table class="table-auto w-full text-sm mt-2">
                            <tbody>
                                <tr>
                                    <?php $__currentLoopData = $vehicleDocuments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $document): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($document): ?>
                                            <td class="text-center">
                                                <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-1 rounded mt-2 view-image" data-image="<?php echo e($document); ?>">View <?php echo e(ucfirst($key)); ?></button>
                                            </td>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <!-- Modal for Image Preview -->
        <div class="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 hidden" id="imageModal">
            <div class="bg-white rounded-lg shadow-lg p-4 max-w-lg w-full">
                <div class="flex justify-between items-center mb-4">
                    <h5 class="text-lg font-medium">Image Preview</h5>
                    <button class="text-gray-500 hover:text-gray-700" onclick="closeModal()">✖</button>
                </div>
                <img id="modalImage" src="" alt="Image" class="w-full h-auto">
            </div>
        </div>

        <!-- JavaScript for Modal Image Preview -->
        <script>
            document.addEventListener('DOMContentLoaded', function () {
                const imageModal = document.getElementById('imageModal');
                const modalImage = document.getElementById('modalImage');

                document.querySelectorAll('.view-image').forEach(button => {
                    button.addEventListener('click', function () {
                        modalImage.src = this.getAttribute('data-image');
                        imageModal.classList.remove('hidden');
                    });
                });
            });

            function closeModal() {
                document.getElementById('imageModal').classList.add('hidden');
            }
        </script>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da)): ?>
<?php $component = $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da; ?>
<?php unset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da); ?>
<?php endif; ?>

<?php /**PATH C:\php\xampp\htdocs\admin\resources\views/components/delivery_agent_approve_button.blade.php ENDPATH**/ ?>