<?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', 2);

?>

<div id="spsoccer" class="spsoccer view-spsoccer-teams view-spsoccer-vanues">
	<!-- 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-12">
					<div class="soccer-team">
						<div class="spsoccer-row">
							<div class="soccer-vanue-logo spsoccer-col-sm-6">
								<?php if (is_array($this->item->map)) {?>
									<div id="spsoccer-vanue-map-<?php echo $this->item->spsoccer_vanue_id; ?>" class="splms-event-map" data-lat="<?php echo $this->item->map[0]; ?>" data-lng="<?php echo $this->item->map[1]; ?>" style="height:320px"></div>
								<?php } ?>
							</div>
							<div class="team-description spsoccer-col-sm-6">
								<a href="<?php echo $this->item->url; ?>">
									<h3><?php echo $this->item->title; ?></h3>
								</a>
								<div class="details"><?php echo JHtml::_('string.truncate', strip_tags($this->item->description), 510); ?></div>
								<?php if(count($this->item->socials) && $this->item->socials){ ?>
									<div class="spsoccer-socials-wrap">
										<ul class="team-social">
											<?php foreach ($this->item->socials as $social) { ?>
												<li>
													<a target="_blank" href="<?php echo $social->url; ?>"><i class="sp-soccer-<?php echo $social->social; ?>"></i></a>
												</li>
											<?php } ?>
										</ul>
									</div> <!-- /.spsoccer-socials-wrap  -->
								<?php } ?>
							</div>
						</div> <!-- /.row -->
					</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>
