@extends('admin.layouts.sidebar')

@section('content')
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">

                    <h4 class="card-title">{{ $headertext }}</h4>
                    <p class="card-title-desc">
                        لطفا اطلاعات فیلد را وارد نمایید
                    </p>

                    <form action="{{ route('admin.factoraddfild') }}" method="post">
                        @csrf
                        <div class="form-group row">
                            <label for="example-text-input" class="col-md-2 col-form-label">نام فیلد</label>
                            <div class="col-md-10">
                                <input class="form-control text-center" value="{{ old(key: 'name') }}" type="text"
                                    name="name" placeholder="حقوق پایه" id="example-text-input">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="example-text-input" class="col-md-2 col-form-label">نوع</label>
                            <div class="col-md-10">
                                <select name="type" style="text-align: center" class="form-control">
                                    <option value="1">عدد</option>
                                    <option value="2">متن</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="example-text-input" class="col-md-2 col-form-label">وضعیت</label>
                            <div class="col-md-10">
                                <select name="status" style="text-align: center" class="form-control">
                                    <option value="1">مزایا</option>
                                    <option value="2">کسورات</option>
                                </select>
                            </div>
                        </div>


                        <button type="submit" class="btn btn-success waves-effect waves-light"
                            style="width: 100%">افزودن</button>
                        <br><br>
                        @if ($errors->any())
                            @foreach ($errors->all() as $error)
                                <div class="alert alert-danger" role="alert">
                                    {{ $error }}
                                </div>
                            @endforeach
                        @endif


                        @if (session()->has('message'))
                            <div class="alert alert-success" role="alert">
                                {{ session()->get('message') }}
                            </div>
                        @endif

                </div>
                </form>
            </div>
        </div>
        <!-- end col -->
    </div>
@endsection
