@extends('admin.layout.admin_layout')
@section('content')
    <div class="content-wrapper">
        <div class="card card-warning">
            <div class="card-header">
                <h3 class="card-title">Edit <b>{{$data['key']}}</b> Heading</h3>
            </div>
        @include('admin.layout.message')

        <!-- /.card-header -->
            <div class="card-body">
                <form action="{{route('admin::save_cms')}}" method="POST" enctype="multipart/form-data">
                    @csrf
                    <div class="row">
                        <input type="hidden" name="key" class="form-control"  value="{{$data['key']}}">
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label>Title</label><span style="color:red;">*</span>
                                <input type="text" name="title" class="form-control" placeholder="Enter ..." value="{{$data['title']}}">
                            </div>
                            @if ($errors->has('title'))
                                <span class="alert alert-danger">{{ $errors->first('title') }}</span>
                            @endif
                        </div>
                    </div>
                    <br>

                    <div class="row">
                        <div class="col-sm-12">

                            <div class="form-group">
                                <label>Description</label>
                                <textarea name="description" class="form-control" rows="5" cols="50" placeholder="Enter ...">{{$data['description']}}</textarea>
                            </div>
                            @if ($errors->has('description'))
                                <span class="alert alert-danger">{{ $errors->first('description') }}</span>
                            @endif
                        </div>
                    </div>
                    <!-- input states -->

                    <div class="row">
                        <div class="col-sm-2">
                            <div class="custom-control custom-checkbox">
                                <input name="status" class="custom-control-input custom-control-input-info" type="checkbox" id="customCheckbox4" value="Active" @if($data['status'] == "Active") checked @endif >
                                <label for="customCheckbox4" class="custom-control-label">Status</label>
                            </div>
                            @if ($errors->has('status'))
                                <span class="alert alert-danger">{{ $errors->first('status') }}</span>
                            @endif
                        </div>
                    </div>

                    <div class="row">

                        <div class="col-md-12">
                            <div class="form-group" style="text-align:center">
                                <input type="submit" value="Submit" class="btn btn-primary">
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <!-- /.card-body -->
    </div>

@endsection
