<?php $__env->startSection('content'); ?>

    <div class="sixteen wide tablet sixteen wide computer column ">
        <div class="ui segment">
            
            <h4 class="ui dividing header teal centered">REGISTRO DE SUCURSALES</h4>
            
            <table class="ui celled striped table">
                <thead>
                    <tr>
                        <th class="head_table">N°</th>
                        <th class="head_table">Nombre</th>
                        <th class="head_table">Direccion</th>
                        <th class="head_table">Telefono</th>
                        <th class="head_table">Tipo</th>
                        <th class="head_table">Acciones</th>
                    </tr>
                </thead>
                <tbody>
                   <?php /**/ $i = 1 /**/ ?>
                    <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $local): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr data-table="<?php echo e($local->id_local); ?>">
                        <td><?php echo e($i); ?></td>
                        <td><?php echo e($local->nombre); ?></td>
                        <td><?php echo e($local->direccion); ?></td>
                        <td><?php echo e($local->telefono); ?></td>
                        <td><?php echo e($local->tipo_local->nombre); ?></td>
                        <td>                            
                            <a class="ui mini vertical animated blue button" title="Editar datos" href="<?php echo e(url('sucursal/editar/'.$local->id_local)); ?>">
                                <div class="hidden content">Editar</div>
                                <div class="visible content"><i class="pencil alternate  icon"></i></div>
                            </a>
                            
                            <?php if($local->id_local != 1): ?>
                            <div class="ui mini vertical animated red button button_delete_modal" title="Eliminar registro" data-id="<?php echo e($local->id_local); ?>">
                                <div class="hidden content">Eliminar</div>
                                <div class="visible content"><i class="trash alternate icon"></i></div>
                            </div>
                            <?php endif; ?>

                        </td>
                    </tr>
                    <?php /**/ $i++ /**/ ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
                
            </table>

        </div>
    </div>

    <!--start delete modal -->
    <div class="ui small basic modal" id="delete_modal">
        <div class="ui icon header"><i class="trash alternate icon"></i>Eliminar Registro</div>
        <div class="content" style="text-align: center; font-size: 16px">
          <p>¿Está seguro que quiere eliminar este registro del sistema?</p>
        </div>
        <div class="actions">
            <div class="ui red basic cancel inverted button" title="Haga clic para salir"><i class="remove icon"></i>Cancelar</div>
            <div class="ui green ok inverted button" title="Haga clic para eliminar"> <i class="checkmark icon"></i>Eliminar</div>
        </div>
    </div>
    <!--end delete modal -->

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('js/local/listar.js')); ?>"></script>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layout.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>