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

    <main id="main" class="main">
        <div class="container" style="margin-top:5%;">
            <h3>AGENT : <?php echo e($agents->name); ?></h3>
            <table class="table">
                <?php if($agent_assinged->isEmpty()): ?>
                    No Data Found
                <?php else: ?>    
                    <thead>
                        <tr>
                            <th scope="col">Sr no</th>
                            <th scope="col">Order Id</th>
                            <th scope="col">Product Name</th>
                            <th scope="col">Total Price</th>
                            <th scope="col">Assign Date</th>
                            <th scope="col">Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 0; $total=0;?>
                        <?php $__currentLoopData = $agent_assinged; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $agent_assingeds): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if($agent_assingeds->status == "D"): ?>
                                <?php $i++; ?>
                                <tr>
                                    <th scope="row"><?php echo e($i++); ?></th>
                                    <td><?php echo e($agent_assingeds->agent_order_id); ?></td>
                                    <td>
                                        <?php
                                            $printedProducts = [];
                                        ?>
                                        <?php $__currentLoopData = $assigned_agent_product_map; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product_mapeds): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($product_mapeds->agent_assinged_id == $agent_assingeds->id): ?>
                                                <?php $__currentLoopData = $agent_product_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if($product->id == $product_mapeds->product_id && !in_array($product->id, $printedProducts)): ?>
                                                        <?php echo e($product->item); ?><br>
                                                        <?php
                                                            $printedProducts[] = $product->id; 
                                                        ?>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </td>
                                    <td>
                                        <?php echo e($agent_assingeds->totalPrice); ?>

                                        <?php $total +=$agent_assingeds->totalPrice; ?>
                                    </td>
                                    <td>
                                        <?php echo e($agent_assingeds->created_at); ?>

                                    </td>
                                    <td>
                                        DELIVERED
                                    </td>
                                </tr>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                    <table>
                        <tbody>
                            <tr>
                                <td><b>TOTAL PAYMENTS :</b></td>
                                <td><?php echo e($total); ?></td>
                            </tr>
                        </tbody>
                    </table>
                <?php endif; ?>    
            </table>
            <a class="btn btn-danger" href="<?php echo e(url('/admin/report')); ?>">Back</a>
        </div>
    </main>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/rightflorist/public_html/ofadmin.rightflorist.org/resources/views/admin/reportSearch.blade.php ENDPATH**/ ?>