<?php $__env->startSection('contenido'); ?>
    
    <?php if(count($errors)>0): ?>
    <div class="alert alert-danger alert-dismissible fade show" role="alert">
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
        <ul>
            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <li><?php echo e($error); ?></li>             
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>
    </div>
    <?php endif; ?>
    <?php if(Session::has('mensaje')): ?>
        <div class="alert alert-danger alert-dismissible fade show mb-2 mt-2" role="alert">
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            <strong>Atención. </strong><?php echo e(Session::get('mensaje')); ?>

        </div>
    <?php endif; ?>
    <div class="card mb-2 mt-2">
        <form action="<?php echo e(url('/sucursal')); ?>" method="post">
            <?php echo csrf_field(); ?>
            <div class="card">
                <div class="card-header">
                    <h4>Registrar una Sucursal</h4>
                </div>
                <div class="card-body">
                    <input type="hidden" name="idempresa" value="<?php echo e(auth()->user()->idempresa); ?>">   
                    <div class="row mb-2 mt-2">
                        <div class="col-md-3">
                            <label><b>Nombre</b></label>
                            <input type="text" class="form-control form-control-sm" name="nombre" id="nombre" autocomplete="off">
                        </div>          
                        <div class="col-md-4">
                            <label><b>Dirección</b></label>
                            <input type="text" name="direccion" class="form-control form-control-sm">
                        </div>
                        <div class="col-md-3">
                            <label for="" class="text-dark"><b>Ciudad</b></label>
                            <div class="input-group">
                                <select id="idciudad" name="idciudad" class="form-select form-control-sm" style="width: 270px">
                                    <?php $__currentLoopData = $ciudades; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ciudad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($ciudad['idciudad']); ?>"><?php echo e($ciudad['nombre']); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <button type="button" class="btn btn-secondary btn-sm" data-bs-toggle="modal"
                                    data-bs-target="#ModalNuevoBeneficiario">
                                    +
                                </button>
                            </div>
                            <script>
                                $(document).ready(function() {
                                    $('#idciudad').select2();
                                });
                            </script>
                        </div>
                        <div class="col-md-2">
                            <label><b>Teléfono</b></label>
                            <input type="text" name="telefono" class="form-control form-control-sm">
                        </div>
                    </div>
                </div>
                <div class="card-footer" align="right">
                    <a href="<?php echo e(url('/sucursal')); ?>" class="btn btn-secondary" style="text-decoration: none"><i class="bi bi-x-circle"></i> Cancelar</a>
                    <button type="submit" class="btn btn-success"><i class="bi bi-floppy2-fill"></i> Guardar</button>
                </div>
            </div>
        </form>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /opt/lampp/htdocs/contapy/resources/views/sucursal/create.blade.php ENDPATH**/ ?>