
<?php $__env->startSection('css-content'); ?>
<style>
.deposit-summary{
    margin-bottom:30px;
}

.summary-main-card{
    background:#2f76ea;
    color:#fff;
    padding:25px;
    border-radius:6px;
    box-shadow:0 2px 8px rgba(0,0,0,.12);
}

.summary-title{
    font-size:18px;
    font-weight:600;
}

.summary-amount{
    font-size:38px;
    font-weight:700;
    margin:5px 0;
}

.summary-count{
    font-size:14px;
    opacity:.9;
}

.summary-box{
    background:#fff;
    border-radius:6px;
    padding:20px;
    box-shadow:0 2px 8px rgba(0,0,0,.12);
    height:100%;
}

.summary-box h5{
    margin-bottom:10px;
    font-size:16px;
    font-weight:600;
}

.summary-box h3{
    margin-bottom:10px;
    font-size:30px;
    font-weight:700;
}

.summary-box p{
    margin:0;
    color:#6c757d;
}
</style>
<?php $__env->stopSection(); ?>
 <?php $__env->startSection('content'); ?>
<div class="card mx-auto" style="width: 65%;">
      
        <?php
$date = dateYYYYMMDD(request('date')) ?? '';
?>
        <!-- /.card-header -->
        <div class="card-body">
            
            
                  <?php
                    $totalAmount = $lists->sum('amount');
                    $totalTransactions = $lists->count();
                
                    $manualAmount = $lists->filter(function ($item) {
                        return stripos($item->remark, 'admin') !== false;
                    })->sum('amount');
                
                    $manualCount = $lists->filter(function ($item) {
                        return stripos($item->remark, 'admin') !== false;
                    })->count();
                
                    $autoAmount = $lists->filter(function ($item) {
                        return stripos($item->remark, 'admin') === false;
                    })->sum('amount');
                
                    $autoCount = $lists->filter(function ($item) {
                        return stripos($item->remark, 'admin') === false;
                    })->count();
                ?>
                
                <div class="deposit-summary mb-4">
                
                    <div class="d-flex justify-content-between align-items-center mb-3 mx-5">
                        <h4 class="mb-0">Withdraw Summary</h4>
                    
                    <?php
                        $defaultDateRange =
                            request('date_range') ??
                            now()->startOfMonth()->format('m/d/Y') . ' - ' .
                            now()->endOfMonth()->format('m/d/Y');
                    ?>
                        <form method="GET" id="filterForm">
                            <input type="text"
                                   name="date_range"
                                   id="date_range"
                                   value="<?php echo e($defaultDateRange); ?>"
                                   class="form-control"
                                   style="width: 250px;">
                        </form>
                    </div>
                
                    <!-- Total Summary -->
                    <div class="summary-main-card">
                        <div class="summary-title">Total Withdraw Report</div>
                    
                        <div class="summary-amount">
                            ₹<?php echo e(number_format($total_amount, 2)); ?>

                        </div>
                    
                        <div class="summary-count">
                            Total Transactions: <?php echo e($total_transactions); ?>

                        </div>
                    </div>
                    
                    <div class="row mt-4">
                    
                        <!-- Pending -->
                        <div class="col-md-4 mb-3">
                            <div class="summary-box ">
                                <h5>PENDING</h5>
                    
                                <h3>
                                    ₹<?php echo e(number_format($pending_amount, 2)); ?>

                                </h3>
                    
                                <p>
                                    Transactions: <?php echo e($pending_count); ?>

                                </p>
                            </div>
                        </div>
                    
                        <!-- Successful -->
                        <div class="col-md-4 mb-3">
                            <div class="summary-box">
                                <h5>SUCCESSFUL</h5>
                    
                                <h3>
                                    ₹<?php echo e(number_format($success_amount, 2)); ?>

                                </h3>
                    
                                <p>
                                    Transactions: <?php echo e($success_count); ?>

                                </p>
                            </div>
                        </div>
                    
                        <!-- Cancelled -->
                        <div class="col-md-4 mb-3">
                            <div class="summary-box">
                                <h5>CANCELLED</h5>
                    
                                <h3>
                                    ₹<?php echo e(number_format($cancelled_amount, 2)); ?>

                                </h3>
                    
                                <p>
                                    Transactions: <?php echo e($cancelled_count); ?>

                                </p>
                            </div>
                        </div>
                    
                    </div>
            
            <div id="example1_wrapper" class=" dt-bootstrap4">
                <div class="row">
                    <div class="col-sm-12">
                          <div class='tablescroll'>
                            <div class="table-responsive">
                        <table id="example1" class="table table-bordered table-striped dataTable" role="grid"
                               aria-describedby="example1_info">
                            <thead>
                            <tr role="row">
                                <th class="sorting_asc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-sort="ascending"
                                    aria-label="Rendering engine: activate to sort column descending"
                                    style="width: 60px;">#
                                </th>
                                <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                    UserName
                                </th>
                                <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                    Mobile Number
                                </th>
                                <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                    Date
                                </th>
                                <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                    Amount
                                </th>
                                <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                                    aria-label="Browser: activate to sort column ascending" style="width: 207px;">
                                    Withdraw Status
                                </th>
                               
                            </tr>
                            </thead>
                            <tbody>
                              <?php 
                    $page=1;
                    if(Request::input('page'))
                    $page=Request::input('page');
                    $sort = $lists->perPage();
                  ?>
                  <?php $__empty_1 = true; $__currentLoopData = $lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                
                        <tr>
                          <td><?php echo e($sort*($page-1)+($key+1)); ?></td>
                          <td>
                            <?php echo e(isset($list->username) ? $list->username->name : ''); ?>

                           
                          </td>
                          <td>
                           
                           <a href="https://wa.me/<?php echo e(isset($list->username) ?$list->username->mobile_number : ''); ?>" target="_blank" style="text-decoration:underline"><b><?php echo e(isset($list->username) ?$list->username->mobile_number : ''); ?></b></a>
                          </td>
                          <td>
                            <?php echo e(isset($list->created_at) ?$list->created_at : ''); ?>

                           
                          </td>
                          
                          <td>
                            <?php echo e($list->amount); ?>


                          </td>
                          <td>
                            <?php if($list->withdraw_status_id == 1): ?>
                        
                                <span class="badge bg-warning text-white">
                                    Pending
                                </span>
                        
                            <?php elseif($list->withdraw_status_id == 2): ?>
                        
                                <span class="badge bg-success text-white">
                                    Successful
                                </span>
                        
                            <?php elseif($list->withdraw_status_id == 3): ?>
                        
                                <span class="badge bg-danger text-white">
                                    Cancelled
                                </span>
                        
                            <?php endif; ?>
                        </td>
                         
                      
                        </tr>
                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                  <tr>
                    <td colspan="5">Record not found </td>
                  </tr>
                  <?php endif; ?>
                            </tbody>
                   </table>
                   </div>
                   </div>
                    <div class="row">
              <div class="col-md-6 text-left" style="margin: 20px 0px;">
                Showing  <?php echo e($lists->firstItem()); ?> to <?php echo e($lists->lastItem()); ?> of <?php echo e($lists->total()); ?>

              </div>
              <div class="col-md-6 text-right">
                <?php echo $lists->appends(request()->input())->links(); ?>

              </div>
            </div>
                  </div>
                </div>
              </div>
            </div>
          </div>


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

<script>
$(function () {

    $('#date_range').daterangepicker({
        autoUpdateInput: false,
        locale: {
            cancelLabel: 'Clear',
            format: 'MM/DD/YYYY'
        },
        ranges: {
           'Today': [moment(), moment()],
           'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
           'Last 7 Days': [moment().subtract(6, 'days'), moment()],
           'Last 30 Days': [moment().subtract(29, 'days'), moment()],
           'This Month': [moment().startOf('month'), moment().endOf('month')],
           'Last Month': [
               moment().subtract(1, 'month').startOf('month'),
               moment().subtract(1, 'month').endOf('month')
           ]
        }
    });

    $('#date_range').on('apply.daterangepicker', function(ev, picker) {
        $(this).val(
            picker.startDate.format('MM/DD/YYYY') + ' - ' +
            picker.endDate.format('MM/DD/YYYY')
        );

        $('#filterForm').submit();
    });

    $('#date_range').on('cancel.daterangepicker', function(ev, picker) {
        $(this).val('');
        $('#filterForm').submit();
    });

});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.main-layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/profcymadev/public_html/onebet.profcymadev.in/resources/views/admin/report/deductmoney.blade.php ENDPATH**/ ?>