<?php
  /**
   * Category
   *
   * @package Wojo Framework
   * @author wojoscripts.com
   * @copyright 2017
   * @version $Id: category.tpl.php, v1.00 2017-05-05 10:12:05 gewa Exp $
   */
  if (!defined("_WOJO"))
      die('Direct access to this location is not allowed.');
?>
<?php if($this->special):?>
<div class="row">
  <div class="columns screen-50 tablet-50 mobile-100 phone-100" id="special3">
    <?php if(isset($this->special[0])):?>
    <div class="row">
      <div class="columns mobile-100 phone-100">
        <div class="padding">
          <p class="margin-bottom">
            <span class="wojo black label"><?php echo Utility::renderPrice($this->special[0]->is_sale, $this->special[0]->price, $this->special[0]->sprice, "negative");?></span></p>
          <h3 class="wojo white text"><?php echo $this->special[0]->title?></h3>
          <p class="wojo small white soft dimmed text"><?php echo Validator::sanitize($this->special[0]->body, "string", 80)?></p>
          <p class="margin-top">
            <a href="<?php echo Url::url('/product', $this->special[0]->slug);?>" class="wojo small transparent button">More Info</a>
          </p>
        </div>
      </div>
      <div class="columns shrink mobile-100 phone-100 content-right mobile-content-center">
        <img src="<?php echo Product::hasThumb($this->special[0]->thumb, $this->special[0]->id);?>" alt="<?php echo $this->special[0]->title?>" class="wojo basic medium image"></div>
    </div>
    <?php endif;?>
  </div>
  <div class="columns screen-50 tablet-50 mobile-100 phone-100" id="special2">
    <?php if(isset($this->special[1])):?>
    <div class="row">
      <div class="columns mobile-100 phone-100">
        <div class="padding">
          <p class="margin-bottom"><span class="wojo black label"><?php echo Utility::renderPrice($this->special[1]->is_sale, $this->special[1]->price, $this->special[1]->sprice, "negative");?></span></p>
          <h3 class="wojo white text"><?php echo $this->special[1]->title;?></h3>
          <p class="wojo small white soft dimmed text"><?php echo Validator::sanitize($this->special[1]->body, "string", 80)?></p>
          <p class="margin-top">
            <a href="<?php echo Url::url('/product', $this->special[1]->slug);?>" class="wojo small transparent button"><?php echo Lang::$word->MOREINFO;?></a>
          </p>
        </div>
      </div>
      <div class="columns shrink mobile-100 phone-100 content-right mobile-content-center">
        <img src="<?php echo Product::hasThumb($this->special[1]->thumb, $this->special[1]->id);?>" alt="<?php echo $this->special[1]->title?>" class="wojo basic medium image">
      </div>
    </div>
    <?php endif;?>
  </div>
</div>
<?php endif;?>
<div class="row align-middle" id="filter">
  <div class="columns shrink">
    <div class="items"><?php echo Lang::$word->TOTAL . ': ' . $this->pager->items_total;?></div>
  </div>
  <div class="columns">
    <div class="items content-center">
      <div class="wojo divided fixed horizontal link list">
        <div class="disabled item wojo bold text">
          <?php echo Lang::$word->SORTING_O;?>
        </div>
        <a href="<?php echo Url::url(Router::$path);?>" class="item<?php echo Url::setActive("order", false);?>">
          <?php echo Lang::$word->RESET;?>
        </a>
        <a href="<?php echo Url::url(Router::$path, Url::buildUrl("order","title|DESC"));?>" class="item<?php echo Url::setActive("order", "title");?>">
          <?php echo Lang::$word->NAME;?>
        </a>
        <a href="<?php echo Url::url(Router::$path, Url::buildUrl("order","price|DESC"));?>" class="item<?php echo Url::setActive("order", "price");?>">
          <?php echo Lang::$word->PRD_PRICE;?>
        </a>
        <a href="<?php echo Url::url(Router::$path, Url::buildUrl("order","likes|DESC"));?>" class="item<?php echo Url::setActive("order", "likes");?>">
          <?php echo Lang::$word->LIKES;?>
        </a>
        <div class="item">
          <a href="<?php echo Url::sortItems(Url::url(Router::$path), "order");?>" data-tooltip="ASC/DESC"><i class="icon triangle unfold more link"></i></a>
        </div>
      </div>
    </div>
  </div>
  <div class="columns shrink">
    <a <?php if(Validator::isGetSet("mode", "list")) echo 'href="' . Url::url(Router::$path, Url::buildUrl("mode","grid")) . '"';?> class="items inverted<?php if(!Validator::isGetSet("mode", "list")) echo ' active';?>"><i class="icon apps"></i></a>
  </div>
  <div class="columns shrink">
    <a <?php if(!Validator::isGetSet("mode", "list")) echo 'href="' . Url::url(Router::$path, Url::buildUrl("mode","list")) . '"';?> class="items inverted last<?php if(Validator::isGetSet("mode", "list")) echo ' active';?>"><i class="icon unordered list"></i></a>
  </div>
</div>
<div class="wojo basic divider"></div>
<?php if($this->featured):?>
<?php if(Validator::isGetSet("mode", "list")):?>
<?php include(THEMEBASE . '/_category_list.tpl.php');?>
<?php else:?>
<?php include(THEMEBASE . '/_category_grid.tpl.php');?>
<?php endif;?>
<?php if ($this->pager->items_total > $this->pager->items_per_page):?>
<div class="wojo basic divider"></div>
<div class="half-padding content-center"><?php echo $this->pager->display_pages();?></div>
<?php endif;?>
<?php endif;?>