<?php $__env->startSection('titulo','Sistema'); ?>
<?php $__env->startSection('contenido'); ?>
<?php $editando = (bool) $registro->id; ?>
<h4><i class="fa fa-sitemap"></i> <?php echo e($editando?'Editar':'Nuevo'); ?> sistema</h4>
<form method="POST" action="<?php echo e($editando ? route('sistemas.update',$registro) : route('sistemas.store')); ?>" class="card p-3">
  <?php echo csrf_field(); ?> <?php if($editando): ?> <?php echo method_field('PUT'); ?> <?php endif; ?>
  <div class="row g-3">
    <div class="col-md-6"><label class="form-label small">Área *</label>
      <select name="area_id" class="form-select" required>
        <option value="">—</option>
        <?php $__currentLoopData = $areas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($a->id); ?>" <?php if(old('area_id',$registro->area_id)==$a->id): echo 'selected'; endif; ?>><?php echo e($a->nombre); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
      </select></div>
    <div class="col-md-3"><label class="form-label small">Código *</label>
      <input name="codigo" value="<?php echo e(old('codigo',$registro->codigo)); ?>" class="form-control" maxlength="30" required></div>
    <div class="col-md-3 d-flex align-items-end">
      <div class="form-check form-switch">
        <input type="hidden" name="activo" value="0">
        <input type="checkbox" name="activo" value="1" class="form-check-input" <?php echo e(old('activo',$registro->activo??1)?'checked':''); ?>>
        <label class="form-check-label">Activo</label>
      </div>
    </div>
    <div class="col-md-12"><label class="form-label small">Nombre *</label>
      <input name="nombre" value="<?php echo e(old('nombre',$registro->nombre)); ?>" class="form-control" required></div>
    <div class="col-md-12"><label class="form-label small">Descripción</label>
      <textarea name="descripcion" class="form-control" rows="2"><?php echo e(old('descripcion',$registro->descripcion)); ?></textarea></div>
  </div>
  <div class="mt-3 text-end">
    <a href="<?php echo e(route('sistemas.index')); ?>" class="btn btn-outline-secondary">Cancelar</a>
    <button class="btn btn-primario"><i class="fa fa-save"></i> Guardar</button>
  </div>
</form>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\mto\resources\views/catalogos/sistemas_form.blade.php ENDPATH**/ ?>