<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

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

  <title>@yield('title')</title>

  <link rel="shortcut icon" href="{{asset($storage_url.'img/'.$masterFavicon->setting_value)}}?{{$masterFavicon->setting_desc}}" type="image/x-icon" />

  <!-- Bootstrap Core CSS -->
  <link href="{{asset($asset_url.'css/backend/bootstrap.min.css')}}" rel="stylesheet">
  <link href="{{asset($asset_url.'css/backend/jquery-ui.min.css')}}" rel="stylesheet">
  <link href="{{asset($asset_url.'css/backend/jquery.fileupload.css')}}" rel="stylesheet">
  <link href="{{asset($asset_url.'css/backend/toastr.min.css')}}" rel="stylesheet">

  <!-- Bootstrap select -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css">

  <!-- MetisMenu CSS -->
  <link href="{{asset($asset_url.'css/backend/metisMenu.min.css')}}" rel="stylesheet">

  <!-- Timeline CSS -->
  <link href="{{asset($asset_url.'css/backend/timeline.css')}}" rel="stylesheet">

  <!-- Custom CSS -->
  <link href="{{asset($asset_url.'css/backend/startmin.css')}}" rel="stylesheet">

  <!-- Morris Charts CSS -->
  <link href="{{asset($asset_url.'css/backend/morris.css')}}" rel="stylesheet">
  <link href="{{asset($asset_url.'css/backend/waitMe.css')}}" rel="stylesheet">
    
  <!-- Date Picker -->
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker.min.css">

  <!-- Custom Fonts -->
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap.min.css">

  <link href="{{asset($asset_url.'css/app_manage.css')}}" rel="stylesheet">
  <script>
      window.Laravel = {!! json_encode([
          'csrfToken' => csrf_token(),
      ]) !!};
  </script>
  @routes
  {!! Charts::styles() !!}
</head>
<body>

  <div id="wrapper">

    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      
      <div class="navbar-header">
        <a class="navbar-brand" href="#"></a>
      </div>

      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>

      <!-- Top Navigation: Right Menu -->
      <ul class="nav navbar-right navbar-top-links">

        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">
            <i class="fa fa-user fa-fw"></i> {{ Auth::user()->name }} <b class="caret"></b>
          </a>

          <ul class="dropdown-menu dropdown-user">
            <li>
              <a href="{{ route('manage.users.show') }}">
                <i class="fa fa-sign-out fa-fw"></i> @lang('manage.profile')
              </a>
            </li>  
            <li>
              <a
                href="{{ route('logout') }}"
                onclick="event.preventDefault();
                document.getElementById('logout-form').submit();"
              >
                <i class="fa fa-sign-out fa-fw"></i> @lang('manage.logout')
              </a>

              <form id="logout-form" action="{{ route('logout') }}" method="POST">
                {{ csrf_field() }}
              </form>
            </li>      
          </ul>
        </li>
      </ul>
      <!-- /. Navigation -->

      <!-- Sidebar -->
      <div class="navbar-default sidebar" role="navigation">
        <div class="sidebar-nav navbar-collapse">

          <ul class="nav metismenu manage-menu" id="side-menu">
            
            <!-- home -->
            <li>
              <a href="{{ route('manage.index') }}" class="{{ Nav::isRoute('manage.index') }}">
                <img src="{{ asset('images/img-error.png') }}" alt="" style="height: 250px;" class="img-responsive">
              </a>
            </li>
            <!-- /. home -->

            <!-- product manager -->
            <li>
              <a href="{{ route('manage.product.index') }}" class="{{ Nav::isRoute('manage.product.index') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.product-manager')
                </span>
              </a>
            </li>
            <!-- /. product manager -->

            <!-- quantity manager -->
            <li>
              <a href="{{ route('manage.product.quantity') }}" class="{{ Nav::isRoute('manage.product.quantity') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.quantity-manager')
                </span>
              </a>
            </li>
            <!-- /. quantity manager -->

            <!-- search -->
            <li>
              <a href="{{ route('manage.product.search') }}" class="{{ Nav::isRoute('manage.product.search') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.search')
                </span>
              </a>
            </li>
            <!-- /. search -->

            <!-- Sold out poducts -->
            <li>
              <a href="{{ route('manage.product.sold') }}" class="{{ Nav::isRoute('manage.product.sold') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.sold-out-products')
                </span>
              </a>
            </li>
            <!-- /. Sold out poducts -->

            <!-- Top 10 sales -->
            <li>
              <a href="{{ route('manage.sales.top') }}" class="{{ Nav::isRoute('manage.sales.top') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.top-10-sales')
                </span>
              </a>
            </li>
            <!-- /. Top 10 sales -->

            <!-- Sales report -->
            <li>
              <a href="{{ route('manage.sales.report') }}" class="{{ Nav::isRoute('manage.sales.report') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.sales-report')
                </span>
              </a>
            </li>
            <!-- /. Sales report -->

            <!-- Settings -->
            <li>
              <a href="{{ route('manage.settings') }}" class="{{ Nav::isRoute('manage.settings') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span> 
                <span class="menu-text">
                  @lang('manage.settings')
                </span>
              </a>
            </li>
            <!-- /. Settings -->

            <!-- History -->
            <li>
              <a href="{{ route('manage.history.index') }}" class="{{ Nav::isRoute('manage.history.index') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.history')  
                </span>
              </a>
            </li>
            <!-- /. History -->

            <!-- User management -->
            <li>
              <a href="{{ route('manage.users.index') }}" class="{{ Nav::isRoute('manage.users.index') }}">
                <span class="menu-icon">
                  <img src="{{ asset('images/img-error.png') }}" alt="">
                </span>
                <span class="menu-text">
                  @lang('manage.user-management')  
                </span>
              </a>
            </li>
            <!-- /. User management -->

          </ul>

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

    <!-- Page Content -->
    <main id="page-wrapper">

      <div class="container-fluid">

        <header class="row header-menu">
          <div class="col-lg-12 text-center m-b-30 m-t-30">
            @yield('header')
          </div>
        </header>

        @yield('content')

      </div>
    </main>
    <!-- /. Page Content -->

  </div>
  <!-- /. Wrapper -->
  {!! Charts::scripts() !!}
  <script type="text/javascript" src="{{ asset($asset_url.'messages.js') }}"></script>
  <!-- jQuery -->
  <script src="{{asset($asset_url.'js/backend/jquery.min.js')}}"></script>

  <!-- Bootstrap Core JavaScript -->
  <script src="{{asset($asset_url.'js/backend/bootstrap.min.js')}}"></script>

  <script src="{{asset($asset_url.'js/backend/jquery-ui.min.js')}}"></script>
  <script src="{{asset($asset_url.'js/backend/jquery.fileupload.js')}}"></script>
  
  <!-- Bootstrap Date Picker -->
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/js/bootstrap-datepicker.min.js"></script>
  
  <!-- Selectpicker -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js"></script>
  
  <!-- Metis Menu Plugin JavaScript -->
  <script src="{{asset($asset_url.'js/backend/metisMenu.min.js')}}"></script>

  <!-- Custom Theme JavaScript -->
  {{-- <script src="{{asset($asset_url.'js/backend/startmin.js')}}"></script> --}}

  <script type="text/javascript" src="//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
  <script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap.min.js"></script>
  <script src="//cloud.tinymce.com/stable/tinymce.min.js?apiKey=db4v2bd2xf5bvaqx5vav7jzsv0hb3h0nmbiytqdmlinnt28b"></script>

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js"></script>

  <script src="{{ asset($asset_url.'js/backend/waitMe.js') }}"></script>
  
  <script src="{{ asset($asset_url.'js/backend/axios.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/dataTables-Initiator.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/jquery-sortable.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/toastr.min.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/ajax-loading.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/jquery.cropit.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/custom-cropper.js') }}"></script>

  <script src="{{ asset($asset_url.'js/app_manage.js') }}"></script>

  <script>
    //Ajax loading spinner initiate
    var loading = $.loading({
      //set the loading html wrap tag id
      id         : 'ajaxLoading',
      //wrap tag z-index
      zIndex     : '2000',
      //wrap tag background
      background : 'rgba(0, 0, 0, 0.7)',
      //min show time
      minTime    : 200,
      //wrap tag border-radius
      radius     : '4px',
      //wrap width
      width      : '85px',
      height     : '85px',

      //loading img/gif
      imgPath    : '/images/Spinner.gif',
      imgWidth   : '70px',
      imgHeight  : '70px',

      //loading text
      tip        : '',
      //text font size
      fontSize   : '14px',
      //text font color
      fontColor  : '#fff'
    });
    loading.ajax(false);//disable 

  </script>

  @yield('script')

</body>
</html>
