<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><?php echo e(trans('ui.record.procedure')); ?></th>
                                            <th><?php echo e(trans('ui.record.agent')); ?></th>
                                            <th><?php echo e(trans('ui.record.date')); ?></th>
                                            <th><?php echo e(trans('ui.record.service_time')); ?></th>
                                            <th><?php echo e(trans('ui.record.services')); ?></th>
                                            <th><?php echo e('Sucursal'); ?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach($sucursales as $sucursal): ?>
                                            <?php foreach($sucursal->registros as $registro): ?>
                                                <tr>
                                                    <td><?php echo e($registro->tramite->nombre); ?></td>
                                                    <td>
                                                        <ul>
                                                            <?php foreach($registro->usuarios as $usuario): ?>
                                                                <li>
                                                                    <?php echo e($usuario->firstname. ' '. $usuario->lastname); ?>

                                                                </li>
                                                            <?php endforeach; ?>
                                                        </ul>
                                                    </td>
                                                    <td>
                                                        <?php echo e($registro->date); ?>

                                                    </td>
                                                    <td>
                                                        <?php echo e($registro->service_time); ?>

                                                    </td>
                                                    <td>
                                                        <ul>
                                                            <?php foreach($registro->servicios()->where('sucursal_id',$registro->sucursal_id)->get() as $servicio): ?>
                                                                <li>
                                                                    <?php echo e($servicio->servicio); ?>

                                                                </li>
                                                            <?php endforeach; ?>
                                                        </ul>
                                                    </td>
                                                    <td>
                                                        <?php echo e($sucursal->nombre); ?>

                                                    </td>
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php endforeach; ?>
                                    </tbody>
                                </table>
                            </div>
                        </section>
                    </div>
                </div>
            </div>
        </section>
    </div>
