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

<div id="spsoccer" class="spsoccer view-spsoccer-tournament spsoccer-result-landing">
	<div class="spsoccer-container">

		<div class="torunament-info">
			<div class="tournament-header">
				<h2 class="soccer-title"><?php echo $this->item->title?></h2>
			</div>
		</div>

		<?php if(!empty($this->sessions)) {
			foreach ($this->sessions as $session) {
			// Has match session
			if (!empty($session->played_matches)) {
		?>
		<h3 class="spsoccer-row text-center title"><span><?php echo $session->title; ?></span></h3>

		<?php foreach ($session->played_matches as $session_played_match) { ?>
		<!-- START:: fixture -->
		<div class="spsoccer-row item-list-wrap">

			<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-left">
				<a href="<?php echo $session_played_match->url; ?>">
					<img class="spsoccer-img-thumbnail spsoccer-img-responsive soccer-team-thumb" src="<?php echo $session_played_match->team_one_info->logo; ?>" alt="<?php echo $session_played_match->team_one_info->title; ?>">
					<span class="spsoccer-team-name"><?php echo $session_played_match->team_one_info->title; ?></span>
				</a>
			</div> <!-- /.spsoccer-col-lg -->

			<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-center">
				<h2><?php echo $session_played_match->teamone_score . ' : ' . $session_played_match->teamtwo_score; ?></h2>

				<div class="spsoccer-match-date-time">
					<span><?php echo $session_played_match->match_date; ?></span>,
					<span><?php echo $session_played_match->match_time; ?></span>
				</div>
				<p class="spsoccer-match-location">
					<?php echo $session_played_match->match_location->title; ?>
				</p>
			</div><!-- /.spsoccer-col-lg -->

			<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-right text-right">
				<a href="<?php echo $session_played_match->url; ?>">
					<span class="spsoccer-team-name"><?php echo $session_played_match->team_two_info->title; ?></span>
					<img class="spsoccer-img-thumbnail spsoccer-img-responsive soccer-team-thumb" src="<?php echo $session_played_match->team_two_info->logo; ?>" alt="<?php echo $session_played_match->team_two_info->title; ?>">
				</a>
			</div><!-- /.spsoccer-col-lg -->

		</div>
		<!-- END:: fixture -->
		<!-- /.spsoccer-row -->
		<?php } // END:: $session->played_matches  ?>
		<?php } // END:: has session match  ?>
		<?php } // END:: forech $this->sessions  ?>
		<?php } // END:: !empty sessions ?>

	</div> <!-- /. spsoocer-container -->
</div> <!-- /.spsoccer -->
