@extends('layouts.app')

@section('content')
<div class="container">
    <div class="col-md-8 offset-md-2">
        <h1>{{isset($ichambaparameter)?'Editar':'Nuevo'}} Parametro</h1>
        <hr>
        @if(isset($ichambaparameter))
            {!! Form::model($ichambaparameter,['method'=>'put','id'=>'frm']) !!}
        @else
            {!! Form::open(['id'=>'frm']) !!}
        @endif
        <div class="form-group row required">
            {!! Form::label("parameter","Parametro",["class"=>"col-form-label col-md-3 col-lg-2"]) !!}
            <div class="col-md-8">
                {!! Form::text("parameter",null,["class"=>"form-control".($errors->has('parameter')?" is-invalid":""),"autofocus",'placeholder'=>'Nombre del parametro']) !!}
                <span id="error-name" class="invalid-feedback"></span>
            </div>
        </div>
        <div class="form-group row required">
            {!! Form::label("num_value","Valor Númerico",["class"=>"col-form-label col-md-3 col-lg-2"]) !!}
            <div class="col-md-8">
                {!! Form::text("num_value",null,["class"=>"form-control".($errors->has('num_value')?" is-invalid":""),"autofocus",'placeholder'=>'Valor númerico (opcional)']) !!}
                <span id="error-name" class="invalid-feedback"></span>
            </div>
        </div>
        <div class="form-group row required">
            {!! Form::label("string_value","Valor de texto",["class"=>"col-form-label col-md-3 col-lg-2"]) !!}
            <div class="col-md-8">
                {!! Form::text("string_value",null,["class"=>"form-control".($errors->has('string_value')?" is-invalid":""),"autofocus",'placeholder'=>'Valor de texto (opcional)']) !!}
                <span id="error-name" class="invalid-feedback"></span>
            </div>
        </div>
        @if ($errors->any())
            <div class="alert alert-danger">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        <div class="form-group row">
            <div class="col-md-3 col-lg-2"></div>
            <div class="col-md-4">
                <a href="{{url('parameters')}}" class="btn btn-danger btn-xs">
                    Atrás</a>
                {!! Form::button("Guardar",["type" => "submit","class"=>"btn btn-primary btn-xs"])!!}
            </div>
        </div>
        {!! Form::close() !!}
    </div>
</div>
@endsection
