<form action="<?= e(url('configuracion/resoluciones')) ?>" method="post" class="row g-2">
    <?= csrf_field() ?>
    <div class="col-md-6">
        <label class="form-label">Sucursal</label>
        <?php $selectedResolutionBranch = (int) old('r_sucursal_id', old('sucursal_id', 0)); ?>
        <select class="form-select" name="r_sucursal_id">
            <option value="0">General (todas)</option>
            <?php foreach ($branches as $branch): ?>
                <option value="<?= e((string) $branch['id']) ?>" <?= $selectedResolutionBranch === (int) $branch['id'] ? 'selected' : '' ?>>
                    <?= e((string) $branch['nombre']) ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="col-md-6">
        <label class="form-label">Nro. resolución</label>
        <input class="form-control" name="r_numero_resolucion" maxlength="80" value="<?= e((string) old('r_numero_resolucion', old('numero_resolucion', ''))) ?>" required>
    </div>
    <div class="col-md-3">
        <label class="form-label">Prefijo</label>
        <input class="form-control" name="r_prefijo" maxlength="20" value="<?= e((string) old('r_prefijo', old('prefijo', ''))) ?>">
    </div>
    <div class="col-md-3">
        <label class="form-label d-block">Activa</label>
        <input type="hidden" name="r_activo" value="0">
        <div class="form-check mt-2">
            <input class="form-check-input" type="checkbox" name="r_activo" value="1" <?= (string) old('r_activo', old('activo', '1')) === '1' ? 'checked' : '' ?>>
        </div>
    </div>
    <div class="col-md-3">
        <label class="form-label">Fecha desde</label>
        <input type="date" class="form-control" name="r_fecha_desde" value="<?= e((string) old('r_fecha_desde', old('fecha_desde', ''))) ?>" required>
    </div>
    <div class="col-md-3">
        <label class="form-label">Fecha hasta</label>
        <input type="date" class="form-control" name="r_fecha_hasta" value="<?= e((string) old('r_fecha_hasta', old('fecha_hasta', ''))) ?>" required>
    </div>
    <div class="col-md-6">
        <label class="form-label">Rango desde</label>
        <input type="number" min="1" class="form-control" name="r_rango_desde" value="<?= e((string) old('r_rango_desde', old('rango_desde', ''))) ?>" required>
    </div>
    <div class="col-md-6">
        <label class="form-label">Rango hasta</label>
        <input type="number" min="1" class="form-control" name="r_rango_hasta" value="<?= e((string) old('r_rango_hasta', old('rango_hasta', ''))) ?>" required>
    </div>
    <div class="col-12 d-flex justify-content-end">
        <button class="btn btn-primary" type="submit">Registrar resolución</button>
    </div>
</form>
<?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/veltrix-v2/resources/views/modules/configuracion/partials/resolution_form.blade.php ENDPATH**/ ?>