<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'SRC Compliance') }}</title>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>
    <script src="{{ asset('js/jquery.min.js') }}"></script>
    <script src="/js/ckeditor.js" defer></script>
    <script src="/js/bootstable.js" defer></script>
    <script src="/js/jquery.datetimepicker.js" defer></script>
    <script src="{{ asset('js/src_compliance.js') }}" defer></script>
    <script src="{{ asset('js/questionnaire.js') }}" defer></script>

    <link rel="icon" href="/favicon.png" sizes="32x32" />

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

    <!-- Styles -->
    <link href="{{ asset('/css/app.css') }}" rel="stylesheet">
    <link href="{{ asset('/css/jquery.datetimepicker.css') }}" rel="stylesheet">
    <link href="{{ asset('/css/style.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
    <div id="app">
        <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
            <div class="row header-src">
                <div class="col-md-4 col-xs-12">
                    @guest
                    <a class="navbar-brand" href="{{ url('/login') }}">
                        <img src="/images/logo.png" width="200px" alt="SRC" />
                    </a>
                    @else
                    <?php $role = Auth::user()->userRole->role ?>
                    @if($role == 'SRC Employee' || $role == 'SRC Management')
                    <a class="navbar-brand" href="{{ url('/dashboard') }}">
                        <img src="/images/logo.png" width="200px" alt="SRC" />
                    </a>
                    @else
                    <a class="navbar-brand" href="{{ url('/stakeholders') }}">
                        <img src="/images/logo.png" width="200px" alt="SRC" />
                    </a>
                    @endif
                    @endguest
                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
                        <span class="navbar-toggler-icon"></span>
                    </button>
                </div>
                <div class="col-md-4 col-xs-12 center-header">
                    <!-- <em class="fa fa-phone"> -->
                        <!-- (+254) (20) 2710065/81 or (0)794 587 903 -->
                        COMPLIANCE MANAGEMENT SYSTEM
                    <!-- </em> -->
                </div>
                <div class="col-md-4 col-xs-12">
                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <!-- Left Side Of Navbar -->
                        <ul class="navbar-nav mr-auto">

                        </ul>

                        <!-- Right Side Of Navbar -->
                        <ul class="navbar-nav ml-auto">
                            <!-- Authentication Links -->
                            @guest
                            <li class="nav-item">
                                <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
                            </li>
                            @if (Route::has('register'))
                            <li class="nav-item">
                                <a class="nav-link" href="{{ route('register') }}">{{ __('Registration') }}</a>
                            </li>
                            @endif
                            @else
                            <li class="nav-item dropdown">
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" style="font-size: 15px;" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                <i class="fa fa-user">&nbsp;&nbsp;{{ Auth::user()->name }}</i>
                                </a>

                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown" style="font-size: 15px;">
                                    <a class="dropdown-item" href="#">
                                    <i class="fa fa-file">&nbsp;&nbsp;{{ __('Download User Guide') }} </i>
                                    </a>
                                    <a class="dropdown-item" href="#" target="_blank">
                                    <i class="fa fa-ticket">&nbsp;&nbsp;{{ __('Help Desk') }} </i>
                                    </a>
                                    <a class="dropdown-item" href="{{ route('logout') }}" onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                    <i class="fa fa-sign-out">&nbsp;&nbsp;{{ __('Logout') }} </i>
                                    </a>

                                    <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
                                        @csrf
                                    </form>
                                </div>
                            </li>
                            @endguest
                        </ul>
                    </div>
                </div>
            </div>
        </nav>

        <main>
            <div class="container content">
                @yield('content')
            </div>
        </main>
        @include('footer')
    </div>
</body>

</html>