<?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">
                    EMI Calculation
                </h3>
            </div>

        </div>
    </div>
    <!-- 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-calculator"></i>
                        </span>
                        <h3 class="m-portlet__head-text">
                            EMI Calculation
                        </h3>
                    </div>
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="m-section">
                    <div>
                        <div>
                            <div class="col-md-12">
                                <div id="merchant_offer" class="form-horizontal">
                                    <input name="_token" value="<?php echo e(csrf_token()); ?>" type="hidden">
                                    <div class="row" style="padding-bottom: 10px;margin-left: -32px;padding-top: 10px;">
                                        <div class="col-md-3">
                                            <select class="form-control selectpicker" name="merchant_id" id="merchant_id" data-live-search="true">
                                                <option>Select Merchant</option>
                                                <?php $__currentLoopData = $merchants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index=>$merchant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if(\Illuminate\Support\Facades\Auth::user()->user_type != \App\UserTypes::$merchant_v2): ?>
                                                    <option data-index="<?php echo $index; ?>" value="<?php echo $merchant->id; ?>" <?php if(isset($merchant_id) && $merchant_id == $merchant->id): ?> selected="selected" <?php endif; ?>><?php echo $merchant->merchant_name; ?></option>
                                                    <?php else: ?>
                                                    <option data-index="<?php echo $index; ?>" value="<?php echo $merchant->id; ?>" selected="selected"><?php echo $merchant->merchant_name; ?></option>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <div class="col-md-3">
                                            <select class="form-control" name="category_id" id="category_id">
                                                <?php if(\Illuminate\Support\Facades\Auth::user()->user_type != \App\UserTypes::$merchant_v2): ?>
                                                <option>Select Category</option>
                                                <?php else: ?>
                                                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($category->id); ?>" selected="selected"><?php echo e($category->name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            </select>
                                        </div>
                                        <?php if(\Illuminate\Support\Facades\Auth::user()->user_type == \App\UserTypes::$merchant_v2): ?>
                                            <div class="col-md-3">
                                                <select class="form-control" name="tenure" id="tenure">
                                                    <option value=""> Select tenure</option>
                                                    <?php $__currentLoopData = $offers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $offer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($offer->tenure); ?>"><?php echo e($offer->tenure); ?> months</option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        <?php endif; ?>
                                        <div class="col-md-3">
                                            <input type="text" name="loan_amount" value="" class="form-control" id="loan_amount" placeholder="Loan Amount"/>
                                        </div>
                                        <div class="col-md-3">
                                            <input type="text" name="net_loan_amount" value="" class="form-control" id="net_loan_amount" placeholder="Net Loan Amount"/>
                                        </div>
                                        <div class="col-md-3">
                                            <input type="text" name="emi_amount" value="" class="form-control" id="emi_amount" placeholder="Emi Amount"/>
                                        </div>
                                        <input type="hidden" name="hidden_source_type" value="calculator" class="form-control" id="hidden_source_type">

                                        <div class="col-md-2 calculate-for-emi">
                                            <button type="button" class="btn btn-accent m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill" onclick="collaspableView()">Calculate EMI</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="emi-calculation-summary m-section__content">

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php echo $__env->make("admin.layouts.footer", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>