<?php
  /**
   * Header
   *
   * @package Wojo Framework
   * @author wojoscripts.com
   * @copyright 2017
   * @version $Id: header.tpl.php, v1.00 2017-10-05 10:12:05 gewa Exp $
   */
  if (!defined("_WOJO"))
      die('Direct access to this location is not allowed.');
 ?>
<!doctype html>
<html lang="<?php echo Core::$language;?>">
<head>
<meta charset="utf-8">
<title><?php echo $this->title;?></title>
<meta name="keywords" content="<?php echo $this->keywords;?>">
<meta name="description" content="<?php echo $this->description;?>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="dcterms.rights" content="<?php echo $this->core->company;?> &copy; All Rights Reserved">
<meta name="robots" content="index">
<meta name="robots" content="follow">
<meta name="revisit-after" content="1 day">
<meta name="generator" content="Powered by DDP v<?php echo $this->core->wojov;?>">
<link rel="shortcut icon" href="<?php echo SITEURL;?>/assets/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/jquery.js"></script>
<script type="text/javascript" src="<?php echo SITEURL;?>/assets/global.js"></script>
<link href="<?php echo THEMEURL . '/cache/' . Cache::cssCache(array('base.css','transition.css','dropdown.css','menu.css','image.css','label.css','message.css','list.css','table.css','datepicker.css','divider.css','comments.css','form.css','input.css','icon.css','button.css','segment.css','editor.css','popup.css','dimmer.css','modal.css','progress.css','utility.css','style.css'), THEMEBASE);?>" rel="stylesheet" type="text/css">
<?php echo Core::Colors();?>
</head>
<body>
<?php if($this->core->ploader):?>
<!-- Page Loader -->
<div id="preloader">
  <div class="sk-cube-grid">
    <div class="sk-cube sk-cube1"></div>
    <div class="sk-cube sk-cube2"></div>
    <div class="sk-cube sk-cube3"></div>
    <div class="sk-cube sk-cube4"></div>
    <div class="sk-cube sk-cube5"></div>
    <div class="sk-cube sk-cube6"></div>
    <div class="sk-cube sk-cube7"></div>
    <div class="sk-cube sk-cube8"></div>
    <div class="sk-cube sk-cube9"></div>
  </div>
</div>
<?php endif;?>
<header>
  <div id="top-section">
    <div class="wojo-grid">
      <div class="row align-middle">
        <div class="columns shrink mobile-hide phone-hide">
          <a href="<?php echo SITEURL;?>/" class="logo">
            <?php echo ($this->core->logo) ? '<img src="' . SITEURL . '/uploads/' . $this->core->logo . '" alt="' . $this->core->company . '">' : $this->core->company;?></a>
        </div>
        <div class="columns shrink mobile-order-2">
          <a class="is_button is_search" data-transition="true" data-type="slideDown" data-trigger="#search"><i class="icon find"></i></a>
        </div>
        <div class="columns mobile-order-1">
          <a class="categories" data-transition="true" data-type="slideDown" data-trigger="#categories"><i class="icon reorder"></i>
            <span class="mobile-hide phone-hide"><?php echo Lang::$word->CATEGORIES;?></span></a>
        </div>
        <div class="columns shrink mobile-order-3">
          <?php if(App::Auth()->is_User()):?>
          <a href="<?php echo Url::url("/dashboard");?>" class="is_button first">
            <img src="<?php echo UPLOADURL;?>/avatars/<?php echo (App::Auth()->avatar) ? App::Auth()->avatar : "blank.svg";?>" alt="" class="avatar"></a>
          <?php else:?>
          <a href="<?php echo Url::url("/login");?>" class="is_button first"><i class="icon user"></i></a>
          <?php endif;?>
        </div>
        <div class="columns shrink mobile-order-4 phone-hide">
          <a href="<?php echo Url::url('/wishlist');?>" class="is_button"><i class="icon heart"></i></a>
        </div>
        <div class="columns shrink mobile-order-5 phone-hide">
          <a data-set='{"option":[{"action": "compare"}], "buttons":false, "close": true, "url":"/controller.php", "parent":"#none", "complete":"replace","modalclass":"fullscreen"}' class="is_button mAction"><i class="icon files"></i></a>
        </div>
        <div class="columns shrink relative is_language mobile-order-6">
          <a class="is_button" data-transition="true" data-type="slideDown" data-trigger="#langChange"><?php echo strtoupper(Core::$language);?></a>
          <div id="langChange" class="hide-all">
            <?php foreach(Lang::fetchLanguage() as $lang):?>
            <a data-value="<?php echo substr($lang, 0, 2);?>"><?php echo strtoupper(substr($lang, 0, 2));?></a>
            <?php endforeach;?>
          </div>
        </div>
        <div class="columns shrink relative mobile-order-7">
          <a class="is_button last" data-transition="true" data-type="slideDown" data-trigger="#cartList"><i class="icon basket"></i><span id="cTotal"><?php echo $this->counter;?></span></a>
          <div id="cartList" class="wojo basic segment shadow very relaxed attached divided flex list align-middle hide-all"></div>
        </div>
      </div>
    </div>
  </div>
  <div id="bottom-section">
    <div id="search" class="hide-all">
      <div class="wojo basic fluid icon action input">
        <input placeholder="<?php echo Lang::$word->SEARCH;?>" type="text" id="masterSearch">
        <a id="doSearch" class="wojo basic transparent inverted button icon"><i class="icon find"></i></a>
      </div>
      <div id="searchResult"></div>
    </div>
    <div id="categories" class="hide-all">
      <nav class="menu"><?php echo $this->categories;?></nav>
    </div>
    <div id="crumbs">
      <div class="wojo small breadcrumb">
        <?php echo Url::crumbs($this->crumbs ? $this->crumbs : $this->segments, "//", Lang::$word->HOME);?>
      </div>
    </div>
  </div>
</header>
<div class="wojo-grid">
<main>