<div class="row">
    <div class="col-12">
        <div class="card">
            <hr style="border: 1px solid grey;width: 250px;">
            <h3><i>Personal Documents</i></h3>
            <hr style="border: 1px solid grey;width: 250px;">
            <div class="card-body mt-2">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Paan Card Image</i></u></h3>
                            
                            @php
                                $panImagePath = public_path('uploads/kyc/'.$obf_document_image->pan_image);
                            @endphp
                            @if(!empty($obf_document_image->pan_image) && file_exists($panImagePath))
                                <img src="{{ asset('uploads/kyc/'.$obf_document_image->pan_image) }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Aadhar Card Image</i></u></h3>
                        
                            @php
                                $aadharImages = !empty($obf_document_image->adhar_image) ? explode(',', $obf_document_image->adhar_image) : [];
                            @endphp    
                        
                            <div class="row">
                                @if(count($aadharImages) > 0)
                                    @foreach($aadharImages as $image)
                                        @php
                                            $imagePath = public_path('uploads/kyc/'.$image);
                                        @endphp
                        
                                        <div class="col-md-4 mb-2">
                                            @if(!empty($image) && file_exists($imagePath))
                                                <img src="{{ asset('uploads/kyc/'.$image) }}" alt="Aadhar Image" class="img-fluid" style="max-width: 100%; height: auto;">
                                            @else
                                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="No Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                                            @endif
                                        </div>
                                    @endforeach
                                @else
                                    <div class="col-md-4 mb-2">
                                        <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="No Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                                    </div>
                                @endif
                            </div>
                        </div>
                    </div>
                    
                    <hr style="border: 1px solid grey;width: 1800px;">
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Aadhar Card & Paan Card Linked Status</i></u></h3>
                            
                            @php
                                $linkedImagePath = public_path('uploads/kyc/'.$obf_document_image->aadhar_pan_image);
                            @endphp
                            @if(!empty($obf_document_image->aadhar_pan_image) && file_exists($linkedImagePath))
                                <img src="{{ asset('uploads/kyc/'.$obf_document_image->aadhar_pan_image) }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Licence Image</i></u></h3>
                            
                            @php
                                $licenceImagePath = public_path('uploads/kyc/'.$obf_document_image->licance_image);
                            @endphp
                            @if(!empty($obf_document_image->licance_image) && file_exists($licenceImagePath))
                                <img src="{{ asset('uploads/kyc/'.$obf_document_image->licance_image) }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                    
                    <hr style="border: 1px solid grey;width: 1800px;">
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Passport Image</i></u></h3>
                            
                            @php
                                $passportImagePath = public_path('uploads/kyc/'.$obf_document_image->passport_document);
                            @endphp
                            @if(!empty($obf_document_image->passport_document) && file_exists($passportImagePath))
                                <img src="{{ asset('uploads/kyc/'.$obf_document_image->passport_document) }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>GST Certificate</i></u></h3>
                            
                            @php
                                $gstImagePath = public_path('uploads/kyc/'.$obf_document_image->gst_certificate);
                            @endphp
                            @if(!empty($obf_document_image->gst_certificate) && file_exists($gstImagePath))
                                <img src="{{ asset('uploads/kyc/'.$obf_document_image->gst_certificate) }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>    


<!--Insurance & Fasttag & RTO & Municipal & etc.. Images-->
<div class="row">
    <div class="col-12">
        <div class="card">
            <hr style="border: 1px solid grey;width: 250px;">
            <h3><i>Department wise Documents</i></h3>
            <hr style="border: 1px solid grey;width: 250px;">
            <div class="card-body mt-2">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-6">
                           <h3 class="mb-4"><u><i>EW Certificate</i></u></h3>
                            @php
                                $ewImagePath = !empty($ew_document->dms_ew_certificate) ? public_path('storage/app/public/'.$ew_document->dms_ew_certificate) : null;
                            @endphp
                            @if(!empty($ew_document->dms_ew_certificate) && file_exists($ewImagePath))
                                <img src="{{ asset('storage/app/public/'.$ew_document->dms_ew_certificate) }}" alt="EW Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>MCP Certificate</i></u></h3>
                            @php
                                $mcpImagePath = !empty($mcp_document->dms_mcp_certificate) ? public_path('storage/app/public/'.$mcp_document->dms_mcp_certificate) : null;
                            @endphp
                            @if(!empty($mcp_document->dms_mcp_certificate) && file_exists($mcpImagePath))
                                <img src="{{ asset('storage/app/public/'.$mcp_document->dms_mcp_certificate) }}" alt="MCP Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                    
                    <hr style="border: 1px solid grey;width: 1800px;">
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>RSA Certificate</i></u></h3>
                            @php
                                $rsaImagePath = !empty($rsa_document->dms_rsa_certificate) ? public_path('storage/app/public/'.$rsa_document->dms_rsa_certificate) : null;
                            @endphp
                            @if(!empty($rsa_document->dms_rsa_certificate) && file_exists($rsaImagePath))
                                <img src="{{ asset('storage/app/public/'.$rsa_document->dms_rsa_certificate) }}" alt="RSA Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>CCS Certificate</i></u></h3>
                            @php
                                $ccsImagePath = !empty($ccs_document->dms_rsa_certificate) ? public_path('storage/app/public/'.$ccs_document->dms_rsa_certificate) : null;
                            @endphp
                            @if(!empty($ccs_document->dms_rsa_certificate) && file_exists($ccsImagePath))
                                <img src="{{ asset('storage/app/public/'.$ccs_document->dms_rsa_certificate) }}" alt="CCS Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                    
                    <hr style="border: 1px solid grey;width: 1800px;">
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Fastage Image</i></u></h3>
                            @php
                                $fastageImagePath = !empty($fastag_document->fasttag_image) ? public_path('storage/app/public/'.$fastag_document->fasttag_image) : null;
                            @endphp
                            @if(!empty($fastag_document->fasttag_image) && file_exists($fastageImagePath))
                                <img src="{{ asset('storage/app/public/'.$fastag_document->fasttag_image) }}" alt="Fastage Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                           <h3 class="mb-4"><u><i>Fastage Image</i></u></h3>
                            @php
                                $fastageDMSImagePath = !empty($fastag_document->dms_certificate) ? public_path('storage/app/public/'.$fastag_document->dms_certificate) : null;
                            @endphp
                            @if(!empty($fastag_document->dms_certificate) && file_exists($fastageDMSImagePath))
                                <img src="{{ asset('storage/app/public/'.$fastag_document->dms_certificate) }}" alt="Fastage DMS Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                    
                    <hr style="border: 1px solid grey;width: 1800px;">
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>Municipal Certificate</i></u></h3>
                            @php
                                $municipalImagePath = !empty($municipal_document->municiple_image) ? public_path('storage/app/public/'.$municipal_document->municiple_image) : null;
                            @endphp
                            @if(!empty($municipal_document->municiple_image) && file_exists($municipalImagePath))
                                <img src="{{ asset('storage/app/public/'.$municipal_document->municiple_image) }}" alt="Municipal Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                           <h3 class="mb-4"><u><i>Accessory Image</i></u></h3>
                            @php
                                $accessoryDMSImagePath = !empty($accessory_document->dms_accesories_certificate) ? public_path('storage/app/public/'.$accessory_document->dms_accesories_certificate) : null;
                            @endphp
                            @if(!empty($accessory_document->dms_accesories_certificate) && file_exists($accessoryDMSImagePath))
                                <img src="{{ asset('storage/app/public/'.$accessory_document->dms_accesories_certificate) }}" alt="Accessory Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                    
                    <hr style="border: 1px solid grey;width: 1800px;">
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                            <h3 class="mb-4"><u><i>RTO Image</i></u></h3>
                            @php
                                $rtoImagePath = !empty($rto_document->rto_image) ? public_path('storage/app/public/'.$rto_document->rto_image) : null;
                            @endphp
                            @if(!empty($rto_document->rto_image) && file_exists($rtoImagePath))
                                <img src="{{ asset('storage/app/public/'.$rto_document->rto_image) }}" alt="RTO Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                        <div class="col-md-6">
                           <h3 class="mb-4"><u><i>RTO DMS Image</i></u></h3>
                            @php
                                $rtoDMSImagePath = !empty($rto_document->dms_rto_certificate) ? public_path('storage/app/public/'.$rto_document->dms_rto_certificate) : null;
                            @endphp
                            @if(!empty($rto_document->dms_rto_certificate) && file_exists($rtoDMSImagePath))
                                <img src="{{ asset('storage/app/public/'.$rto_document->dms_rto_certificate) }}" alt="RTO DMS Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @else
                                <img src="{{ asset('uploads/kyc/no-image-icon-23483.png') }}" alt="PAN Image" class="img-fluid" style="max-width: 100%; height: 630px;">
                            @endif
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>    