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

<main id="main" class="main">
    <div class="container" style="margin-top:5%;">
        <h3>PROFILE REPORT (<?php echo e($start_date); ?> to <?php echo e($end_date); ?>)</h3>
            <table class="table">
            	<?php if(empty($tableItem)): ?>
            		No Data Found
    			<?php else: ?>
	                <thead>
	                    <tr>
	                        <th scope="col">Sr no</th>
	                        <th scope="col">Order Id</th>
	                        <th scope="col">Delivery Date</th>
	                        <th scope="col">City</th>
	                        <th scope="col">Amount</th>
	                        <th scope="col">Placement Price</th>
	                        <th scope="col">Profit</th>
	                        <th scope="col">Agent</th>
	                        <th scope="col">Status</th>
	                    </tr>
	                </thead>
	                <tbody>
	                    <?php $i=0; $placementTotal=0; ?>
	                    <?php $__currentLoopData = $tableItem; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
	                    	<?php $i++; ?>
	                    	<tr>
	                            <td><?php echo e($i); ?></td>
	                            <td><?php echo e($item['uniqueId']); ?></td>
	                            <td><?php echo e($item['delivery_date']); ?></td>
	                            <td><?php echo e($item['delivery_city_name']); ?></td>
	                            <td><?php echo e($item['totalOrderPrice']); ?></td>
	                            <td>
	                                <?php echo e($item['placementTotal']); ?>

	                                <?php $placementTotal +=$item['placementTotal']; ?>
	                            </td>
	                            <td><?php echo e(round($item['profit'],1)); ?>%</td>
	                            <td>
	                                <?php $__currentLoopData = $item['agent_name']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
	                                    <?php echo e($city); ?><br>
	                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
	                            </td>
	                            <td><?php echo e($item['status']); ?></td>
	                        </tr>
	                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>    
	                        
	                    <table class="table">
			                <thead>
			                    <th>
			                        <th>Total Amount to be paid by Client : <?php echo e($placementTotal); ?></th>
			                    </th>
			                </thead>
			            </table>
	                </tbody>
	            <?php endif; ?>    
            </table>
        <a class="btn btn-danger" href="<?php echo e(url('/agent/generateReport')); ?>">Back</a>
    </div>
</main>


<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

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