@php
$identity_file = "";
$ssn_file = "";
$state_file = "";
$other_doc_file = "";
$path = '';
$path_ssn ='';
$path_state = '';
$path_other = '';
@endphp
@if (!empty($upload_medias))
       @foreach ($upload_medias as $upload_media)
           @if ($upload_media->image_type_id == config('constant.IDENTIFICATION_IMAGE_ID'))
               @php
                   $identity_file = config('constant.UPLOAD_MEDIA_PATH') . DIRECTORY_SEPARATOR.$upload_media->user_id . DIRECTORY_SEPARATOR . $upload_media->image_path ;
                   $path = getPublicFile($identity_file) ;
                   $identity_file_model = $upload_media;
               @endphp
           @endif
           @if ($upload_media->image_type_id == config('constant.SSN_IMAGE_ID'))

               @php
                   $ssn_file = config('constant.UPLOAD_MEDIA_PATH') . DIRECTORY_SEPARATOR.$upload_media->user_id . DIRECTORY_SEPARATOR . $upload_media->image_path ;
                   $path_ssn = getPublicFile($ssn_file);
                   $ssn_file_model = $upload_media;
               @endphp
           @endif
           @if ($upload_media->image_type_id == config('constant.STATE_PHOTO_IMAGE_ID'))
               @php
                 $state_file = config('constant.UPLOAD_MEDIA_PATH') . DIRECTORY_SEPARATOR.$upload_media->user_id . DIRECTORY_SEPARATOR . $upload_media->image_path;
                 $path_state = getPublicFile($state_file) ;
                 $state_file_model = $upload_media;
               @endphp
           @endif
           @if ($upload_media->image_type_id == config('constant.MAIL_DOC_IMAGE_ID'))
               @php
                   $other_doc_file = config('constant.UPLOAD_MEDIA_PATH') . DIRECTORY_SEPARATOR.$upload_media->user_id . DIRECTORY_SEPARATOR . $upload_media->image_path ;
                   $path_other = getPublicFile($other_doc_file) ;
                   $other_doc_file_model = $upload_media;
               @endphp
           @endif
       @endforeach
   @endif
<div class="row">
<div class="col-md-6 ">
    <label class="lbl-file">Please upload document Proof of PHOTO IDENTIFICATION (ie
        Drivers License or State Identification Card)</label>
    <button type="button" class="btn btn-info btn-xs" id="identity_proof_file_btn" onclick="file_upload(`Drivers License or State Identification Card`,`{{addslashes($path) }}`,`{{config('constant.IDENTIFICATION_IMAGE_ID')}}`,`uploadmedia[identification]`)"> Upload </button>

{{--    @include('partials.file_size_label')--}}
{{--    <input id="identity_proof_file" type="file" onchange="return common_helper.fileSizeValidation(this,{{$max_file_size}})"  class="form-control"--}}
{{--           name="uploadmedia[identification]"--}}
{{--           accept="image/jpeg,image/gif,image/png,image/x-eps">--}}
    @if(!empty($identity_file))
        <button type="button" class="btn btn-danger btn-xs"  onclick="file_delete(`Drivers License or State Identification Card`,`{{$identity_file_model}}`)"> Delete </button>
        <div class="text-center"  id="identity_proof_doc_id">
            <img src="{{getPublicFile($identity_file)}}"
                 class="img-client"><br>
        </div>
    @endif
</div>
<div class="col-md-6 ">
    <label class="lbl-file">Please upload document Proof of legal Identification
        number(s) or document proof current legally acquired Social Security Number
        (ie SSN CARD, first page of tax form, passport , green card, etc. )</label>
{{--    @include('partials.file_size_label')--}}
{{--    <input id="ssn_proof_file" type="file" class="form-control"--}}
{{--           name="uploadmedia[ssn]"--}}
{{--           onchange="return common_helper.fileSizeValidation(this,{{$max_file_size}})"--}}
{{--           accept="image/jpeg,image/gif,image/png,image/x-eps">--}}
    <button type="button" class="btn btn-info btn-xs"  onclick="file_upload(`SSN CARD, first page of tax form, passport , green card, etc.`,`{{addslashes($path_ssn) }}`,`{{config('constant.SSN_IMAGE_ID')}}`,`uploadmedia[ssn]`)"> Upload </button>
    @if(!empty($ssn_file))
        <button type="button" class="btn btn-danger btn-xs" onclick="file_delete(`SSN CARD, first page of tax form, passport , green card, etc.`,`{{ $ssn_file_model }}`)"> Delete </button>
    <div class="text-center" id="ssn_doc_id">
        <img src="{{getPublicFile($ssn_file)}}"
             class="img-client"><br>
    </div>
    @endif
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-md-6 ">
    <label class="lbl-file">Please upload document proof of address's street number,
        street name, City and State/Province/Etc. (such as a current Utility Bill or
        First page of a Banking statement</label>
{{--    @include('partials.file_size_label')--}}
{{--    <input id="address_proof_file" type="file" class="form-control"--}}
{{--           name="uploadmedia[state_photo_id]"--}}
{{--           onchange="return common_helper.fileSizeValidation(this,{{$max_file_size}})"--}}
{{--           accept="image/jpeg,image/gif,image/png,image/x-eps">--}}
    <button type="button" class="btn btn-info btn-xs"  onclick="file_upload(`Current Utility Bill or First page of a Banking statement`,`{{addslashes($path_state) }}`,`{{config('constant.STATE_PHOTO_IMAGE_ID')}}`,`uploadmedia[state_photo_id]`)"> Upload </button>
    @if(!empty($state_file))
        <button type="button" class="btn btn-danger btn-xs"  onclick="file_delete(`Current Utility Bill or First page of a Banking statement`,`{{$state_file_model }}`)"> Delete </button>
    <div class="text-center" id="state_doc_id">
        <img src="{{getPublicFile($state_file)}}"
             class="img-client"><br>
    </div>
    @endif
</div>
<div class="col-md-6">
    <label class="lbl-file">Other Document Upload</label>
    <button type="button" class="btn btn-info btn-xs" onclick="file_upload(`Other Document Upload`,`{{addslashes($path_other) }}`,`{{config('constant.MAIL_DOC_IMAGE_ID')}}`,`uploadmedia[mail_doc]`)"> Upload </button>
{{--    @include('partials.file_size_label')--}}
{{--    <input id="other_file" type="file" class="form-control"--}}
{{--           name="uploadmedia[mail_doc]"--}}
{{--           onchange="return common_helper.fileSizeValidation(this,{{$max_file_size}})"--}}
{{--           accept="image/jpeg,image/gif,image/png,image/x-eps">--}}
    @if(!empty($other_doc_file))
        <button type="button" class="btn btn-danger btn-xs" onclick="file_delete(`Other Document Upload`,`{{ $other_doc_file_model }}`)"> Delete </button>
    <div class="text-center" id="other_doc_id">
        <img src="{{getPublicFile($other_doc_file)}}"
             class="img-client"><br>
    </div>
    @endif
</div>
</div>



