<?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 view-spsoccer-vanue">
	<div class="spsoccer-tournament">
		<div class="spsoccer-container">
			<div class="spsoccer-row">
				<div class="spsoccer-col-sm-6">
					<?php if (is_array($this->item->map)) {?>
						<div class="spsocer-vanue-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>
						</div>
					<?php } ?>
				</div>
				<div class="spsoccer-col-sm-6">
					<h2 class="soccer-title"><?php echo $this->item->title; ?></h2>
					<div class="soccer-description">
							<?php echo $this->item->description; ?>
					</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>

		 <?php if(count($this->item->gallery) && $this->item->gallery){ ?>
			 <div class="spsoccer-vanue-gallery-wrpap">
				 <h2 class="soccer-title"><?php echo JText::_('COM_SOSOCCER_VANUE_GALLERY'); ?></h2>
					<div class="spsoccer-team-gallery-list spsoccer-row">
						<?php foreach ($this->item->gallery as $gallery_item) { ?>
						 <div class="spsoccer-col-sm-3 gallery-image">
							 <div class="image-box">
								<a data-lightbox="lightbox" href="<?php echo $gallery_item['image']; ?>">
									<img class="img-responsive" src="<?php echo $gallery_item['image']; ?>">
								</a>
							</div>
						 </div> <!-- /.sp-soccer-col-sm-4 -->
						 <?php } ?>
					</div> <!-- /.spsoccer-team-gallery-list -->
			 </div>
			<?php } //END:: Galleries ?>


			<?php if ($this->vanue_matches) { ?>
					<div class="spsoccer-fixture-wrapper">
						<h3 class="text-center title"><span><?php echo JText::_('COM_SPSOCCER_VANUE_MATCHES'); ?></span></h3>

						<?php foreach ($this->vanue_matches as $vanue_match) {
							$vanue_match->team_one_info->logo = SpsoccerHelper::hasImg($vanue_match->team_one_info->logo);
							$vanue_match->team_two_info->logo = SpsoccerHelper::hasImg($vanue_match->team_two_info->logo);
						?>

							<!-- START:: fixture -->
							<div class="item-list-wrap">

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

								<div class="spsoccer-col-lg-4 spsoccer-col-md-4 spsoccer-col-sm-12 text-center">
									<div class="spsoccer-match-date-time">
										<span><?php echo $vanue_match->match_date; ?></span>,
										<span><?php echo $vanue_match->match_time; ?></span>
									</div>
								</div><!-- /.spsoccer-col-lg -->

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

							</div>
							<!-- /.spsoccer-row -->

							<?php //print_r($vanue_match); ?>

						<?php } // END:: forech $session_matches ?>
					</div> <!-- ./spsoccer-group-wrapper -->
				<?php } // END:: has match  ?>

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

	</div> <!-- /.spsoccer-tournament -->
</div> <!-- /#spsoccer .spsoccer -->
