/home2/mshostin/public_html/storage/framework/views/db4fc3947d57bfc75ba050331db04dd078f4eebc.php
<?php $__env->startSection('content'); ?>

<div class="row">
    <div class="col-md-12">
        <div class="card ">
            <div class="card-header">
                <div class="row">
                    <div class="col-7">
                        <h4 class="card-title"><?php echo e($ref->name); ?></h4>
                        <p><?php echo e($ref->phone); ?></p>
                        <p><?php echo e($ref->area); ?></p>
                        <h2>All Clients of  <?php echo e($ref->name); ?></h2>
                    </div>
                    <div class="col-2">
                        <a class="btn btn-primary text-white" target="_blank" href="<?php echo e(route('reference.print.ledger',$ref->id)); ?>">Print Ledger</a>
                    </div>
                    <div class="col-2">
                        <a class="btn btn-primary text-white" target="_blank" href="<?php echo e(route('reference.print.report',$ref->id)); ?>">Print Outstanding Report</a>
                    </div>
                </div>
            </div>
            <div class="card-body">
                <?php echo $__env->make('alerts.success', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                <div class="">
                    <table class="table tablesorter " id="">
                        <thead class=" text-primary">
                            <th>Name</th>
                            <th>Telephone</th>
                            <th>Balance</th>
                            <th>Purchases</th>
                            <th>Total Payment</th>
                            <th>Last purchase</th>
                            <th>Action</th>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $ref->client; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $refs): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($refs->name); ?></td>
                                    <td>
                                        <?php echo e($refs->phone); ?>

                                    </td>
                                    <td>
                                        <?php if(round($refs->balance) > 0): ?>
                                        <span class="text-success"><?php echo e($refs->balance); ?></span>
                                        <?php elseif(round($refs->balance) < 0.00): ?>
                                            <span class="text-danger"><?php echo e($refs->balance); ?></span>
                                        <?php else: ?>
                                            <?php echo e($refs->balance); ?>

                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($refs->sales->count()); ?></td>
                                <td><?php echo e($refs->transactions->sum('amount')); ?></td>
                                <td><?php echo e((empty($refs->sales)) ? date('d-m-y', strtotime($refs->sales->reverse()->first()->created_at)) : 'N/A'); ?></td>
                                <td class="td-actions text-right">
                                    <a href="<?php echo e(route('clients.show', $refs)); ?>" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="More Details">
                                        <i class="tim-icons icon-zoom-split"></i>
                                    </a>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="card-footer py-4">
                <nav class="d-flex justify-content-end" aria-label="...">
                    
                </nav>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', ['page' => 'Reference', 'pageSlug' => 'reference', 'section' => 'reference'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/mshostin/public_html/resources/views/reference/show.blade.php ENDPATH**/ ?>