<?php $__env->startSection('content'); ?>
    <section class="container all-container">
        <nav>
            <div class="nav nav-tabs" id="nav-tab" role="tablist">
                <a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Aplicacion</a>
                <a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Usuarios de la aplicacion</a>
            </div>
        </nav>
        <div class="tab-content" id="nav-tabContent">
            <div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
                <div class="card mb-3 mt-2">
                    <div class="card-header titulo-eliminar">
                        <div class="title">
                            <i class="fas fa-ruler"></i> aplicacion
                        </div>
                        <div onclick="eliminarAplicacion(<?php echo e($aplicacion->id); ?>)"class="eliminar-container">
                            <i class="far fa-trash-alt eliminar-icon"></i>
                        </div>
                    </div>
                    <div class="card-body">
                        <form action="/actualizarAplicacion/<?php echo e($aplicacion->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($aplicacion->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">Codigo</label>
                                <div class="col-sm-10">
                                <input type="text" id="codigo" value="<?php echo e($aplicacion->codigo); ?>" name="codigo"  class="form-control" placeholder="codigo" disabled required>
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-sm-2">Tipo</div>
                                <div class="col-sm-10 col-md-2">
                                    <select class="form-control " name="tipo" disabled required>
                                        <option value="proyecto">Proyecto</option>
                                        <option value="sistema">Sistema</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-sm-2">Estado</div>
                                <div class="col-sm-10 col-md-2">
                                    <select class="form-control" name="estado" disabled required>
                                        <option value="activo">Activo</option>
                                        <option value="inactivo">Inactivo</option>
                                    </select>
                                </div>
                            </div>
                            <fieldset class="form-group">
                                <div class="row">
                                    <legend class="col-form-label col-sm-2 pt-0">Descripcion</legend>
                                    <div class="col-sm-10">
                                    <textarea  style="resize: none;" rows="5" id="textarea" name="descripcion" class="form-control" disabled required><?php echo e($aplicacion->descripcion); ?></textarea>
                                    </div>
                                </div>
                            </fieldset>
                            <div class="form-group row">
                                <div class="col-sm-10">
                                    <button type="button" onclick="editar()" id="button-editar" class="btn btn-info">Editar</button>
                                    <button type="submit" class="btn btn-primary" id="button-guardar">Guardar</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="card-footer small text-muted">
                        Updated <?php echo e($aplicacion->updated_at); ?>

                    </div>
                </div>
                
                <div class="card mb-3">
                    <div class="card-header">
                    <i class="fas fa-ruler"></i> Modulos de la aplicacion
                    </div>
                    <div class="card-body">
                        <div class="container">
                            <div class="row">
                                <?php if( $modulos == '[]'): ?>
                                <small>Esta aplicacion no tiene modulos</small>
                                <?php endif; ?>
                                <?php $__currentLoopData = $modulos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $modulo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div href="#" onclick="moduloAplicacion(<?php echo e($modulo->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($modulo->nombre); ?></h5>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
            
            <div class="card mb-3 mt-2">
                    <div class="card-header">
                    <i class="fas fa-ruler"></i> Usuarios de la aplicacion
                    </div>
                    <div class="card-body">
                        <legend class="col-form-label col-sm-4 pt-0"><h5> Clientes: </h5></legend>
                        <div class="container">
                            <div class="row">
                                <?php if( $clientes == '[]'): ?>
                                <small class="text-muted">Esta aplicacion no tiene clientes</small>
                                <?php endif; ?>
                                <?php $__currentLoopData = $clientes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cliente): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <a href="../showuser/<?php echo e($cliente->user_id); ?>" onclick="moduloAplicacion(<?php echo e($modulo->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($cliente->name); ?></h5>
                                        </div>
                                    </a>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div><hr>
                        <legend class="col-form-label col-sm-4 pt-0 mt-4"><h5> Desarrolladores: </h5></legend>
                        <div class="container">
                            <div class="row">
                                <?php if( $desarrolladores == '[]'): ?>
                                <small class="text-muted">Esta aplicacion no tiene desarrolladores</small>
                                <?php endif; ?>
                                <?php $__currentLoopData = $desarrolladores; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $desarrollador): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <a href="../showuser/<?php echo e($desarrollador->user_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($desarrollador->name); ?></h5>
                                        </div>
                                    </a>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
	<script src="<?php echo e(asset('js/sweetalert.min.js')); ?>"></script>
	<link  media="all" rel="stylesheet" type="text/css" href="<?php echo e(asset('css/general.css')); ?>">
	<script src="<?php echo e(asset('js/aplicacion.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dashboard', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>