

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
    <h4 class="card-title">Approve Bills</h4>
    <h6 class="card-subtitle"></h6>
<div class="row">
    <!-- Column -->
    <div class="col-lg-3 col-md-6">
        <div class="card" style="margin: 0 0 30px;">
            <div class="card-body">
                <div class="d-flex flex-row">
                    <div class="m-l-10 align-self-center">
                        <h3 class="m-b-0 font-light"><?php echo e(IND_money_format($totalAmount)); ?></h3>
                        <h5 class="text-muted m-b-0">Total Approved</h5></div>
                </div>
                
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-6">
        <div class="card" style="margin: 0 0 30px;">
            <div class="card-body">
                <div class="d-flex flex-row">
                    <div class="m-l-10 align-self-center">
                        <h3 class="m-b-0 font-light"><?php echo e(IND_money_format($totalAmountPending)); ?></h3>
                        <h5 class="text-muted m-b-0">Total Pending</h5></div>
                </div>
                
            </div>
        </div>
    </div>
</div>


        <div class="table-responsive">
            <table class="table table-bordered" id="users-table">
                    <thead>
                        <tr>
                            <th>S. No.</th>                            
                            <th>Type</th>
                            <th>KW</th>
                            <th>Amount</th>
                            <th>Paid Amount</th>
                            <th>Balance Amount</th>
                            <th>Business Partner ID</th>
                            <th>Business Partner Name</th>
                            <th>Dealer Name</th>
                            <th>Admin Comment</th>
                            <th>Created On</th>
                            <th>Status</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>

<div class="modal fade" id="loadModalAjax" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: none;" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
    </div>
    <!-- /.modal-content -->
   </div>
  <!-- /.modal-dialog -->
</div>

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

<?php $__env->startSection('javascript'); ?>
    <script>
        var t = $('#users-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/admin/users/donationRcvdAnyData',
                dom: 'Bfrtip',
                'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
                columns: [
                    { data: 'id', name: 'id', searchable:false },
                    { data: 'kw_type', name: 'kw_type' },
                    { data: 'kw', name: 'kw' },
                    { data: 'amount', name: 'amount' },
                    { data: 'paid_amount', name: 'paid_amount' },
                    { data: 'balance_amount', name: 'balance_amount' },
                    { data: 'username', name: 'username' },
                    { data: 'full_name', name: 'full_name' },
                    { data: 'dealer_name', name: 'dealer_name' },
                    { data: 'admin_comment', name: 'admin_comment' },
                    { data: 'updated_at', name: 'updated_at', searchable:false },
                    { data: 'status', name: 'status' },
                    { data: 'action', name: 'action' },
                ],
                "columnDefs": [
                    {
                        "render": function ( data, type, row, meta) {
                            return meta.row + meta.settings._iDisplayStart + 1;
                         },
                        "targets": 0
                    },
                    // {
                    //     "render": function ( data, type, row ) {
                    //         return data.replace(".00", "")+'%';
                    //     },
                    //     "targets": 3
                    // },

                    {
                        "render": function ( data, type, row ) {
                        if(data==0){
                            return '<span class="table-primary">Pending</span>';
                        }else if(data==2){
                            return '<span class="table-danger">Declined</span>';
                        }else{
                            return '<span class="table-success">Approved</span>';
                        }
                        },
                        "targets": 11
                    }
                ],
                'order': [[1, 'asc']],
                drawCallback: function( settings ) {
                    openModal();
                  }
            });


            function openModal(){
              $('.openModal').click(function(){
              	 $('#loadModalAjax .modal-content').load('<?php echo e(url('/')); ?>/users/' + $(this).attr('data-id'),function(result){
            	    $('#loadModalAjax').modal({show:true});
                    //init_validation('#updateStudentForm', rules, messages);
            	   });
              });
              $('.openModalInvoices').click(function(){
              	 $('#loadModalAjax .modal-content').load('/student_invoices_modal.php?id=' + $(this).attr('data-id'),function(result){
            	    $('#loadModalAjax').modal({show:true});
                    //init_validation('#updateStudentForm', rules, messages);
            	   });
              });
            }

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

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\xampp\htdocs\yeselectricv.loc\resources\views/admin/users/donationRcvd.blade.php ENDPATH**/ ?>