@extends('layouts.backend')
@section('title')
    Admin | Team Member
@endsection
@section('content')
<div class="container-fluid">
    @include('back.parts.message')
      <div class="row justify-content-center">
        <div class="col-lg-10">
            <div class="card mb-4">
               <div class="card-body">
                   <form role="form" method="post" action="{{ route('member.store') }}" enctype="multipart/form-data">
                    {{ csrf_field() }}
                   <div class="form-group">
                     <label class="mb-1">Name <span class="text-danger"></span></label>
                     <input name="name" placeholder="Name" type="text" maxlength="100" class="form-control" required="required">
                     <span class="text-danger">{{ $errors->has('name') ? $errors->first('name'):''}}</span>
                  </div>
                  <div class="form-group">
                     <label class="mb-1">Email <span class="text-danger"></span></label>
                     <input name="email" placeholder="Email" type="email" maxlength="200" class="form-control" required="required">
                     <span class="text-danger">{{ $errors->has('email') ? $errors->first('email'):''}}</span>
                  </div>
                  <div class="form-group">
                     <label class="mb-1">Mobile No <span class="text-danger"></span></label>
                     <input name="mobile_no" placeholder="Mobile No" type="text" maxlength="14" class="form-control" required="required">
                     <span class="text-danger">{{ $errors->has('mobile_no') ? $errors->first('mobile_no'):''}}</span>
                  </div>
                  <div class="form-group">
                     <label class="mb-1">Designation <span class="text-danger"></span></label>
                     <input name="designation" placeholder="Designation" type="text" maxlength="100" class="form-control" required="required">
                     <span class="text-danger">{{ $errors->has('designation') ? $errors->first('designation'):''}}</span>
                  </div>
                  <div class="form-group">
                    <label for="member_type" class="col-form-label text-md-right">Member Type</label>
                    <select name="member_type" id="member_type" class="form-control " required="required">
                        <option value="">--Select Member Type--</option>
                        <option value="executive-committee">Executive Committee</option>
                        <option value="advisory-committee">Advisory Committee</option>
                    </select>
                </div>
                  <div class="form-group">
                    <label for="possition">Position <span
                                class="text-danger"></span></label>
                        <input class="form-control" type="number" min="1" name="position" required="required" placeholder="Enter position (lower number has high priority)"
                               id="position">
                        <span class="text-danger">{{ $errors->has('position') ? $errors->first('position'):''}}</span>
                </div>

                <div class="form-group">
                    <label for="highlight">Highlight</label>
                        <input type="checkbox" id="highlight" name="highlight" value="highlight">
                        <span class="text-danger">{{ $errors->has('highlight') ? $errors->first('highlight'):''}}</span>
                    </div>
                  <div class="form-group">
                     <label class="mb-1">Image <span class="text-danger">*</span> <span style="color: #f10000; font-weight: bold;">(width: 400px; height: 533px)</span></label>
                     <div class="custom-file">
                        <input type="file" class="custom-file-input profile-img-input" id="photo" name="photo" required="required">
                        <label class="custom-file-label" for="customFile">Choose file</label>
                     </div>
                     <span class="text-danger">{{ $errors->has('photo') ? $errors->first('photo'):''}}</span>
                     <div class="pt-1" id="profileLabel" for="photo">
                        <img class="profileImgShow" src="{{ asset('defaults/default3.png')}}">
                     </div>
                  </div>
                  
                  <div class="form-group body__edit">
                            <label class="mb-1">Content</label>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"></script>
                            <textarea id="content24" name="content" class="form-control my-editor"
                            rows="15"></textarea>
                            <script>
                                var editor_config = {
                                    path_absolute: "/",
                                    selector: "#content24",
                                    plugins: [
                                        "textcolor advlist autolink lists link image charmap print preview hr anchor pagebreak",
                                        "searchreplace wordcount visualblocks visualchars code fullscreen",
                                        "insertdatetime media nonbreaking save table directionality",
                                        "emoticons template paste textcolor colorpicker textpattern"
                                        ],
                                    toolbar: "forecolor backcolor insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
                                    relative_urls: false,
                                    file_browser_callback: function (field_name, url, type, win) {
                                        var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
                                        var y = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;

                                        var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
                                        if (type == 'image') {
                                            cmsURL = cmsURL + "&type=Images";
                                        } else {
                                            cmsURL = cmsURL + "&type=Files";
                                        }

                                        tinyMCE.activeEditor.windowManager.open({
                                            file: cmsURL,
                                            title: 'Filemanager',
                                            width: x * 0.8,
                                            height: y * 0.8,
                                            resizable: "yes",
                                            close_previous: "no"
                                        });
                                    }
                                };
                                tinymce.init(editor_config);
                            </script>
                        </div>
                  
                  <div class="form-group">
                     <div class="float-right mb-3">
                        <button type="submit" class="float-right btn btn-primary">Create</button>
                     </div>
                  </div>
                </form>
               </div>
            </div>
         </div>
    </div>
</div>
@endsection
