<?php
/**
 * @version		2.6.x
 * @package		K2
 * @author		JoomlaWorks http://www.joomlaworks.net
 * @copyright	Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;
$doc = JFactory::getDocument();
?>
<?php if(count($items)): ?>   
    <div class="t-our_price_listing">
        <div class="t-our_price_types">
            <?php foreach ($items as $key => $item) : ?>
                <?php $doc->addStyleDeclaration( ".t-our_price_block_amount span#unit-{$item->id}:after{ content: '{$item->title}'; }" ); ?>
                <div class="t-our_price_block<?php if( $item->featured == '0' ) : ?> t-our_price_white<?php else : ?> t-our_price_color<?php endif; ?><?php if( !$key ) : ?> wow fadeInLeft<?php elseif( $key && !( $key %  2 ) ) : ?> wow fadeInRight<?php endif; ?>" data-wow-duration="2s">
                    <div class="t-our_price_icon">
                        <?php if( is_array( $item->extra_fields ) ) : ?>
                            <?php foreach ($item->extra_fields as $extraField): ?>
                                <?php if($extraField->value != '' and $extraField->type = 'link' ): ?>
                                <div class="t-glyp_icon t-glyp_distance">
                                    <i class="glyph-item mega" aria-hidden="true" data-icon="<?php echo $extraField->text; ?>" data-js-prompt="&amp;<?php echo $extraField->text; ?>"></i>
                                </div>
                                <?php endif; ?>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </div>
                    <div class="t-our_price_block_amount">
                        <span id="unit-<?php echo $item->id; ?>"><?php echo $item->introtext; ?></span>
                    </div>
                    <div class="t-our_price_block_title">
                        <span><?php echo $item->created_by_alias; ?></span>
                    </div>
                    <?php $tags = array(); ?>
                    <?php foreach ($item->tags as $tag): ?>
                        <?php array_push( $tags, "<li><span>{$tag->name}</span></li>" ); ?>
                    <?php endforeach; ?>
                    <ul class="t-our_price_block_details">
                        <?php echo implode( ' ', $tags ); ?>
                    </ul>      
                    <a href="<?php echo $item->link; ?>" class="t-btn">sign up</a>
                </div>
            <?php endforeach; ?>
        </div>
    </div> 
  <?php endif; ?>
