

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
        <h4 class="card-title">Pending Payment Approval</h4>
        <div class="table-responsive">
            <table class="table table-bordered" id="customers-table">
                    <thead>
                        <tr>
                            <th>Amount</th>
                            <th>Remark</th>
                            <th>Project/Sector/Block/Plot</th>
                            <th>Created At</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>

<div class="card">
    <div class="card-body">
        <h4 class="card-title">Pending Plot Booking Report</h4>
        <div class="table-responsive">
            <table class="table table-bordered" id="customers-table2">
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>Name</th>
                            <th>Username</th>
                            <th>Plot/Block/Sector/Project</th>
                            <th>Created At</th>
                            <th>Updated At</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>
<div class="card">
    <div class="card-body">
        <h4 class="card-title">Pending Customer Due Date Report</h4>
        <div class="table-responsive">
            <table class="table table-bordered" id="customers-table3">
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>Amount</th>
                            <th>Plot/Block/Sector/Project</th>
                            <th>Business Partner Name</th>
                            <th>Business Partner ID</th>
                            <th>Business Partner Mobile</th>
                            <th>Customer Name</th>
                            <th>Customer Mobile</th>
                            <th>Due Date</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>
<div class="card">
    <div class="card-body">
        <h4 class="card-title">Pending Reward Salary</h4>
        <div class="table-responsive">
            <table class="table table-bordered" id="customers-table4">
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Rank</th>
                            <th>Level</th>
                            <th>Amount</th>
                            <th>Month</th>
                            <th>Type</th>
                            <th>Date</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>




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

<?php $__env->startSection('javascript'); ?>
    <script>
        $('#customers-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/admin/payments/anydataPendingpaymentapproval',
                dom: 'Blfrtip',
                'pageLength': 30,
                'lengthMenu': [ [10, 30, 50, -1], [10, 30, 50, "All"] ],
                'buttons': [
                            'copy', 'csv', 'excel', 'pdf', 'print'
                        ],
                'columns': [
                    { data: 'amount', name: 'amount' },
                    { data: 'comment', name: 'comment' },
                    { data: 'dealName', name: 'dealName' },
                    { data: 'created_at', name: 'created_at' },
                    { data: 'action', name: 'action' }
                ],
                'order': [[3, 'asc']],
                drawCallback: function( settings ) {
                  },
                initComplete: function() {
                    
                }
            });

        $('#customers-table2').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/admin/deals/anydataPendingplotdeals',
                dom: 'Blfrtip',
                'pageLength': 30,
                'lengthMenu': [ [10, 30, 50, -1], [10, 30, 50, "All"] ],
                'buttons': [
                            'copy', 'csv', 'excel', 'pdf', 'print'
                        ],
                'columns': [
                    { data: 'id', name: 'id' },
                    { data: 'full_name', name: 'full_name' },
                    { data: 'username', name: 'username' },
                    { data: 'name', name: 'name' },
                    { data: 'created_at', name: 'created_at' },
                    { data: 'updated_at', name: 'updated_at' },
                    { data: 'action', name: 'action' }
                ],
                'order': [[1, 'asc']],
                drawCallback: function( settings ) {
                    openModal();
                  },
                initComplete: function() {
                    
                }
            });
            

            function openModal(){
                $('button.cancelDeal').click(function(){
                  $('form#cancel_payment').attr('action', $(this).attr('data-url'));
                  $('#loadModalAjax').modal({show:true});
                });
                
                $('.activate').click(function(){
                    var ele = $(this);
                    $.ajax({
                       url: '<?php echo e(url('/')); ?>/admin/deals/ajax_update/' + $(this).attr('data-id'),
                       type: 'PUT',
                       data: { "_token": "<?php echo e(csrf_token()); ?>", id : $(this).attr('data-id'), active : $(this).attr('data-active') },
                       success: function(response) {
                         if(response == true){
                            if(ele.attr('data-active') == 1){
                                ele.removeClass('btn-warning').addClass('btn-danger').attr('data-active','0').find('span.ladda-label').text('Deactivate');
                            }else{
                                ele.removeClass('btn-danger').addClass('btn-warning').attr('data-active','1').find('span.ladda-label').text('Activate');
                            }
                         }else{
                            alert('error'+ response);
                         }
                       }
                    });
                });              
            }
        $('#customers-table3').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/admin/pendindDueDateCust',
                dom: 'Blfrtip',
                'pageLength': 30,
                'lengthMenu': [ [10, 30, 50, -1], [10, 30, 50, "All"] ],
                'buttons': [
                            'copy', 'csv', 'excel', 'pdf', 'print'
                        ],
                'columns': [
                    { data: 'id', name: 'id' },
                    { data: 'amount', name: 'amount' },
                    { data: 'name', name: 'name' },
                    { data: 'full_name', name: 'full_name' },
                    { data: 'username', name: 'username' },
                    { data: 'mobileno', name: 'mobileno' },
                    { data: 'c_full_name', name: 'c_full_name' },
                    { data: 'c_mobileno', name: 'c_mobileno' },
                    { data: 'due_date', name: 'due_date' },
                ],
                'order': [[8, 'asc']],
                initComplete: function() {
                    
                }
            });
        
        $('#customers-table4').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/incomes/salaryWalletAnyData',
                dom: 'frtip',
                'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
                columns: [
                    { data: 'id', name: 'id' },
                    { data: 'full_name', name: 'full_name' },
                    { data: 'username', name: 'username' },
                    { data: 'income_amount', name: 'income_amount' },
                    { data: 'orig_amount', name: 'orig_amount' },
                    { data: 'credit_debit', name: 'credit_debit', searchable:false },
                    { data: 'created_at', name: 'created_at' },
                    { data: 'remark', name: 'remark' }
                ],
                "columnDefs": [
                    {
                        "render": function ( data, type, row, meta) {
                            return meta.row + meta.settings._iDisplayStart + 1;
                         },
                        "targets": 0
                    },
                    {
                        "render": function ( data, type, row ) {
                        if(data==0){
                            return '<span class="label label-success">Credit</span>';
                        }else{
                            return '<span class="label label-danger">Debit</span>';
                        }
                        },
                        "targets": 6
                    },
                    {
                        "render": function ( data, type, row ) {
                        return data.replace(/\/\/\/\/\/\/\/\/\/\/\/\/\//g, '<br />')
                        },
                        "targets": 7
                    }
                ],
                'order': [[1, 'asc']],
                drawCallback: function( settings ) {
                    openModal();
                  }
            });


    </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/dashboards.blade.php ENDPATH**/ ?>