@extends('layouts.master')

@section('content')
<!-- DataTables -->
<link rel="stylesheet" href="{{ asset('/assets/') }}/css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="{{ asset('/assets/') }}/switch/rcswitcher.css">
<link rel="stylesheet" href="{{ asset('/assets/') }}/alert/pnotify.css">
<link rel="stylesheet" href="{{ asset('/assets/') }}/alert/sweetalert.css">
<link rel="stylesheet" href="{{ asset('/assets/') }}/alert/sweet-alert-animations.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="{{asset('/assets/') }}/select2/dist/css/select2.min.css">

<script src="{{ asset('assets/ckeditor/ckeditor.js')}}"></script>


<div class="row">
    <div class="col-md-8 col-md-offset-2">
        <div class="panel panel-default">
    <!-- Default panel contents -->
            <div class="panel-heading"></div>
                <header class="panel-heading" style="height:50px;">
                    <div class="pull-left">
                        {{$title}}
                    </div>
                    <div>
                         @if(\Auth::user()->utype==1)
                            <a href="{{ url('admin/notice_board') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-list"></i> Notice Board</a> <br><br>
                        @endif
                    </div>
                </header>
            <div class="panel-body">
                <form action="{{ url('admin/notice_board/store') }}" method="POST" class="form-horizontal" enctype="multipart/form-data">
                            {{ csrf_field() }}
                            <div class="form-group">
                                <label for="purpose" class="col-sm-3 col-md-offset-1">Send To : </label>
                                <div class="col-sm-6">
                                    <select class="form-control" id="select2" name="send_to[]" required="" multiple="multiple" data-placeholder="Please Select"
                                        style="width: 100%;">
                                        <option value="all"> All </option>
                                        @foreach($employee as $row)
                                        <option value="{{$row->id}}"> {{ $row->name }} </option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="purpose" class="col-sm-3 col-md-offset-1">Notice Title : </label>
                                <div class="col-sm-6">
                                    <input type='text' name="notice_title" class="form-control" placeholder="Notice Title" required="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="due_date" class="col-sm-3 col-md-offset-1">Expire Date :</label>
                                <div class="col-sm-6">
                                    <input type='text' name="expire_date" id="from" class="form-control date" placeholder="Expire Date" required="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="description" class="col-sm-3 col-md-offset-1">Description :</label>
                                <div class="col-sm-6">
                                    <textarea name="description" rows="7" class="form-control" placeholder="Description" required=""></textarea>
                                </div>
                            </div>
                            <!-- <div class="form-group">
                                <label for="description" class="col-sm-3 col-md-offset-1">Attached file :</label>
                                <div class="col-sm-6">
                                    <input type='file' name="attached[]" class='form-control' multiple>
                                </div>
                            </div> -->


                            <div class="form-group">
                                <div class="col-sm-10 col-sm-offset-4">
                                    <button type="submit" class="btn btn-info"> Send </button>
                                </div>
                            </div>
                    </form>
            </div>

        </div>
    
    </div>
</div>

<div class="modal fade" id="modalPreview">
    <div class="modal-dialog" style='width: 70%;'>
    
    </div>
</div>
@stop

@section('style')
<style>
    .modal-dialog {
      width: 70% !important;
      height: 70% !important;
    }

    .modal-content {
      height: auto;
      min-height: 70% !important;
      border-radius: 0;
    }
</style>
@stop

@section('script')
<script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
<script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>

<script src="{{ asset('/assets/') }}/select2/dist/js/select2.full.min.js"></script>
<script>
    CKEDITOR.replace( 'editor1' );
</script>
<script type="text/javascript">
$(document).ready(function() {
     $( ".date" ).datepicker({
          changeMonth: true,
          changeYear: true,
          dateFormat:"yy-mm-dd"
     });
});
</script>
<script>
  $(function () {
    //Initialize Select2 Elements
    $('#select2').select2()
  })
</script>

@if(Session::has('msg'))
    <div class="alert alert-success center-block msg_alt" >
        <a class="close" data-dismiss="alert" href="#">&times;</a>
        <strong><i class="fa fa-check"></i></strong>&nbsp;
    {{Session::get('msg')}}
    </div>
@endif
@stop