<header id="" class="site-header">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <nav class="mt-2 header-navbar navbar-expand-lg navbar-fixed align-items-center navbar-brand-center">
                        <div class="navbar-container d-flex content">
                            <div class="col-md-6" >
                                <div class="d-flex align-items-center">
                                    <ul class="nav navbar-nav mr-auto header_left">
                                        <li class="nav-item d-flex">
                                            <div class="col md-6 mt-1 mb-1" style="margin-left: 10px;">
                                                <a class="logo" href="index.html">
                                                    <h3 style="font-family:Ubuntu !important; color: #3c4858 !important; font-size: 30px !important;">Research Admission</h3>
                                                </a>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="col-md-6" style="display: flex; justify-content: end;">
                                <div >
                                    <div style="border: 1px solid #e2e9ff; width: auto; border-radius: 10px; display: flex; height: 60%; margin-top: 11px;">
                                        @if(\Auth::guard('teacher')->user()->is_available ==0)
                                            <p class="form-check-label ms-2" style="font-size: 11px; margin-top: 9px;">Not Available for Supervision</p>
                                        @endif
                                        <div class="form-check form-switch ms-3" id="" style="margin-top: 6px;">
                                            <input class="form-check-input teacher_is_available" type="checkbox" name="is_available" value="" @if(\Auth::guard('teacher')->user()->is_available ==0) checked @endif>
                                            @if(\Auth::guard('teacher')->user()->is_available ==1)
                                            <label class="form-check-label" for="" style="font-size: 11px; margin-top: -1px; margin-right: 9px;">Available for Supervision </label>
                                            @endif
                                        </div>
                                    </div>
                                </div>
                                <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                    <li class="nav-item dropdown dropdown-notification">
                                        <a href="javascript:void(0)" class="open_modal_page" data-url="{{route('modal-get',['name'=>'add_wishlist'])}}" data-title="Wishlist">
                                        <button class="btn btn2" style="padding: 6px 10px !important;">New Invite</button>
                                        </a>
                                    </li>
                                </ul>
                                @php
                                    $hashids = new \Hashids\Hashids('student_q_signup', 25);
                                @endphp
                                <div class="flag_country copy" style="display:flex; cursor:pointer;" data-clipboard-text="{{ url('q-apply/'.$hashids->encode(auth_user('teacher')->id)) }}">
                                    <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                        <li class="nav-item dropdown dropdown-notification">
                                            <a href="javascript:void(0)">
                                                <button class="btn btn2" style="padding: 6px 10px !important; background-color: #ffad00 !important; color: #191e38 !important;">Q-Apply</button>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                                <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                    <li class="nav-item dropdown dropdown-notification">
                                        <a href="">
                                            <i class="fa fa-bell change_pass_btn" style="padding: 8px 9px;"></i>
                                        </a>
                                    </li>
                                </ul>
                                <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                    <li class="nav-item dropdown dropdown-notification">
                                        <a href="">
                                            <h5 class="change_pass_btn" style="height: 33px; margin-top: 7px; padding: 4px 9px;">IZ</h5>
                                        </a>
                                    </li>
                                </ul>
                                <ul class="nav navbar-nav align-items-center ml-auto header_right ps-2">
                                    <li class="nav-item dropdown dropdown-notification">
                                        <a href="{{ url('teacher-logout') }}"
                                            onclick="event.preventDefault();
                                                            document.getElementById('logout-form').submit();">
                                             <i class="fa fa-sign-out change_pass_btn"></i>
                                        </a>
                                        <form id="logout-form" action="{{ url('teacher-logout') }}" method="POST" class="d-none">
                                            @csrf
                                        </form>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
        </div>
</header>

@push('js')
<script>
    $(".start_date").flatpickr({
            dateFormat: "M y",
        });

        var clipboard = new ClipboardJS('.copy');

        clipboard.on('success', function(e){
            //pop_up_msg('Successfully copy this link.');

            new Noty({
                theme:'sunset',
                text: 'Successfully copy this link',
                type: 'success',
                timeout:1500
            }).show();

        }); 


        $('.teacher_is_available').on('click', function(){
            var self =$(this);
            var checked =self.prop("checked");

            var form_data={
                _token :"{{csrf_token()}}",
                'checked':checked,
                }

            swal({
                title: "Are you sure you want to change status?",
                text: "Please check before submitting!",
                type: "warning",
                showCancelButton: true,
                confirmButtonClass: "btn-danger",
                cancelButtonClass: "btn-info",
                confirmButtonText: "Yes",
                cancelButtonText: "No",
                closeOnConfirm: true,
                closeOnCancel: true
            }, function(isConfirm){

                if(isConfirm){
                    $.post("{{ route('ajax-post', ['name'=>'teacher_is_available']) }}", form_data, function(res){
                        pop_up_msg(res.msg);
                        window.location.reload();

                    }).fail(function(err){

                        pop_up_msg(err_msg(err), 'error');

                    });
                }
            });
        });  
</script>
@endpush