Reporte de sujetos pasivos

{!! html()->form('GET', url('admin/reportes/sujetos-pasivos')) ->class('form-horizontal') ->name('form-reporte') ->id('form-sujetos-pasivos') ->open() !!}
{!! html()->label('Institución', 'institucion')->class('form-label') !!} {!! html()->select('institucion') ->options([null => 'Escriba el nombre de la institución'] + $instituciones->all()) ->value((($institucion ?? null) !== null ? ($institucion['id'] ?? '') : '')) ->class('') ->id('institucion')!!}
{!! html()->submit('Buscar')->class('btn btn-primary') !!}

@if(($institucion ?? null) !== null && !is_null($institucion))
Institución:
@if(($rango_inicio_desde ?? null) !== null && ($rango_inicio_hasta ?? null) !== null)
Período reporte:
@elseif(($rango_inicio_desde ?? null) !== null)
Período reporte:
@elseif(($rango_inicio_hasta ?? null) !== null)
Período reporte:
@endif

Total

{{$total}}
@if($sujetos_pasivos->count() > 0)
@endif


@endif {!! html()->form()->close() !!}
@if($sujetos_pasivos->count() == 0)
La institución seleccionada no registra sujetos pasivos en el período consultado.
@else
@foreach($sujetos_pasivos as $sujeto) @endforeach
ID Nombre completo Rut Cargo o función Tipo Zona Fecha incorporación Fecha término Respaldo juridico Asistente Técnico
{{$sujeto->id}} {{{ (!is_null($sujeto->usuario)) ? $sujeto->usuario['nombres'].' '.$sujeto->usuario['apellidos']: ''}}} {{{ (!is_null($sujeto->usuario)) ? $sujeto->usuario['pasaporte']: ''}}} {{ $sujeto->cargo}} {{ $sujeto->tipo['valor']}} {{ (!is_null($sujeto->lugar)) ? $sujeto->lugar->nombre.' ('.( ($sujeto->lugar->tipo == 'region')? 'Región ': ucfirst($sujeto->lugar->tipo) ).')' : 'Nacional' }} {{ date('d-m-Y',strtotime($sujeto->fecha_inicio)) }} {{ (!is_null($sujeto->fecha_termino))? date('d-m-Y',strtotime($sujeto->fecha_termino)) : 'Indefinido'}} {{ $sujeto->resolucion_texto}} @foreach ($delegados = App\Models\Delegado::where('usuario_id','=',$sujeto->usuario_id)->join('usuarios','usuarios.id','=','delegaciones.usuario_delegado_id')->get() as $d) - {{ $d->nombres.' '.$d->apellidos }}
@endforeach
@if(($institucion ?? null) !== null) {{$sujetos_pasivos->appends([ 'institucion' => $institucion['id'] ?? '', 'rango_inicio_desde' => ($rango_inicio_desde ?? null) !== null ? $rango_inicio_desde : '2014-11-28', 'rango_inicio_hasta' => ($rango_inicio_hasta ?? null) !== null ? $rango_inicio_hasta : $fecha_hoy ])->links()}} @else {{$sujetos_pasivos->links()}} @endif @endif