<?php $__env->startSection('content'); ?>
    <section class="container all-container">
        <div class="card mb-3">
            <div class="card-header titulo-eliminar">
                <div class="title">
                    <i class="fab fa-buromobelexperte"></i> Modulo
                </div>
                <strong><?php echo e($modulo->nombre); ?></strong>
                <div class="eliminar-container">
                    <div class="btn-group mr-2">
                        <button class="btn btn-sm btn-outline-secondary" onclick="window.location='<?php echo e(route("agregarFormulario",[$modulo->id])); ?>'"><i class="fas fa-plus"></i></button>
                        <button class="btn btn-sm btn-outline-secondary" onclick="editar()"><i class="fas fa-edit"></i></button>
                        <button class="btn btn-sm btn-outline-secondary" onclick="eliminarModulo('<?php echo e(route("eliminarModulo",[$modulo->id])); ?>','<?php echo e(route('modulos')); ?>')"><i class="far fa-trash-alt" ></i></button>
                    </div>
                </div>
            </div>
            <div class="card-body padding-10">
                <form action="<?php echo e(route('actualizarModulo',[$modulo->id])); ?>" method="post"  id="form-datos">
                <?php echo csrf_field(); ?>
                    <div class="form-group row">
                        <label for="inputEmail3" class="col-sm-2 col-form-label">Nombre</label>
                        <div class="col-sm-10">
                            <input type="text" id="nombre" value="<?php echo e($modulo->nombre); ?>" name="nombre"  class="form-control" placeholder="Nombre" disabled required>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputPassword3" class="col-sm-2 col-form-label">Aplicacion</label>
                        <div class="col-sm-10">
                                <span class="form-control span-edit-show col-md-4"><?php echo e($modulo->app_name); ?></span>
                            <div class="row aplicacion-select">
                                <select class="form-control col-md-4 span-edit-hidden" name="aplicacion" required disabled>
                                    <?php $__currentLoopData = $aplicaciones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $aplicacion): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($aplicacion->id); ?>"><?php echo e($aplicacion->nombre); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputEmail3" class="col-sm-2 col-form-label">Descripcion</label>
                        <div class="col-sm-10">
                            <textarea id="Descripcion" style="resize: none;" rows="5" id="Descripcion" name="Descripcion"  class="form-control" placeholder="Descripcion" required disabled><?php echo e($modulo->Descripcion); ?></textarea>
                        </div>
                    </div>
                    <div class="form-group buttons-edit-container row">
                        <div class="col-sm-10">
                            <button type="button" onclick="editar()" id="button-editar" class="btn btn-dark">Cancelar</button>
                            <button type="submit" id="button-guardar" class="btn btn-light" id="button-guardar">Guardar</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="card-footer small text-muted">
                Updated <?php echo e($modulo->updated_at); ?>

            </div>
        </div>
        
        <div class="card mb-3">
            <div class="card-header">
            <i class="fab fa-wpforms"></i> Formularios de la aplicacion
            </div>
            <div class="card-body">
                <div class="container">
                    <div class="row">
                        <?php if( $formularios == '[]'): ?>
                          <small>Este Modulo no tiene Formularios</small>
                        <?php endif; ?>
                        <?php $__currentLoopData = $formularios; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $formulario): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div onclick="window.location='<?php echo e(route("Formulario",[$formulario->id])); ?>'" class="col-md-4 list-group-item list-group-item-action flex-column pointer">
                                <div class="d-flex w-100 justify-content-between">
                                <h5 class="mb-1"><?php echo e($formulario->nombre); ?></h5>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </div>
        </div>
    </section>
	<script src="<?php echo e(asset('js/sweetalert.min.js')); ?>"></script>
	<script src="<?php echo e(asset('js/aplicacion.js')); ?>"></script>
	<script src="<?php echo e(asset('js/modulo.js')); ?>"></script>
	<link  media="all" rel="stylesheet" type="text/css" href="<?php echo e(asset('css/general.css')); ?>">

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