<?php if(\Illuminate\Support\Facades\Session::has('Hide_Customer_Documents|-69')): ?>
    <style>
        .doc-list-non-clickable a,
        .doc-list-non-clickable .show-object-view-init {
            pointer-events: none !important;
            color: #888 !important;
            text-decoration: none !important;
            cursor: default !important;
        }
    </style>
<?php endif; ?>
<div class="doc-list-non-clickable">
<?php
    $systemDocuments = ['merchant_disbursed','loan_agreement_esign','equifax_report','sanction_letter','pro_forma_invoice','co_applicant_cam_image','customer_cam_image','proforma','recall_notice','welcome_letter','original_seen','original_seen_verified','bounce','penal','epf-report','utility_validation_report','credit_appraisal_memo','national_identity_card_back','national_identity_card_front','live_video','onfido_check_report','live_photo','driving_licence_back','driving_licence_front','passport_front','passport_back','e mandate','digio-report-applicant','digio report applicant','digio-report-coapplicant'];
    $deleteDocument = 0;
    if(\Illuminate\Support\Facades\Session::has('Document_Delete|-25')){
        $deleteDocument = 1;
    }
    $m_generated = [];
    ?>
    <?php if(isset($files) && $files): ?>
        <ul style="list-style:none;">
            <?php $__currentLoopData = $files; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key =>  $file): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if(!$file->m_generated): ?>
                <?php if(isset($file->file_path)): ?>
                    <?php if(\Illuminate\Support\Facades\Session::has('Hide_Customer_Documents|-69')): ?>
                        <?php $file->file_path = '';?>
                    <?php endif; ?>
                    <?php if(strpos($file->file_path, 'res.cloudinary.com/') !== false): ?>
                        <li><i class="fa fa-file-pdf-o"></i><a target="_blank" style="color: black;margin-left: 9px;" href="<?php echo $file->file_path; ?>"><?php if($file->file_type == 'call_recording'): ?> Verification Call <?php else: ?> <?php echo $file->file_type; ?> <?php endif; ?></a> <?php if($file->password): ?><span style="font-weight: 600;font-size: 11px;">[Password - <?php echo $file->password; ?>]</span><?php endif; ?></li>
                    <?php else: ?>
                        <?php $full_path = '/admin/consumer-application/get-documents/'; $short_path = isset($file->file_path) && !empty($file->file_path) ? $file->file_path : $consumer_applications->id.'/'.$file->file_type.'.pdf';
                        $full_path .= $short_path;
                        $full_path = str_replace('//','/',$full_path);
                        $name_file_type_v = strpos($file->file_type, 'bounce') !== false ? 'bounce' : (strpos($file->file_type, 'penal') !== false ? 'penal' : (strpos($file->file_type, '_validation_report') !== false ? 'utility_validation_report' : $file->file_type));
                        ?>
                        <?php if(!$file->masked_doc || ($file->masked_doc || $file->file_type != 'aadhar_card')): ?>
                            <?php if($file->f_type != @$files[$key-1]->f_type || $key == 0): ?>
                            <span style="font-size: 15px;font-weight: 500;"><?php echo e($file->f_type); ?></span>
                            <?php endif; ?>
                            <li <?php if(isset($file->is_latest)): ?> style="color:red;" <?php endif; ?>>
                                <?php $statusLists = ['disbursement checklist done','ready for disbursement','disbursed','nach registered'];
                                    if($consumer_applications->lender_id == \App\Singularity\Singularity::$lender_id){
                                        array_push($statusLists, 'cf approved');
                                        array_push($statusLists, 'pre approved');
                                    }
                                ?>
                                <?php if(isset($file->tp_key) && isset($file->tp_key[$file->file_type]) && isset($file->tp_key_av[$file->file_type]) && in_array($consumer_applications->state, $statusLists)): ?>
                                    <?php if($consumer_applications->lender_id == \App\ABFL\Services\Services::$lender_id): ?>
                                        <i><img style="width:18px;" src="/assets/front/img/abfl.jpeg"/></i>
                                    <?php elseif($consumer_applications->lender_id == \App\Avanse\Services\AvanseServices::$lender_id): ?>
                                        <i><img style="width:18px;" src="/assets/front/img/avanse.png"/></i>
                                    <?php elseif($consumer_applications->lender_id == \App\Singularity\Singularity::$lender_id): ?>
                                        <i><img style="width:14px;" src="/assets/front/img/singularity_credit_logo.jpeg"/></i>
                                    <?php endif; ?>
                                <?php elseif(isset($file->tp_key) && isset($file->tp_key[$file->file_type]) && !isset($file->tp_key_av[$file->file_type]) && (in_array($consumer_applications->state, $statusLists) || isset($consumer_applications->avanseByApplicant->id))): ?>
                                    <i style="cursor: pointer;" class="send_to_avanse_document fa fa-upload" data-lender-id="<?php echo $consumer_applications->lender_id; ?>" data-file-id="<?php echo $file->id; ?>" data-file-name="<?php echo $file->tp_key[$file->file_type]; ?>" data-id="<?php echo $consumer_applications->id; ?>"></i>
                                <?php elseif(isset($file->tp_key) && isset($file->tp_key[$file->file_type]) && !isset($file->tp_key_av[$file->file_type]) && (in_array($consumer_applications->state, $statusLists) && $consumer_applications->lender_id == \App\KMGP2P::$lender_id)): ?>
                                    <i style="cursor: pointer;" class="send_to_avanse_document fa fa-upload" data-lender-id="<?php echo $consumer_applications->lender_id; ?>" data-file-id="<?php echo $file->id; ?>" data-file-name="<?php echo $file->tp_key[$file->file_type]; ?>" data-id="<?php echo $consumer_applications->id; ?>"></i>
                                <?php endif; ?>
                                <?php if($deleteDocument && !in_array($name_file_type_v, $systemDocuments)): ?><i style="cursor: pointer;" class="document-trash-del fa fa-trash" data-id="<?php echo $file->id; ?>"></i><?php elseif(isset($file->tp_key) && isset($file->tp_key[$file->file_type])): ?><i style="cursor: pointer;" class="document-trash-del fa fa-trash" data-id="<?php echo $file->id; ?>"></i><?php endif; ?>
                                    <?php if(!$file->accountUID && strpos($file->file_type, 'bank_statement') !== false): ?>
                                    <?php if($file->finbit_analysis_date): ?>
                                        <a <?php if($file->bank_name): ?> href="/admin/consumer-application/download-report-finbit/<?php echo $file->id; ?>"
                                        <?php endif; ?> 
                                        data-id="<?php echo $file->id; ?>" style="text-decoration: none;"><i class="fa fa-download" title="Download FinBit Report"></i></a> &nbsp;
                                        <i type="button" class="fa fa-exclamation-triangle" onclick="$(this).popover({placement: 'left'});" style="color:red;" data-toggle="popover" title="Finbit Analysis Failed" data-content="<?php echo date('d M, Y H:i:s', strtotime($file->finbit_analysis_date)) ?> (<?php echo $file->bank_name; ?>) - <?php echo $file->statementtype; ?>, <?php echo $file->statemenfilettype; ?>"></i>
                                    <?php endif; ?>
                                <?php endif; ?>
                                <?php if(!isset($file->UtilityValidation->id) && $file->customer_id && $file->provider && (strpos($file->file_type, 'electricity_bill') !== false || strpos($file->file_type, 'gas_bill') !== false)): ?>
                                    <i style="cursor: pointer;" data-id="<?php echo $file->id; ?>" class="validation-utility-bill fa fa-download" title="Validate Bill"></i>
                                <?php elseif(isset($file->UtilityValidation->id)): ?>
                                    <i style="color:green;" class="fa fa-check-circle"></i>
                                <?php endif; ?>
                                <i class="fa fa-file-pdf-o"></i>
                                <a target="_blank" style="cursor:pointer;color: black;margin-left: 9px; <?php if(isset($file->is_latest)): ?> color:red; <?php endif; ?>"
                                   <?php if(0 < count(array_intersect(array_map('strtolower', explode('.', $full_path)), ['jpeg','png','gif', 'pdf'])) && strpos($full_path, 'recording') == false): ?>
                                   data-link="<?php echo $full_path; ?>" class="show-object-view-init" data-name="<?php echo $file->file_type; ?>"
                                   <?php else: ?>
                                   href="<?php echo $full_path; ?>" data-name="<?php echo $file->file_type; ?>"
                                        <?php endif; ?>>
                                    <?php if($file->file_type == 'call_recording'): ?>
                                        Verification Call
                                    <?php elseif($file->file_type && strpos($file->file_type, 'pro_forma_invoice') !== false && (empty($file->created_by ) || ($file->created_by) == 107 )): ?>
                                        Disbursement Advice
                                    <?php elseif($file->file_type && strpos($file->file_type, 'pro_forma_invoice') !== false): ?>
                                        Merchant Email confirmation/Signed DA
                                    <?php elseif($file->file_type && strpos($file->file_type, 'proforma') !== false): ?>
                                        Final quotation/Final Bill
                                    <?php elseif($file->file_type && strpos($file->file_type, 'pirimid_analysis_excel') !== false): ?>
                                        PIRIMID Bank Analysis Excel
                                    <?php else: ?>
                                        <?php if(strpos($file->file_type, 'equifax_report') !== false && $file->bureau_report_type): ?>
                                            <?php echo $file->bureau_report_type; ?>
                                        <?php else: ?>
                                            <?php echo $file->file_type; ?>

                                        <?php endif; ?>
                                    <?php endif; ?>
                                </a>
                                <?php if($file->bank_name): ?>
                                    <span style="font-weight: 600;font-size: 11px;">(<?php echo $file->bank_name; ?>)</span>
                                <?php endif; ?>
                                <?php if($file->password): ?>
                                    <span style="font-weight: 600;font-size: 11px;">[Password - <?php echo $file->password; ?>]</span>
                                <?php endif; ?>
                                <?php if($file->bureau_report_type && $file->bureau_report_score): ?>
                                    <span style="font-weight: 600;font-size: 11px;">[<?php echo $file->bureau_report_type; ?>/<?php echo $file->bureau_report_score; ?>]</span>
                                <?php endif; ?>
                                <span style="font-weight: 400;font-size: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<?php echo date('d M, Y H:i:s', strtotime($file->created_at)); ?>

                                    <?php if(isset($file->user) && isset($file->user->name) && $file->doc_category == 'CKYC'): ?>
                                        - CKYC Registry
                                    <?php elseif(isset($file->user) && isset($file->user->name)): ?>
                                        - <?php echo ucfirst($file->user->name); ?>
                                    <?php endif; ?>]
                                                                    </span>
                                <?php if(\Illuminate\Support\Facades\Session::has('Mask_Aadhar_Card|-32')): ?>
                                    <?php if(!$file->masked_doc && strpos($file->file_type, 'aadhar_card') !== false && $file->password == ''): ?>
                                        <span id="mask_doc" class="btn btn-outline-dark btn-sm mask-address-proof" data-path = "<?php echo $full_path; ?>">Mask Now<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                    <?php endif; ?>
                                <?php endif; ?>
                                
                                <?php if(strpos($file->file_type, 'pro_forma_invoice') !== false && $file->show_to_merchant == 0): ?>
                                        <span id="mask_doc" class="btn btn-outline-dark btn-sm show_to_merchant" data-path = "<?php echo $full_path; ?>" data-id="<?php echo $consumer_applications->id; ?>" data-file-id="<?php echo $file->id; ?>">Show to merchant<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                <?php endif; ?>

                                <?php if($file->file_type == 'electricity_bill'|| ($file->file_type == 'electricity_bill_validation_report' && $consumer_applications->merchant_id == env('SSE_MERCHANT_ID'))): ?>
                                        <?php
                                            $ebill_name_verify = null;
                                            if (isset($file->ebill_name_verify)) {
                                                // Convert JSON string to PHP object
                                                $ebill_name_verify = json_decode($file->ebill_name_verify);
                                            }
                                        ?>
                                        <?php if(isset($ebill_name_verify) && (isset($ebill_name_verify->applicant_match) || isset($ebill_name_verify->co_applicant_match))): ?>
                                        <span class="btn btn-sm" style="border: 2px solid #000000; margin-left: 20px;  color: #343a40; margin-bottom: 5px">
                                            <details class="ebill-details-tag">
                                                <summary style="text-align: left;font-weight: bold;">View Name Comparison</summary>
                                                <p style="text-align: left;">
                                                <?php if(isset($ebill_name_verify)): ?>
                                                    <?php if(isset($ebill_name_verify->applicant_match)): ?>
                                                        Consumer name 
                                                        <?php if($ebill_name_verify->applicant_match >= 60): ?>
                                                            <span style="color: green;font-weight: bold;">Matches</span>
                                                        <?php else: ?>
                                                            <span style="color: red;font-weight: bold;">does not match</span>
                                                        <?php endif; ?>
                                                        with Applicant name (<?php echo e($ebill_name_verify->applicant_match); ?>% match)
                                                        <br>
                                                    <?php endif; ?>

                                                    <?php if(isset($ebill_name_verify->co_applicant_match)): ?>
                                                        Consumer name 
                                                        <?php if($ebill_name_verify->co_applicant_match >=60): ?>
                                                            <span style="color: green;font-weight: bold;">Matches</span>
                                                        <?php else: ?>
                                                            <span style="color: red;font-weight: bold;">does not match</span>
                                                        <?php endif; ?>
                                                        with Co-Applicant name (<?php echo e($ebill_name_verify->co_applicant_match); ?>% match)
                                                        <br>
                                                    <?php endif; ?>
                                                <?php else: ?>
                                                    E-bill validation fail
                                                <?php endif; ?>
                                            </p>
                                            </details>
                                        </span>
                                        <?php endif; ?>
                                <?php endif; ?>

                                <?php if(strpos($file->file_type, 'pro_forma_invoice') !== false && $file->show_to_merchant == 1): ?>
                                    <span id="mask_doc" class="btn btn-outline-dark btn-sm cancel_from_merchant" data-path = "<?php echo $full_path; ?>" data-id="<?php echo $consumer_applications->id; ?>" data-file-id="<?php echo $file->id; ?>">Cancel from merchant<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                <?php endif; ?>

                                <?php $includeDocs = false; ?>
                                <?php if($consumer_applications->lender_id == \App\ABFL\Services\Services::$lender_id): ?>
                                    <?php if(in_array($file->file_type, ['passport_front', 'passport_back', 'votar_id_front', 'votar_id_back', 'driving_license', 'passport_front', 'passport_back', 'aadhar_card', 'aadhar_card_back'])): ?>
                                            <?php $includeDocs = true; ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                                <?php if(((strpos($file->file_type, 'aadhar_card') !== false || strpos($file->file_type, 'pan_card') !== false) && ($consumer_applications->lender_id == \App\ABFL\Services\Services::$lender_id || ($consumer_applications->lender_id == \App\Avanse\Services\AvanseServices::$lender_id ) || ($consumer_applications->lender_id == App\Singularity\Singularity::$lender_id))) || $includeDocs): ?>
                                <!-- 300000 condition here -->
                                    <?php if((($file->is_masked && strpos($file->file_type, 'aadhar_card') !== false) || !$file->is_masked) || $includeDocs): ?>
                                        <span id="mask_osv" class="btn btn-outline-dark btn-sm mask-kyc-proof" data-id="<?php echo $consumer_applications->id; ?>" data-file-id="<?php echo $file->id; ?>">Mask OSV<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </li>
                        <?php endif; ?>
                    <?php endif; ?>
                <?php elseif(false && isset($file->recording) && $file->recording): ?>
                    <li><i class="fa fa-file-audio-o"></i>
                        <a style="color: black;margin-left: 9px;" href="<?php echo $file->recording; ?>"><?php echo $file->purpose; ?>_<?php echo $file->created_at; ?>

                            <?php if(isset($file->received_by) && $file->received_by->mobile_number == $file->to): ?>
                                <?php echo '_applicant'; ?>

                            <?php elseif(isset($file->received_by) && $file->received_by->co_applicant_mobile_number == $file->to): ?>
                                <?php echo '_co_applicant'; ?>

                            <?php elseif(isset($file->received_by) && isset($consumer_applications->application_element) && ($consumer_applications->application_element->reference_contact_2 == $file->to || $consumer_applications->application_element->reference_contact_1 == $file->to)): ?>
                                <?php if($consumer_applications->application_element->reference_contact_1 == $file->to): ?>
                                    <?php echo '_reference_1'; ?>

                                <?php else: ?>
                                    <?php echo '_reference_2'; ?>

                                <?php endif; ?>
                            <?php endif; ?>
                        </a>
                        <span style="font-weight: 400;font-size: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<?php echo date('d M, Y H:i:s', strtotime($file->created_at)); ?>  <?php if(isset($file->picked_by) && isset($file->picked_by->name)): ?> - <?php echo isset($file->picked_by->name) ? $file->picked_by->name : ''; ?> <?php endif; ?>]</span>
                    </li>
                <?php endif; ?>
                <?php if((isset($file->purpose) && (empty($file->recording) || empty($file->recording)) && $file->status=='in-progress')): ?>
                    <li><i class="fa fa-file-audio-o"></i><a style="color: black;margin-left: 9px;" href="https://my.exotel.com/auth/login" target="_blank"><?php echo 'CALL STATUS: In-progress, click to login to Exotel. '; ?></a></li>
                <?php endif; ?>
                <?php else: ?>
                    <?php $m_generated[] = $file; ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>

        <?php if(isset($m_generated) && $m_generated): ?>
            <div>
                <div style="margin-left: 38px;">------------------------ Manually Generated Documents (After 2021-04-05) ------------------------</div>
                <ul style="list-style:none;">
                <?php $__currentLoopData = $m_generated; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $file): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <!-- Document Generated After 2021-04-05 (AWS Problem) -->
                    <?php if(isset($file->file_path)): ?>
                        <?php if(strpos($file->file_path, 'res.cloudinary.com/') !== false): ?>
                            <li><i class="fa fa-file-pdf-o"></i><a target="_blank" style="color: black;margin-left: 9px;" href="<?php echo $file->file_path; ?>"><?php if($file->file_type == 'call_recording'): ?> Verification Call <?php else: ?> <?php echo $file->file_type; ?> <?php endif; ?></a> <?php if($file->password): ?><span style="font-weight: 600;font-size: 11px;">[Password - <?php echo $file->password; ?>]</span><?php endif; ?></li>
                        <?php else: ?>
                            <?php $full_path = '/admin/consumer-application/get-documents/'; $short_path = isset($file->file_path) && !empty($file->file_path) ? $file->file_path : $consumer_applications->id.'/'.$file->file_type.'.pdf';
                            $full_path .= $short_path;
                            $full_path = str_replace('//','/',$full_path);
                            $name_file_type_v = strpos($file->file_type, 'bounce') !== false ? 'bounce' : (strpos($file->file_type, 'penal') !== false ? 'penal' : (strpos($file->file_type, '_validation_report') !== false ? 'utility_validation_report' : $file->file_type));
                            ?>
                            <?php if(!$file->masked_doc || ($file->masked_doc || $file->file_type != 'aadhar_card')): ?>
                                <li <?php if(isset($file->is_latest)): ?> style="color:red;" <?php endif; ?>>
                                    <?php if($deleteDocument && !in_array($name_file_type_v, $systemDocuments)): ?><i style="cursor: pointer;" class="document-trash-del fa fa-trash" data-id="<?php echo $file->id; ?>"></i><?php endif; ?>
                                    <?php if(!$file->accountUID && strpos($file->file_type, 'bank_statement') !== false): ?>
                                        <a <?php if($file->bank_name): ?> href="/admin/consumer-application/download-report-finbit/<?php echo $file->id; ?>"
                                    <?php else: ?> 
                                        data-link="/admin/consumer-application/download-report-finbit/<?php echo $file->id; ?>" href="javascript:void(0);" class="show_bank_popup show_bank_popup_pro_<?php echo $file->id; ?>"
                                    <?php endif; ?> 
                                    data-id="<?php echo $file->id; ?>" style="text-decoration: none;"><i class="fa fa-download" title="Download FinBit Report"></i></a> &nbsp;
                                        <?php if($file->finbit_analysis_date): ?>
                                            <i type="button" class="fa fa-exclamation-triangle" onclick="$(this).popover({placement: 'left'});" style="color:red;" data-toggle="popover" title="Finbit Analysis Failed" data-content="<?php echo date('d M, Y H:i:s', strtotime($file->finbit_analysis_date)) ?> (<?php echo $file->bank_name; ?>) - <?php echo $file->statementtype; ?>, <?php echo $file->statemenfilettype; ?>"></i>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                    <?php if(!isset($file->UtilityValidation->id) && $file->customer_id && $file->provider && (strpos($file->file_type, 'electricity_bill') !== false || strpos($file->file_type, 'gas_bill') !== false)): ?>
                                        <i style="cursor: pointer;" data-id="<?php echo $file->id; ?>" class="validation-utility-bill fa fa-download" title="Validate Bill"></i>
                                    <?php elseif(isset($file->UtilityValidation->id)): ?>
                                        <i style="color:green;" class="fa fa-check-circle"></i>
                                    <?php endif; ?>
                                    <i class="fa fa-file-pdf-o"></i>
                                    <a target="_blank" style="cursor:pointer;color: black;margin-left: 9px; <?php if(isset($file->is_latest)): ?> color:red; <?php endif; ?>"
                                       <?php if(0 < count(array_intersect(array_map('strtolower', explode('.', $full_path)), ['jpeg','png','gif', 'pdf'])) && strpos($full_path, 'recording') == false): ?>
                                       data-link="<?php echo $full_path; ?>" class="show-object-view-init" data-name="<?php echo $file->file_type; ?>"
                                       <?php else: ?>
                                       href="<?php echo $full_path; ?>" data-name="<?php echo $file->file_type; ?>"
                                            <?php endif; ?>>
                                        <?php if($file->file_type == 'call_recording'): ?>
                                            Verification Call
                                        <?php elseif($file->file_type && strpos($file->file_type, 'pro_forma_invoice') !== false && (empty($file->created_by ) || ($file->created_by) == 107 )): ?>
                                            Disbursement Advice
                                        <?php elseif($file->file_type && strpos($file->file_type, 'pro_forma_invoice') !== false): ?>
                                            Merchant Email confirmation/Signed DA
                                        <?php elseif($file->file_type && strpos($file->file_type, 'proforma') !== false): ?>
                                            Final quotation/Final Bill
                                        <?php else: ?>
                                            <?php echo $file->file_type; ?>

                                        <?php endif; ?>
                                    </a>
                                    <?php if($file->bank_name): ?>
                                        <span style="font-weight: 600;font-size: 11px;">(<?php echo $file->bank_name; ?>)</span>
                                    <?php endif; ?>
                                    <?php if($file->password): ?>
                                        <span style="font-weight: 600;font-size: 11px;">[Password - <?php echo $file->password; ?>]</span>
                                    <?php endif; ?>
                                    <span style="font-weight: 400;font-size: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<?php echo date('d M, Y H:i:s', strtotime($file->created_at)); ?>

                                        <?php if(isset($file->user) && isset($file->user->name)): ?>
                                            - <?php echo isset($file->user->name) ? $file->user->name : ''; ?>

                                        <?php endif; ?>]
                                                                    </span>
                                    <?php if(\Illuminate\Support\Facades\Session::has('Mask_Aadhar_Card|-32')): ?>
                                        <?php if(!$file->masked_doc && strpos($file->file_type, 'aadhar_card') !== false && $file->password == ''): ?>
                                            <span id="mask_doc" class="btn btn-outline-dark btn-sm mask-address-proof" data-path = "<?php echo $full_path; ?>">Mask Now<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                                                    
                                    <?php if(strpos($file->file_type, 'pro_forma_invoice') !== false && $file->show_to_merchant == 0): ?>
                                        <span id="mask_doc" class="btn btn-outline-dark btn-sm show_to_merchant" data-path = "<?php echo $full_path; ?>">Show to merchant<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                    <?php endif; ?>

                                    <?php if(strpos($file->file_type, 'pro_forma_invoice') !== false && $file->show_to_merchant == 1): ?>
                                        <span id="mask_doc" class="btn btn-outline-dark btn-sm cancel_from_merchant" data-path = "<?php echo $full_path; ?>">Cancel from merchant<span class="loading_icon_c"><img src="/assets/front/img/loading.gif" style="position: absolute;margin-top: -25px;margin-left: 196px;display: none;padding-left: 17px;"></span></span>
                                    <?php endif; ?>

                                </li>
                            <?php endif; ?>
                        <?php endif; ?>
                    <?php elseif(isset($file->recording) && $file->recording): ?>
                        <li><i class="fa fa-file-audio-o"></i>
                            <a style="color: black;margin-left: 9px;" href="<?php echo $file->recording; ?>"><?php echo $file->purpose; ?>_<?php echo $file->created_at; ?>

                                <?php if(isset($file->received_by) && $file->received_by->mobile_number == $file->to): ?>
                                    <?php echo '_applicant'; ?>

                                <?php elseif(isset($file->received_by) && $file->received_by->co_applicant_mobile_number == $file->to): ?>
                                    <?php echo '_co_applicant'; ?>

                                <?php elseif(isset($file->received_by) && isset($consumer_applications->application_element) && ($consumer_applications->application_element->reference_contact_2 == $file->to || $consumer_applications->application_element->reference_contact_1 == $file->to)): ?>
                                    <?php if($consumer_applications->application_element->reference_contact_1 == $file->to): ?>
                                        <?php echo '_reference_1'; ?>

                                    <?php else: ?>
                                        <?php echo '_reference_2'; ?>

                                    <?php endif; ?>
                                <?php endif; ?>
                            </a>
                            <span style="font-weight: 400;font-size: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<?php echo date('d M, Y H:i:s', strtotime($file->created_at)); ?>  <?php if(isset($file->picked_by) && isset($file->picked_by->name)): ?> - <?php echo isset($file->picked_by->name) ? $file->picked_by->name : ''; ?> <?php endif; ?>]</span>
                        </li>
                    <?php endif; ?>

                    <!-- END -->
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>
    <?php endif; ?>
</div>