@extends('layouts.announcement.app')

@section('content')
    <div class="col-md-8">
        <div class="card">
            <div class="container">
                <div class="panel panel-primary">
                    <div class="panel-heading">{{ __('Create Announcement') }}</div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="card-body">

                                    <div class='col-md-12'>
                                        @if (session()->has('success'))
                                            <p class="text-success">{{ session('success') , session()->pull('success')}}</p>
                                        @else
                                            <p class="text-danger">{{ session('error') , session()->pull('error')}}</p>
                                        @endif
                                    </div>

                            <form method="POST" action="{{ route('announcement.post') }}">
                                @csrf
                                <div class='col-md-6'>
                                    <div class="form-group">
                                        <label class="control-label">{{ __('Start Date') }}</label>
                                        <div class='input-group date' id='datetimepicker1'>
                                            <input name="startdate" type='text' class="form-control" required/>
                                            <span class="input-group-addon">
                                     <span class="glyphicon glyphicon-calendar"></span>
                                     </span>
                                        </div>
                                    </div>
                                </div>

                                <div class='col-md-6'>
                                    <div class="form-group">
                                        <label class="control-label">{{ __('End Date') }}</label>
                                        <div class='input-group date' id='datetimepicker2'>
                                            <input name="enddate" type='text' class="form-control" required/>
                                            <span class="input-group-addon">
                                     <span class="glyphicon glyphicon-calendar"></span>
                                     </span>
                                        </div>
                                    </div>
                                </div>

                                <div class='col-md-12'>
                                    <div class="form-group">
                                        <label class="control-label">{{ __('Content') }}</label>
                                        <textarea id="content" name="content" class="form-control" minlength="20" maxlength="200" required></textarea>
                                    </div>
                                </div>

                                <div class='col-md-12'>
                                    <button type="submit" class="btn btn-primary">
                                        {{ __('Create') }}
                                    </button>
                                    <br><br>
                                </div>


                                <center>
                                    <div class='col-md-12'>
                                        <a href="{{ route('announcements.view') }}">
                                            {{ __('View Announcements') }}
                                        </a>
                                    </div>
                                </center>

                            </form>

                </div>
            </div>
        </div>
    </div>
@endsection


