
@extends("layouts.metor.admin")
@section("content")
@section("title","Add Skills")

<div class="row">
    <div class="col-xl-12 col-lg-12">
        <div class="alert alert-success my-3" style="display:none;" id="success"></div>
        
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h4 class="card-title mb-0">Add Skills</h4>
                <a href="javascript:history.back()" class="btn btn-sm btn-light">
                    <i class="ri-arrow-left-line"></i> Back
                </a>
            </div>
            
            <div class="card-body">
                <form accept-charset="utf-8" name="add-form" id="add-form" >
                    @csrf
                    <div class="row">


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'>{{ $dbs_skills['name_req'];}}{{ $dbs_skills['name_title']; }}:</label>
        <input type = '{{$dbs_skills['name_html5_type'] }}' name = "name" id = "add-name" autocomplete = 'off' maxlength ='{{  $dbs_skills['name_max'] }}'  value='' @if($dbs_skills['name_html5_req']!='') {{ $dbs_skills['name_html5_req'] }} = {{$dbs_skills['name_html5_req']}} @endif class= 'form-control'  >
        <span class='text-danger' id='add-nameError'></span>
    </div>
</div>


<div class="col-lg-12">
    <div class="mb-3">
        <label class='form-label'>{{ $dbs_skills['description_req'];}}{{ $dbs_skills['description_title']; }}:</label>
        <textarea type = '{{$dbs_skills['description_html5_type'] }}' name = "description" id = "add-description" autocomplete = 'off' maxlength ='{{  $dbs_skills['description_max'] }}' @if($dbs_skills['description_html5_req']!='') {{ $dbs_skills['description_html5_req'] }} = {{$dbs_skills['description_html5_req']}} @endif class= 'form-control'   oninput='updateCharCount(this,"add-descriptioncharCount")'></textarea>
        <span class='text-danger' id='add-descriptioncharCount'></span> 
        <span class='text-danger' id='add-descriptionError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'>{{ $dbs_skills['status_req'];}}{{ $dbs_skills['status_title']; }}:</label><br/>
        <div class="mt-2">
            @php
            $options = $dbs_skills['status_array'];
            @endphp

            @foreach ($options as $key => $value)
                @php
                $checked = ($key == 'Active') ? 'checked="checked"' : '';
                @endphp

                <label class="btn btn-outline-primary">
                    <input type="radio" name="status" value="{{ $key }}" id="add-status" {{ $checked }}/> {{ $value }}
                </label>
            @endforeach
        </div>
    </div>
</div>

    
                    </div>
                    

                    <div class="p-3 mb-3 rounded">
                        <div class="row justify-content-end g-2">
                            <div class="col-lg-3">
                                <button type='submit' name='add-submit' id='add-submit' class='btn btn-outline-secondary w-100' data-args1='{{ route("skills.store") }}' data-args2='admin/skills' onclick='addUpdate(event, "add")'>
                                    <i class="ri-save-line"></i> Save 
                                </button>
                            </div>
                            <div class="col-lg-2">
                                <a href="{{ route('skills.index') }}" class="btn btn-primary w-100">
                                    <i class="ri-close-circle-line"></i> Cancel
                                </a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

@endsection

