@if (empty($docs))
<div class="col-md-12 font15 text-center">-- @traducir('nodata', 'No se encuentra información') --</div>
@else
<!-- -->
<div class="row"> 
	<div class="col-md-12">
		<table class="table w-100" id="tablaDocumentosAnexo">
			<thead>
                <tr>
                    <th class="text-center">@traducir('estado', 'Cumplimiento')</th>
                    <th class="d-none">CumpN</th>
                    <th>@traducir('documento', 'Documento')</th>
                    <th class="text-center">@traducir('creacion', 'Creación')</th>
                    <th class="d-none">Created</th>
                    <th class="text-center">@traducir('vigencia', 'Vigencia')</th>
                    <th class="d-none">Vig</th>
                    <th class="text-center">@traducir('tolerancia', 'Tolerancia')</th>
                    <th class="d-none">Toler</th>
                    <th class="text-center">@traducir('cargado', 'Fecha de carga')</th>
                    <th class="d-none">Carga</th>
                    <th class="text-center">@traducir('Adjunto', 'Adjunto')</th>
                </tr>
			</thead>
			<tbody>
		        <?php $n = -1; ?>
		        @foreach($docs as $k => $documento)
		            @if($documento->estado_doc == 'N' || $documento->estado_doc == 'I' || $documento->estado_doc == 'R' || $documento->estado_doc == 'V')
                        <?php $n++; ?>
                        <tr>
                            <td class="text-center">
                                <i class="fa fa-{{$documento->icon_estado}} {{$documento->class_estado}} fa-2x" title="{{$documento->estado_documento}}"></i>
                            </td>
                            <!-- -->
                            <td class="d-none">@if($documento->estado_doc == 'N') @if ($documento->estado_documento !="No solicitado") 1 @else 99 @endif @elseif($documento->estado_doc == 'R') 2 @elseif($documento->estado_doc == 'I') 3 @else 4 @endif</td>
                            <td class="text-start">
                                @if ($documento->estado_documento!="No solicitado")
                                    <a href="#" class="doc" data-doc-id="{{$documento->doc_id}}" data-tipo-doc="{{ \Traducciones::get($documento->nombre_tipo_doc) }}">
                                {{ \Traducciones::get($documento->nombre_tipo_doc) }}
                                </a>
                                @else
                                <a>{{ \Traducciones::get($documento->nombre_tipo_doc) }}</a>
                                @endif 
                            </td>
                            <!-- -->
                            <td class="text-center">{{$documento->created_dmy}}</td>
                            <td class="d-none">{{$documento->created}}</td>
                            <!-- -->
                            <td class="text-center">{{$documento->fecha_vigencia_dmy}}</td>
                            <td class="d-none">{{$documento->fecha_vigencia}}</td>
                            <!-- -->
                            <td class="text-center">{{$documento->vencimiento_carga_dmy}}</td>
                            <td class="d-none">{{$documento->vencimiento_carga}}</td>
                            <!-- -->
                            <td class="text-center">{{$documento->ingresado_dmy}}</td>
                            <td class="d-none">{{$documento->ingresado}}</td>
                            <!-- -->
                            <td class="text-center">
                                @if($documento->estado_doc != 'N' && $files[$n]['exists'] )
                                    <a style="cursor:pointer;" data-url="{{$files[$n]['url']}}" data-titulo="{{ \Traducciones::get($documento->nombre_tipo_doc) }}" class="opendoc"><img src="/img/pdf.png" border="0"></a>
                                @endif
                            </td>
                        </tr>
		            @endif
		        @endforeach
			</tbody>
            <tfoot></tfoot>
		</table>
	</div>
</div>


<style type="text/css" media="screen">
  .form-group { margin-bottom: 5px }  
</style>

<script type="text/javascript" language="javascript">
	$(document).on('click', '.cerrarmodaldoc', function(e) {
		e.preventDefault(); 
		$('#modalDocumento').modal('hide');
	});
    //
	$(document).on('click', '.cerrarmodaldatosdoc', function(e) {
		e.preventDefault(); 
		$('#modalDatosDocumento').modal('hide');
	});
    //
    $(document).ready(function() {
        eventosDatosAnexosIV();
    });
</script>

@endif

