@extends('admin.layouts.container')

@section('content')

<div class="side-title">
    <h3>{{ $head ?? '' }}</h3>

</div>

<div class="border-item">

    <form class="form-row" method="post" action="{{ $action }}">

        @if($code ?? ''  && $code->id)
            @method('PUT')
        @endif
        @csrf

        <div class="form-group col-lg-6">
            <label>{{ meta('code', getCurrentLocale()) ?? __('codes.code') }} </label>
            <input type="text" class="form-control {{ $errors->has('code') ? 'is-invalid' : '' }}" name="code" placeholder="{{ meta('code', getCurrentLocale()) ??__('codes.code') }}" value='{{ old("code", $code->code ?? "") }}'/>
        </div>
        <div class="form-group col-lg-6">
            <label>{{ meta('percentage', getCurrentLocale()) ?? __('codes.percentage') }} </label>
            <input type="number" step="0.01" class="form-control {{ $errors->has('percentage') ? 'is-invalid' : '' }}" name="percentage" placeholder="{{ meta('percentage', getCurrentLocale()) ??__('codes.percentage') }}" value='{{ old("percentage", $code->percentage ?? "") }}'/>
        </div>
       

        <div class="text-center mt-5 col-12">
            <button class="butn"><span>{{ __('dashboard.save') }}</span></button>
        </div>
    </form>
</div>

@endsection

@section('inner_js')
 <script type="text/javascript">
    $(function () {
    $(".repeat").on('click', function () {
        var $self = $(this);
        $('#body').append($('#rowsdata').clone());

    });
});

</script>
    <!-- Editor JS files -->
  {{--    <script src="{{ asset('/assets/admin/js/lib/tinymce.min.js') }}"></script>--}}
            <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
    <script>
        let route_prefix = "{{ url(config('lfm.prefix')) }}",
            url = "{{url('/')}}/",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
@endsection


