<!DOCTYPE html>
<html lang="<?php echo e(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="<?php echo e(csrf_token()); ?>">
  <meta name="storage_url" content="<?php echo e($storage_url); ?>">
  <meta name="compression-level" content="<?php echo e($compressionLevel); ?>">

  <title><?php echo e($masterName); ?> | <?php echo $__env->yieldContent('title'); ?></title>

  <link rel="shortcut icon" href="<?php echo e(asset($storage_url.'img/'.$masterFavicon)); ?>?<?php echo e($masterFavicon); ?>" type="image/x-icon" />
  <!-- Bootstrap Core CSS -->
  <link href="<?php echo e(asset($asset_url.'css/backend/bootstrap.min.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/jquery-ui.min.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/jquery.fileupload.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/toastr.min.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/jquery.tagit.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/pixabay.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">

  <!-- MetisMenu CSS -->
  <link href="<?php echo e(asset($asset_url.'css/backend/metisMenu.min.css')); ?>" rel="stylesheet">

  <!-- Timeline CSS -->
  <link href="<?php echo e(asset($asset_url.'css/backend/timeline.css')); ?>" rel="stylesheet">

  <!-- Custom CSS -->
  <link href="<?php echo e(asset($asset_url.'css/backend/startmin.css')); ?>" rel="stylesheet">

  <!-- Morris Charts CSS -->
  <link href="<?php echo e(asset($asset_url.'css/backend/morris.css')); ?>" rel="stylesheet">

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

  <link href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css">

  <link href="<?php echo e(asset($asset_url.'css/backend/chosen.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/Flat.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/ImageSelect.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/fontselect.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/backend/waitMe.css')); ?>" rel="stylesheet">
  <link href="<?php echo e(asset($asset_url.'css/app_backend.css')); ?>" rel="stylesheet">
  <script>
      window.Laravel = <?php echo json_encode([
          'csrfToken' => csrf_token(),
      ]); ?>;
  </script>
  <?php echo app('Tightenco\Ziggy\BladeRouteGenerator')->generate(); ?>
</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="#"><?php echo e($masterName); ?></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: Left Menu -->
      <ul class="nav navbar-nav navbar-left navbar-top-links">
        <li><a href="<?php echo e(route('home')); ?>" target="_blank"><i class="fa fa-home fa-fw"></i> Website</a></li>
      </ul>

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

        <li class="dropdown navbar-inverse">
          <a href="<?php echo e(route('backendContact')); ?>#messages">
            <?php 
              $msg = App\Message::where(['message_status'=>'1'])->get();
             ?>
            <i class="fa fa-envelope fa-fw"></i> <b><?php echo e(count($msg)); ?></b>
          </a>
        </li>

        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">
            <i class="fa fa-user fa-fw"></i> <?php echo e(Auth::user()->name); ?> <b class="caret"></b>
          </a>

          <ul class="dropdown-menu dropdown-user">
            <?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <?php if($lang != app()->getLocale()): ?>
                <li>
                  <a href="<?php echo e(route('lang.switch', ['language'=>$lang])); ?>">
                    <?php echo e($language); ?> ( <?php echo e($lang); ?> )
                  </a>
                </li>
              <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <li>
              <a
                href="<?php echo e(route('logout')); ?>"
                onclick="event.preventDefault();
                document.getElementById('logout-form').submit();"
              >
                <i class="fa fa-sign-out fa-fw"></i> Logout
              </a>

              <form id="logout-form" action="<?php echo e(route('logout')); ?>" method="POST">
                <?php echo e(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" id="side-menu">

            <!-- Home -->
            <li>
              <a href="<?php echo e(route('backendHome')); ?>" class="<?php echo e(($page == 'home')?'active':''); ?>"><i class="fa fa-home fa-fw"></i> Home</a>
            </li>
            <!-- /. Home -->

            <!-- Catalog package -->
            <?php if( config('corepackage.catalog.activate') == 'yes' ): ?>
              <li>
                <a href="#" class="has-arrow">
                  <i class="fa fa-shopping-bag fa-fw"></i> <?php echo e(ucwords($page_product)); ?>

                </a>

                <ul class="nav nav-second-level">

                  <?php if( config('corepackage.catalog.online_payment') == 'yes' || config('corepackage.catalog.manual_payment') == 'yes' ): ?>
                    <li>
                      <a href="<?php echo e(route('backendOrder')); ?>" class="<?php echo e(($page == 'order')?'active':''); ?>">
                        <i class="fa fa-shopping-cart fa-fw"></i> Order
                      </a>
                    </li>
                  <?php endif; ?>

                  <li>
                    <a href="<?php echo e(route('backendProduct')); ?>" class="<?php echo e(($page == 'category-manager')?'active':''); ?>">
                      <i class="fa fa-th-large fa-fw"></i> Product & Category
                    </a>
                  </li>

                  <?php if(config('corepackage.catalog.shipment')): ?>
                    
                    <li>
                      <a href="<?php echo e(route('backend.shipment')); ?>" class="<?php echo e(($page == 'shipment')?'active':''); ?>">
                        <i class="fa fa-truck fa-fw"></i> <?php echo app('translator')->getFromJson('backend.shipment'); ?>
                      </a>
                    </li>
                    
                  <?php endif; ?>

                  <?php if(config('corepackage.catalog.stock_management')): ?>
                    
                    <li>
                      <a href="<?php echo e(route('manage.product.index')); ?>" class="">
                        <i class="fa fa-cube fa-fw"></i> <?php echo app('translator')->getFromJson('backend.stock-management'); ?>
                      </a>
                    </li>
                    
                  <?php endif; ?>

                </ul>
              </li>

              <?php if( config('corepackage.catalog.manual_payment') == 'yes' || config('corepackage.catalog.online_payment') == 'yes' ): ?>
                <li>
                  <a href="<?php echo e(route('backendBankAccount')); ?>" class="<?php echo e(($page == 'bank-account')?'active':''); ?>"><i class="fa fa-credit-card-alt fa-fw"></i> Bank Account</a>
                </li>
              <?php endif; ?>

            <?php endif; ?>
            <!-- /. Catalog package -->

            <!-- Sections -->
            <li>
              <a href="#" class="has-arrow">
                <i class="fa fa-newspaper-o fa-fw"></i> Sections
              </a>

              <ul class="nav nav-second-level">

                <li>
                  <a class="<?php echo e(($page == 'section1')?'active':''); ?>" href="<?php echo e(route('backendSections',['section'=>'section1'])); ?>">
                    <i class="fa fa-file-text-o fa-fw"></i> <?php echo e(ucwords($page_section1)); ?>

                  </a>
                </li>

                <li>
                  <a class="<?php echo e(($page == 'section2')?'active':''); ?>" href="<?php echo e(route('backendSections',['section'=>'section2'])); ?>">
                    <i class="fa fa-file-text-o fa-fw"></i> <?php echo e(ucwords($page_section2)); ?>

                  </a>
                </li>

              </ul>
            </li>
            <!-- /. Sections -->

            <!-- About -->
            <li>
              <a href="<?php echo e(route('backendAbout')); ?>" class="<?php echo e(($page == 'about')?'active':''); ?>">
                <i class="fa fa-question-circle fa-fw"></i> <?php echo e(ucwords($page_about)); ?>

              </a>
            </li>
            <!-- /. About -->

            <!-- Albums -->
            <?php if( config('corepackage.lowcost.gallery')): ?>
              <li>
                <a href="#" class="<?php echo e(($page == 'gallery')?'active':''); ?>">
                  <i class="fa fa-picture-o fa-fw"></i> <?php echo app('translator')->getFromJson('backend.album'); ?>
                  <i class="fa fa-plus album-add"></i>
                </a>

                  <ul class="nav nav-second-level">
                    <?php $__currentLoopData = $albums; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $album): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <li>
                        <a class="album-list">
                          <i class="fa fa-file-text-o fa-fw"></i><span class="album-show" data-url="<?php echo e(route('albums.show', $album->id)); ?>"><?php echo e($album->name); ?></span>
                          <span class="action">
                            <i class="fa fa-pencil album-edit" data-id="<?php echo e($album->id); ?>" data-name="<?php echo e($album->name); ?>"></i>
                            <i class="fa fa-trash album-delete">
                                <form action="<?php echo e(route('albums.destroy', $album->id)); ?>" method="POST">
                                  <?php echo e(csrf_field()); ?>

                                  <?php echo e(method_field('DELETE')); ?>

                                </form>
                            </i>
                          </span>
                        </a>
                      </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </ul>
              </li>
            <?php endif; ?>
            <!-- /. Albums -->

            <!-- Article -->
            <?php if(config('corepackage.lowcost.article')): ?>
              <li>
                <a href="<?php echo e(route('articles.index')); ?>" class="<?php echo e(($page == 'article')?'active':''); ?>">
                  <i class="fa fa-book fa-fw"></i> <?php echo e(isset($page_article) ? ucwords($page_article) : ''); ?>

                  <i class="fa fa-plus btn-float" data-url="<?php echo e(route('articles.create')); ?>"></i>
                </a>
              </li>
            <?php endif; ?>
            <!-- /. Article -->

            <!-- Contact -->
            <li>
                <a href="<?php echo e(route('backendContact')); ?>" class="">
                  <i class="fa fa-phone fa-fw"></i> <?php echo e(ucwords($page_contact)); ?>

                </a>
            </li>
            <!-- /. Contact -->

            <!-- Mentions legales -->
            <?php if(config('corepackage.lowcost.mentionsLegales')): ?>
            <li>
                <a href="<?php echo e(route('backendMentionLegales')); ?>" class="">
                  <i class="fa fa-balance-scale fa-fw"></i> <?php echo e(ucwords($page_mentionLegales)); ?>

                </a>
            </li>
            <?php endif; ?>
            <!-- /. Mentions legales -->

            <!-- Settings -->
            <li>
              <a href="<?php echo e(route('backendSettings')); ?>" class="<?php echo e(($page == 'settings')?'active':''); ?>">
                <i class="fa fa-gear fa-fw"></i> <?php echo app('translator')->getFromJson('backend.settings'); ?>
              </a>
            </li>
            <!-- /. Settings -->

            <!-- SEO -->
            <?php if(config('corepackage.lowcost.seo')): ?>
              <li>
                <a href="<?php echo e(route('backendMeta')); ?>" class="<?php echo e(($page == 'seo')?'active':''); ?>">
                  <i class="fa fa-tags fa-fw"></i> <?php echo app('translator')->getFromJson('backend.meta-tags-seo'); ?>
                </a>
              </li>
            <?php endif; ?>
            <!-- /. SEO -->

            <!-- User management -->
            <?php if(Auth::user()->level == '1'): ?>
              <li>
                  <a href="<?php echo e(route('backendUser')); ?>" class="<?php echo e(($page == 'users') ? 'active' : ''); ?>">
                    <i class="fa fa-users fa-fw"></i> <?php echo app('translator')->getFromJson('backend.user-management'); ?>
                  </a>
              </li>
            <?php endif; ?>
            <!-- /. User management -->
          </ul>

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

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

      <div class="container-fluid">

        <header>
          <div class="col-lg-12">
            <h1 class="page-header">
              <?php echo $__env->yieldContent('title'); ?>
            </h1>
            <?php echo $__env->yieldContent('additionalButton'); ?>
          </div>
        </header>
        <!-- Album modal -->
        <?php echo $__env->make('backend.modals.album', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <!-- ... Your content goes here ... -->
        <?php echo $__env->yieldContent('content'); ?>

        <?php echo $__env->make('backend.modals.pixabay', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
      </div>
    </main>
    <!-- /. Page Content -->

  </div>
  <!-- /. Wrapper -->

  <!-- jQuery -->
  <script src="<?php echo e(asset($asset_url.'js/backend/jquery.min.js')); ?>"></script>

  <!-- Bootstrap Core JavaScript -->
  <script src="<?php echo e(asset($asset_url.'js/backend/bootstrap.min.js')); ?>"></script>

  <script src="<?php echo e(asset($asset_url.'js/backend/jquery-ui.min.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/jquery.fileupload.js')); ?>"></script>

  <!-- masonry -->
  <script src="https://unpkg.com/masonry-layout@4.1.1/dist/masonry.pkgd.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="<?php echo e(asset($asset_url.'js/backend/metisMenu.min.js')); ?>"></script>

  <!-- Custom Theme JavaScript -->
  <script src="<?php echo e(asset($asset_url.'js/backend/startmin.js')); ?>"></script>

  <script src="<?php echo e(asset($asset_url.'js/backend/jquery.fontselect.js')); ?>"></script>

  <script type="text/javascript" src="//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>

  <script src="//cloud.tinymce.com/stable/tinymce.min.js?apiKey=db4v2bd2xf5bvaqx5vav7jzsv0hb3h0nmbiytqdmlinnt28b"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

  <script src="<?php echo e(asset($asset_url.'js/backend/waitMe.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/dataTables-initiator.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/chosen.jquery.min.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/ImageSelect.jquery.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/jquery-sortable.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/jquery.cropit.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/caman.full.min.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/custom-cropper.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/toastr.min.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/ajax-loading.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/tag-it.js')); ?>"></script>
  <script src="<?php echo e(asset($asset_url.'js/backend/pixabay.js')); ?>"></script>

  <script src="<?php echo e(asset($asset_url.'js/app_backend.js')); ?>"></script>
  

  <?php if(Session::has('anchor')): ?>
    <script type="text/javascript">
      window.location.href="<?php echo e(Session::get('anchor')); ?>";
    </script>
  <?php endif; ?>
  <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

    // Album edit
    var mAlbum = $("#mAlbum");
    $(".album-edit").on("click", function(e) {
      e.preventDefault();
      var id = $(this).attr("data-id"),
          name = $(this).attr("data-name");
      mAlbum.find("form").attr("action", route('albums.update', id))
      mAlbum.find("input[name='_method']").val("PUT")
      mAlbum.find("input[name='name']").val(name)
      mAlbum.modal("show")
    })
    $(".album-add").on("click", function(e) {
      e.preventDefault();
      mAlbum.find("form").attr("action", route('albums.store'))
      mAlbum.find("input[name='_method']").val("POST")
      mAlbum.find("input[name='name']").val('')
      mAlbum.modal("show")
    })
    $(".album-delete").on("click", function(e) {
      if( !confirm('Are you sure want to delete this data?')) {
        e.preventDefault();
      } else {
        $(this).find("form").submit()
      }
    })
    $(".album-show").on("click", function(){
      var url = $(this).attr("data-url")
      window.location.href = url
    })
    $(".btn-float").on("click", function(e) {
      e.preventDefault()
      var url = $(this).attr("data-url")
      window.location.href = url
    })

  </script>

  <?php echo $__env->yieldContent('script'); ?>

</body>
</html>
