@extends('admin.layouts.app')
@section('panel')
    <div class="row mb-none-30">
        <div class="col-lg-12 mb-3">
            <a href="{{ route('admin.noticeBoard.index') }}" class="btn btn--primary float-right"><i class="las la-arrow-left"></i> @lang(' Back')</a>
        </div>
        <div class="col-lg-12">
            <form action="{{ route('admin.noticeBoard.update',$notice->id) }}" method="POST">
                @csrf
                <div class="card">
                    <div class="card-body">
                        <div class="row">

                            <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 col-xxl-12">
                                <label>@lang('Heading Of Notice')</label>
                                <input type="text" class="form-control form-control-lg" name="title"
                                    value="{{ old('title', $notice->title) }}">
                            </div>
                            <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 col-xxl-12">
                                <div class="form-group">
                                    <label>@lang('Description')</label>
                                    <textarea class="form-control nicEdit" rows="12" name="body">{!! old('body', $notice->body) !!}</textarea>
                                </div>
                            </div>
                            <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-6">
                                <div class="form-group">
                                    <label for="status">@lang('Status')</label>
                                    <select name="status" id="status" class="form-control">
                                        <option value="{{ Status::Draft }}"
                                            {{ $notice->status == Status::Draft ? 'selected' : '' }}>
                                            @lang('Draft')</option>
                                        <option value="{{ Status::Published }}"
                                            {{ $notice->status == Status::Published ? 'selected' : '' }}>
                                            @lang('Published')</option>
                                        <option value="{{ Status::Inactive }}"
                                            {{ $notice->status == Status::Inactive ? 'selected' : '' }}>
                                            @lang('Inactive')</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                @if (!$notice->id)
                                    <button type="submit" class="btn btn--primary w-100 h-45">@lang('Notice Create')</button>
                                @else
                                    <button type="submit" class="btn btn--primary w-100 h-45">@lang('Notice Update')</button>
                                @endif
                            </div>
                        </div>
            </form>
        </div>
    </div>
@endsection
