<?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;
?>
<?php if(count($items)): ?>   
    <div id="t-client_testimonial_carousel">
        <?php foreach ($items as $key => $item) : ?>
            <div class="t-client_testimonials">
                <?php if($params->get('itemIntroText')): ?>
                <p class="t-client_testimonial_text">
                    <?php echo $item->introtext; ?>
                </p>
                <?php endif; ?>
                <div class="t-client_testimonial_user">
                    <?php if($params->get('itemTitle')): ?>
                    <span><?php echo $item->title; ?></span>
                    <?php endif; ?>
                    <?php if(count($item->extra_fields)): ?>
                        <div class="t-client_testimonial_rating">
                        <?php foreach ($item->extra_fields as $extraField): ?>
                            <?php if($extraField->value != '' ): ?>
                                <?php $max = intval($extraField->value); ?>
                                <?php echo str_repeat( '<i class="fa fa-star"></i>', $max)?>
                                <?php if( $max < 5 ) : ?>
                                    <?php echo str_repeat( '<i class="fa fa-star-o"></i>', 5 - $max )?>
                                <?php endif; ?>
                            <?php endif; ?>
                        <?php endforeach; ?>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        <?php endforeach; ?>
    </div> 
  <?php endif; ?>
