<?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-tournaments spsoccer-match-landing">
	<div class="spsoccer-match-top-content">
		<?php 
			$loaded_item = array();
			foreach ($this->items as $key => $this->item) { 
				$loaded_item [] = $this->item->spsoccer_match_id;
			?>	
				<div class="spsoccer-col-sm-6">
					<div class="spsoccer-featured-match-wrap<?php if($key==1) {echo " right";}?>">
						<div class="spsoccer-row">
							<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-center">
								<a href="<?php echo $this->item->url; ?>" class="spsoccer-club-logo">
									<img class="spsoccer-img-thumbnail spsoccer-img-responsive soccer-team-thumb" src="<?php echo $this->item->team1_info->logo; ?>" alt="<?php echo $this->item->team1_info->title; ?>">
									<span class="spsoccer-team-name"><?php echo $this->item->team1_info->title; ?></span>
								</a>
							</div> <!-- /.spsoccer-col-lg -->

							<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-center">
								<div class="spsoccer-match-time-location">
									<div class="spsoccer-match-date-time">
										<span><?php echo $this->item->match_date; ?>,</span>
										<span><?php echo $this->item->match_time; ?></span>
									</div>
									<p class="spsoccer-match-location">
										<a href="<?php echo $this->item->location_url ?>">
											<?php echo $this->item->match_location->title; ?>
										</a>
									</p>
								</div>
							</div><!-- /.spsoccer-col-lg -->

							<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-center">
								<a href="<?php echo $this->item->url; ?>" class="spsoccer-club-logo">
									<img class="spsoccer-img-thumbnail spsoccer-img-responsive soccer-team-thumb" src="<?php echo $this->item->team2_info->logo; ?>" alt="<?php echo $this->item->team2_info->title; ?>">
									<span class="spsoccer-team-name"><?php echo $this->item->team2_info->title; ?></span>
								</a>
							</div><!-- /.spsoccer-col-lg -->
						</div>
					</div>
				</div>
				
				<?php if($key==1) {
					break;
				}?>
		<?php } ?>
	</div> <!-- spsoccer-match-top-content -->
	<div class="spsoccer-fixture-content-wrap">
		<?php foreach ($this->items as $this->item) { ?>
			<?php if(!in_array($this->item->spsoccer_match_id, $loaded_item)) { ?>
			<!-- START:: fixture -->
			<div class="item-list-wrap">
				<div class="spsoccer-col-md-4 spsoccer-col-sm-4 text-left">
					<a href="<?php echo $this->item->url; ?>">
						<img class="spsoccer-img-thumbnail spsoccer-img-responsive soccer-team-thumb" src="<?php echo $this->item->team1_info->logo; ?>" alt="<?php echo $this->item->team1_info->title; ?>">
						<span class="spsoccer-team-name"><?php echo $this->item->team1_info->title; ?></span>
					</a>
				</div> <!-- /.spsoccer-col-lg -->

				<div class="spsoccer-col-md-4 spsoccer-col-sm-4">
					<div class="spsoccer-match-date-time">
						<span><?php echo $this->item->match_date; ?></span>,
						<span><?php echo $this->item->match_time; ?></span>
					</div>

					<p class="spsoccer-match-location">
						<a href="<?php echo $this->item->location_url ?>">
							<?php echo $this->item->match_location->title; ?>
						</a>
					</p>

				</div><!-- /.spsoccer-col-lg -->

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

			</div>
			<!-- END:: fixture -->
			<!-- /.spsoccer-row -->
			<?php } ?>
		<?php } ?>
	</div> <!-- spsoccer-fixture-content-wrap -->
	<!-- 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> <!-- /.spsoccer-match-landing -->
