<div class="row">
    <div class="col-sm-12">
        <section class="panel">
            <div class="panel-body">
                <div class="row">
                    <div class="col-sm-12">
                        <section class="panel">
                            <div class="panel-body">
                                <table class="display table table-bordered table-striped" id="dynsamic-table" >
                                    <thead>
                                        <tr>
                                            <th>{{ trans('ui.record.procedure') }}</th>
                                            <th>{{ trans('ui.record.agent') }}</th>
                                            <th>{{ trans('ui.record.date') }}</th>
                                            <th>{{ trans('ui.record.service_time') }}</th>
                                            <th>{{ trans('ui.record.services') }}</th>
                                            <th>{{ 'Sucursal' }}</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach($sucursales as $sucursal)
                                            @foreach($sucursal->registros as $registro)
                                                <tr>
                                                    <td>{{ $registro->tramite->nombre}}</td>
                                                    <td>
                                                        <ul>
                                                            @foreach($registro->usuarios as $usuario)
                                                                <li>
                                                                    {{ $usuario->firstname. ' '. $usuario->lastname }}
                                                                </li>
                                                            @endforeach
                                                        </ul>
                                                    </td>
                                                    <td>
                                                        {{ $registro->date }}
                                                    </td>
                                                    <td>
                                                        {{ $registro->service_time }}
                                                    </td>
                                                    <td>
                                                        <ul>
                                                            @foreach($registro->servicios()->where('sucursal_id',$registro->sucursal_id)->get() as $servicio)
                                                                <li>
                                                                    {{ $servicio->servicio }}
                                                                </li>
                                                            @endforeach
                                                        </ul>
                                                    </td>
                                                    <td>
                                                        {{$sucursal->nombre}}
                                                    </td>
                                                </tr>
                                            @endforeach
                                        @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </section>
                    </div>
                </div>
            </div>
        </section>
    </div>
