<?php $__env->startSection('title','Claim Report Summary | '); ?>
<?php $__env->startSection('content'); ?>
<!-- Content Header (Page header) -->
<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1 class="m-0">Claim Report Summary</h1>
            </div><!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="#">Home</a></li>
                    <li class="breadcrumb-item active">Claim Report</li>
                </ol>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->

<section class="content">
    <div class="container-fluid">
        <form id="report_form" class="hide_in_print">
            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-6 col-lg-4">
                            <div class="form-group">
                                <label>Report Type:</label>
                                <select name="report_type" id="report_type"
                                    class="custom-select <?php if( $errors->has('report_type')): ?> is-invalid border-danger  <?php endif; ?>"
                                    style="width: 100%;">
                                    <option value="">Select Report Type</option>
                                    <?php
                                    $report_type = getReportType();
                                    ?>
                                    <?php $__currentLoopData = $report_type; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($key); ?>" <?php if(old('report_type')==$key): ?>) <?php echo e(__('selected')); ?>

                                        <?php endif; ?>><?php echo e($value); ?>

                                    </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-3 col-lg-4 date-column">
                            <div class="form-group">
                                <label>From Date:</label>
                                <input type="date" class="form-control" value="<?php echo e(date('Y-m-d')); ?>" name="from_date"
                                    id="from_date" max="<?php echo e(date('Y-m-d')); ?>">
                            </div>
                        </div>
                        <div class="col-md-3 col-lg-4 date-column">
                            <div class="form-group">
                                <label>To Date:</label>
                                <input type="date" class="form-control" name="to_date" value="<?php echo e(date('Y-m-d')); ?>"
                                    id="to_date" max="<?php echo e(date('Y-m-d')); ?>">
                            </div>
                        </div>
                        <div class="col-md-3 col-lg-4 month-column">
                            <div class="form-group">
                                <label for="month_from">From Month:</label>
                                <input type="month" class="form-control" name="from_month" value="<?php echo e(date('Y-m')); ?>"
                                    id="month_from" max="<?php echo e(date('Y-m')); ?>">
                            </div>
                        </div>
                        <div class="col-md-3 col-lg-4 month-column">
                            <div class="form-group">
                                <label for="month_to">To Month:</label>
                                <input type="month" class="form-control" name="to_month" value="<?php echo e(date('Y-m')); ?>"
                                    id="month_to" max="<?php echo e(date('Y-m')); ?>">
                            </div>
                        </div>
                        <div class="col-md-3 col-lg-4 category-column">
                            <div class="form-group">
                                <label for="category">Claim Category:</label>
                                <select name="category" id="category" class="custom-select">
                                    <option value="">Select Claim Category</option>
                                    <?php $categories = getClaimCategories(); ?>
                                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($key); ?>"><?php echo e($value); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-12 col-lg-12">
                            <div class="input-group">
                                <button type="button" class="btn btn-primary" id="search_report">
                                    <i class="fa fa-search"></i> Search
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>

        <div class="card mt-4" id="">
            <div class="card-header">
                <div class="card-title font-weight-bolder">
                    <span id="search_type"></span> <span id="search_from_to"></span>
                </div>
                <button type="button" class="float-right btn btn-sm btn-primary print_btn hide_in_print">Print
                    Report</button>
            </div>
            <div class="card-body" id="report_body">
                <table id="claim_summary_report_table" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Sr No.</th>
                            <th>Report Type</th>
                            <th>Pending</th>
                            <th>Processing</th>
                            <th>Rejected</th>
                            <th>Done</th>
                            <th>Partial Amount Paid</th>
                            <th>Total</th>
                        </tr>
                    </thead>
                    <tbody id="claim_summary_report_data">
                        <tr>
                            <td colspan="8" class="text-center">No Record Found</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('js'); ?>
<script>
$('#search_report').click(function() {
    let search_type = $('#search_type');
    let search_from_to = $('#search_from_to');
    let type_text = $('#report_type').find('option:selected').text();
    let type = $('#report_type').find('option:selected').val();
  

    if (type == '') {
        alert('Please Select Record Type');
    } else {
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>'
            }
        });
        let url = "<?php echo e(route('get.claim.report.summary')); ?>";
        
        $.ajax({
            url: url,
            type: 'post',
            data: $('#report_form').serialize(),
            // dataType: 'json',
            beforeSend: function(){
                $('#claim_summary_report_data').html();
            },
            success: function(data) {
                // console.log(data);
                $('#claim_summary_report_data').html();
                search_type.text(type_text);
                $('#claim_summary_report_data').html(data);
            }
        });
    }
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/legalclaim231/public_html/resources/views/pages/claims/reportSummary.blade.php ENDPATH**/ ?>