

<?php $__env->startSection('title'); ?>
    Developer Balance
<?php $__env->stopSection(); ?>

<?php $__env->startSection('style'); ?>
    <style>
    /*filter on top*/
        tfoot {
            display: table-header-group;
        }
        thead {
            display: table-row-group;
        }
        select.fstyle { width: 100px }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                <span class="fa fa-building"></span> Developer Balance
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-building"></i> Admin Panel</a></li>
                <li class="active">Developer Balance</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content" style=" padding-bottom: 10%;">
            <div class="page-header">
                <a href="<?php echo e(route('dashboard')); ?>" class="btn btn-primary"><i class="fa fa-backward"></i> Back</a>
            </div>

            <table class="table table-hover" id="user_table" width="100%">
                <thead>
                <tr style="background: grey ;color:#fff; font-weight: bold">
                    <td>ID</td>
                    <td>Developer</td>
                    <td>Project</td>
                    <td>Client Name</td>
                    <td>Blk / Lot</td>
                    <td style="text-align: center">Contract Amount</td>
                    <td style="text-align: center">Receivable Amount</td>
                    <td style="text-align: center" >Total Received</td>
                    <td style="text-align: center">Balance</td>
                </tr>
                </thead>
                <?php $__currentLoopData = $balances; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $balance): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($balance->rcvd_id); ?></td>
                        <td><?php echo e($balance->dev_name); ?></td>
                        <td><?php echo e($balance->prj_name); ?></td>
                        <td><?php echo e($balance->client_name); ?></td>
                        <td style="text-align: center"><?php echo e($balance->blk); ?> / <?php echo e($balance->lot); ?></td>
                        <td style="text-align: right"><?php echo e(number_format($balance->contract_amount,2)); ?></td>
                        <td style="text-align: right">
                            <?php echo e(number_format($balance->sales_comm,2)); ?>

                        </td>
                        <td style="text-align: right">
                            <?php echo e(number_format($balance->ttl_receive,2)); ?>

                        </td>
                        <td style="text-align: right">
                            <?php if($balance->rcvd_balance < 0): ?>
                                0.00
                                
                            <?php else: ?>
                                <?php echo e(number_format($balance->rcvd_balance,2)); ?>

                            <?php endif; ?>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tfoot>
                        <tr>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                        </tr>
                    </tfoot>
            </table>

            <?php if(Session('info')): ?>
                <div class="row">
                    <div class="col-md-6 col-md-offset-3 text-center">
                        <div class="tem alert alert-success navbar-fixed-bottom"><span class="glyphicon glyphicon-ok-circle"></span> <?php echo e(Session('info')); ?></div>
                    </div>
                </div>
            <?php endif; ?>
        </section>

    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script>
        $(document).ready(function() {
            $('#user_table').DataTable( {
                "bDestroy": true,
                "order": [[ 0, "desc" ]],
                initComplete: function () {
                    this.api().columns([1,2,3]).every( function () {
                        var column = this;
                        var select = $('<select class="fstyle" id="lnOpt"><option value=""></option></p>')
                            .appendTo( $(column.footer()).empty() )
                            .on( 'change', function () {
                                var val = $.fn.dataTable.util.escapeRegex(
                                    $(this).val()
                                );
                                column
                                    .search( val ? '^'+val+'$' : '', true, false )
                                    .draw();
                            } );

                        column.data().unique().sort().each( function ( d, j ) {
                            select.append( '<option value="'+d+'">'+d+'</option>' )
                        } );
                    } );
                }
            });
        });
        /*$("#btnAdd").on("click", function(){
            $('#addModal').modal('toggle');
        });*/
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>