<?php
/**
 * @package     SP Soccer
 * @author      JoomShaper http://www.joomshaper.com
 * @copyright   Copyright (C) 2010 - 2016 JoomShaper. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die('Restricted access');

// Get Columns
$columns = $this->params->get('columns', 3);

?>

<div id="spsoccer" class="spsoccer view-spsoccer-teams">
	<!-- Column -->
	<?php foreach(array_chunk($this->items, $columns) as $this->items) { ?>
		<div class="spsoccer-row">
			<?php foreach ($this->items as $this->item) { ?>
				<!-- START:: SP Soccer Tournaments -->
				<div class="spsoccer-col-sm-<?php echo round(12/$columns); ?>">
					<div class="soccer-team">
						<div class="soccer-team-logo">
							<a href="<?php echo $this->item->url; ?>">
								<img class="spsoccer-img spsoccer-img-responsive soccer-list-thumb" src="<?php echo $this->item->logo; ?>" alt="<?php echo $this->item->title; ?>">
							</a>
						</div>
						<div class="team-description">
							<a href="<?php echo $this->item->url; ?>">
								<h3><?php echo $this->item->title; ?></h3>
							</a>
							<p class="details"><?php echo JHtml::_('string.truncate', strip_tags($this->item->description), 50); ?></p>
							<div class="spsoccer-socials-wrap">
								<ul class="team-social">
									<?php if (!empty($this->item->facebook)) { ?>
										<li><a href="<?php echo $this->item->facebook ?>" target="_blank">
											<i class="sp-soccer-facebook"></i>
										</a></li>
									<?php } if (!empty($this->item->twitter)) { ?>
										<li><a href="<?php echo $this->item->twitter ?>" target="_blank">
											<i class="sp-soccer-twitter"></i>
										</a></li>
									<?php } if (!empty($this->item->linkedin)) { ?>
										<li><a href="<?php echo $this->item->linkedin ?>" target="_blank">
											<i class="sp-soccer-linkedin"></i>
									</a></li>
									<?php } if (!empty($this->item->g_plus)) { ?>
										<li><a href="<?php echo $this->item->g_plus ?>" target="_blank">
											<i class="sp-soccer-google-plus"></i>
									</a></li>
									<?php } if (!empty($this->item->youtube)) { ?>
										<li><a href="<?php echo $this->item->youtube ?>" target="_blank">
											<i class="sp-soccer-youtube"></i>
									</a></li>
									<?php } ?>
								</ul>
							</div> <!-- /.spsoccer-socials-wrap  -->
						</div>
						<?php //print_r($this->item); ?>
					</div>
				</div>
				<!-- END:: SP Soccer Tournaments -->
			<?php };?>
		</div>
	<?php } ?>
	<!-- /Column -->

	<!-- START:: Pagination -->
	<?php if ($this->params->get('show_pagination', 1)) { ?>
		<?php if ($this->pagination->get('pages.total') >1) { ?>
			<div class="soccer-pagination">
				<?php echo $this->pagination->getPagesLinks(); ?>
			</div>
		<?php } ?>
	<?php } ?>
	<!-- END:: Pagination -->

</div>
