
<?php echo $__env->make('admin.layouts.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo $__env->make('admin.layouts.sidebar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<style>
    .hidden{
        display: none;
    }
    .font-weight{
        font-weight: 600;
    }
    table{
        width: 100%;
        font-family: Arial;
    }
    .emi-form > thead > tr > th{
        font-weight: 600 !important;
    }
    .payable-amt{
        border-top-style: solid;
        border-bottom-style: solid;
    }
    .interest_rate{
        text-transform: capitalize;
    }
    .datepicker tbody tr > td[class='day']{
        border-color: #34b9c3;
        color: black;
        border-style: dashed;
        border-width: 1px;
    }
    .panel-group{
        padding-top: 18px;
    }
    .panel-default{
        padding-bottom: 4px;
    }
    .panel-collapse{
        background-color: #ffffff;
        padding: 10px;
        border: 1px solid #dedada;
    }
    h4.panel-title > a{
        font-size: 14px;
        color: #5f5a5a !important;
    }
    .panel-heading {
        background-color: #f1f1f1;
        border: 1px solid #e0dfe0;
        padding-left: 10px;
        padding-top: 6px;
        cursor: pointer;
    }
</style>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
    <!-- BEGIN: Subheader -->
    <div class="m-subheader ">
        <div class="d-flex align-items-center">
            <div class="mr-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    Revenue
                </h3>
            </div>

        </div>
    </div>
<?php setlocale(LC_MONETARY, 'en_IN.UTF-8'); ?>
    <!-- END: Subheader -->
    <div class="m-content">
        <?php if(Session::has('success')): ?>
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
                <?php echo e(Session::get('success')); ?>

            </div>
        <?php endif; ?>
        <?php if(Session::has('error')): ?>
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
                <?php echo e(Session::get('error')); ?>

            </div>
        <?php endif; ?>
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__head">
                <div class="m-portlet__head-caption">
                    <div class="m-portlet__head-title">
                        <span class="m-portlet__head-icon">
                            <i class="fa fa-calendar"></i>
                        </span>
                        <h3 class="m-portlet__head-text">
                            Revenue
                        </h3>
                    </div>
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="m-section">
                    <div class="m-section__content">
                        <div class="col-md-12">
                            <form id="merchant_offer" class="form-horizontal" method="POST">
                                <input name="_token" value="<?php echo e(csrf_token()); ?>" type="hidden">
                                <input name="search" value="search" type="hidden">
                                <div class="row" style="padding-bottom: 10px;margin-left: -32px;padding-top: 10px;">
                                    
                                        
                                    
                                    <div class="col-md-3">
                                        <select class="form-control" name="lender_id" id="lender_id">
                                            <option value="">Select Lender</option>
                                            <?php $__currentLoopData = $lenders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option data-index="<?php echo $lender->id; ?>" value="<?php echo $lender->id; ?>" <?php if(isset($lender_id) && $lender_id == $lender->id): ?> selected="selected" <?php endif; ?>><?php echo $lender->name; ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>

                                    <div class="col-md-5 calculate-for-emi">
                                        <input type="submit" class="btn btn-accent" value="Get Details"  style="margin-right: 20px;"/>
                                        <div class="btn btn-primary" onclick="return window.location = '/admin/revenue';">Clear Filter</div>
                                    </div>
                                </div>
                            </form>
                        </div>

                        <div class="emi-dues-summary m-section__content">
                            <?php if(isset($response) && count($response) > 0): ?>
                                <div style="margin-bottom: 11px;font-size: 15px;font-weight: 800;"><a href="?export=true&<?php echo http_build_query($_POST);?>" style="color: white;text-decoration: none;"><span class="pull-right col-md-1 form-control btn btn-primary">Export</span></a></div>
                                <table class="table">
                                    <thead style="background-color: #999999;color: white">
                                    <th>Customer Name</th>
                                    <th>Merchant Name</th>
                                    <th>Loan Amount</th>
                                    <th>Net Disbursement Amount</th>
                                    <th>Emi</th>
                                    <th>Subvention Rate</th>
                                    <th>Quoted Rate</th>
                                    <th>Interest Rate</th>
                                    <th>First Emi Date</th>
                                    <th>Principle Due</th>
                                    <th>Interest Due</th>
                                    <th>Subvention Amount</th>
                                    <th>Principle Outstanding</th>
                                    <th>Processing Fee</th>
                                    <th>Tenure</th>
                                    <th>Remaining EMI</th>
                                    <th>Loan Schedule</th>
                                    </thead>
                                    <tbody>
                                    <?php $total_amount = 0; ?>
                                    <?php $__currentLoopData = $response; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $details): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td>
                                                <?php echo $details['name']; ?></td>
                                            <td><?php echo $details['merchant_name']; ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['loan_amount']))); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['net_disbursement_amount']))); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['emi']))); ?></td>
                                            <td><?php echo trim(str_replace('.00','',money_format('%!i',$details['subvention']))); ?>%</td>
                                            <td><?php echo trim(str_replace('.00','',money_format('%!i',$details['quoted_interest']))); ?>%</td>
                                            <td><?php echo trim(str_replace('.00','',money_format('%!i',$details['interest']))); ?>%</td>
                                            <td><?php echo date('d M, Y',strtotime($details['first_emi_date'])); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['principle_due']))); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['interest_due']))); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['subvention_amount']))); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['principle_outstanding']))); ?></td>
                                            <td>&#8377;<?php echo trim(str_replace('.00','',money_format('%!i',$details['processing_fee']))); ?></td>
                                            <td><?php echo $details['tenure']; ?></td>
                                            <td><?php echo $details['remaining_emi']; ?></td>
                                            <td><a class="btn btn-primary" style="background-color: #00c5dc; border-color: #349eab;" href="/admin/getloanschedule/<?php echo $details['id']; ?>" target="_blank">Loan Schedule</a></td>

                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            <?php else: ?>
                                <b><center>No Data Found</center></b>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php echo $__env->make("admin.layouts.footer", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
