<?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-team">
	<div class="spsoccer-team">

		<div class="spsoccer-row">
			<div class="spsoccer-team-basic spsoccer-col-sm-3">
				<img class="splms-img-responsive" src="<?php echo $this->item->logo; ?>" alt="<?php echo $this->item->title; ?>">
				<div class="team-header">
					<h2 class="team-title">
						<?php echo $this->item->title; ?>
						<small><?php echo $this->item->team_type; ?></small>
					</h2>

					<div class="spsoccer-team-info-wrap">
						<div class="spsoccer-team-career">
							<ul class="spsoccer-team-info-list spsoccer-ul-list">
								<?php if($this->item->established){ ?>
									<li>
										<p class="spsoccer-item-title">
												<?php echo JText::_('COM_SOSOCCER_TEAM_STABLISHED_IN'); ?>
										</p>
										<p><?php echo $this->item->established; ?></p>
									</li>
								<?php } ?>

								<?php if($this->item->former_president){?>
								<li>
									<p class="spsoccer-item-title">
										<?php echo JText::_('COM_SOSOCCER_TEAM_FORMER_PRESIDENT'); ?>
									</p>
									<p><?php echo $this->item->former_president; ?></p>
								</li>
								<?php } ?>

								<?php if($this->item->manager){?>
								<li>
									<p class="spsoccer-item-title">
										<?php echo JText::_('COM_SOSOCCER_TEAM_MANAGER_NAME'); ?>
									</p>
									<p><?php echo $this->item->manager; ?></p>
								</li>
								<?php } ?>

								<?php if($this->item->total_title){ ?>
								<li>
									<p class="spsoccer-item-title">
										<?php echo JText::_('COM_SOSOCCER_TEAM_TOTAL_TITLE'); ?>
									</p>
									<p><?php echo $this->item->total_title; ?></p>
								</li>
								<?php } ?>

								<?php if($this->item->city){?>
								<li>
									<p class="spsoccer-item-title">
										<?php echo JText::_('COM_SOSOCCER_TEAM_LOCATION'); ?>
									</p>
									<p><?php echo $this->item->city; ?></p>
								</li>
								<?php } ?>
							</ul>
						</div>

						<div class="team-details-social">
							<ul>
								<?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>

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

			<div class="torunament-info spsoccer-col-sm-9">
				<h3><?php echo JText::_('COM_SOSOCCER_TEAM_CLUB_HISTORY'); ?></h3>
				<p><?php echo $this->item->description; ?></p>

				<div class="spsoccer-team-elements-list-wrap">
					<div class="team-details-tab">
						<!-- Nav tabs -->
						<ul class="nav nav-tabs" role="tablist">
						  	<li role="presentation" class="active">
									<a href="#squad" aria-controls="squad" role="tab" data-toggle="tab">
										<?php echo JText::_('COM_SOSOCCER_TEAM_CLUB_SQUAD'); ?>
									</a>
								</li>
						    <li role="presentation">
									<a href="#honours" aria-controls="honours" role="tab" data-toggle="tab">
										<?php echo JText::_('COM_SOSOCCER_TEAM_CLUB_HONOURS'); ?>
									</a>
								</li>
						    <li role="presentation">
									<a href="#gallery" aria-controls="gallery" role="tab" data-toggle="tab">
										<?php echo JText::_('COM_SOSOCCER_TEAM_CLUB_GALLERY'); ?>
									</a>
								</li>
						    <?php if ($this->item->h_jersey || $this->item->a_jersey) { ?>
						    <li role="presentation">
									<a href="#jersy" aria-controls="jersy" role="tab" data-toggle="tab">
										<?php echo JText::_('COM_SOSOCCER_TEAM_CLUB_JERSY'); ?>
									</a>
								</li>
						    <?php }?>
						</ul>

						<!-- Tab panes -->
						<div class="tab-content">
						    <div role="tabpanel" class="tab-pane active" id="squad">
								<?php if (isset($this->players)) { ?>
								<div class="spsoccer-team-player-list">
									<ul class="spsoccer-team-players spsoccer-ul-list">
										<?php foreach ($this->players as $player) { ?>
											<li class="spsoccer-team-player">
												<div class="spsoccer-row">
													<div class="spsoccer-col-sm-7 spsoccer-col-xs-8 player-name">
														<a href="<?php echo $player->url; ?>">
															<img class="img-responsive spsoccer-thumb" src="<?php echo $player->image; ?>">
														<p class="player-name inline-block"><?php echo $player->squad_no . '. '  . $player->title; ?></p>
														</a>
													</div> <!-- /.spsoccer-col-xs -->

													<div class="spsoccer-col-sm-5 spsoccer-col-xs-4 text-right">
														<p class="player-position"><?php echo $player->player_position; ?></p>
													</div> <!-- /.spsoccer-col-xs -->
												</div>
											</li>
										<?php } ?>
									</ul> <!-- /.spsoccer-ul-list -->
								</div> <!-- /.spsoccer-team-player-list -->
								<?php } //END:: Players ?>
						    </div>
						    <div role="tabpanel" class="tab-pane" id="honours">
								<?php if (isset($this->honours)) { ?>
								<div class="spsoccer-team-honours-list">
									<?php foreach ($this->honours as $honour) { ?>
									<div class="spsoccer-row">
										<div class="spsoccer-col-sm-12 no-col">
											<div class="spsoccer-media honours-intro">
												<div class="pull-left number-type">
													<h3><?php echo $honour['number']; ?></h3>
													<span><?php echo $honour['type']; ?></span>
												</div>

												<div class="spsoccer-media-body">
													<h4 class="club-team-title"><?php echo $honour['title']; ?></h4>
													<div class="win-list"><?php echo $honour['year_list']; ?></div>
												</div>
											</div> <!-- /.honours-intro -->
										</div> <!-- /.sp-soccer-col-sm-12 -->
										</div> <!-- /.spsoccer-row -->
									<?php } ?>
								</div> <!-- /.spsoccer-team-honours-list -->
								<?php } //END:: Honours ?>
						    </div>
						    <div role="tabpanel" class="tab-pane" id="gallery">
								<?php if (isset($this->galleries)) { ?>
									<div class="spsoccer-team-gallery-list">
										<?php foreach ($this->galleries as $gallery) {

											?>
										 <div class="spsoccer-col-sm-4 gallery-image">
										 	<a data-lightbox="lightbox" href="<?php echo $gallery; ?>">
										 		<img class="img-responsive" src="<?php echo $gallery; ?>" alt="Image">
										 	</a>
										 </div> <!-- /.sp-soccer-col-sm-4 -->
										 <?php } ?>

									</div> <!-- /.spsoccer-team-gallery-list -->
								<?php } //END:: Galleries ?>
						    </div>
						    <div role="tabpanel" class="tab-pane" id="jersy">
									<?php if ($this->item->h_jersey || $this->item->a_jersey) { ?>
									<div class="spsoccer-team-jersey-list">
										<?php if(isset($this->item->h_jersey) && $this->item->h_jersey){?>
										<div class="spsoccer-row">
											<div class="spsoccer-col-sm-12 no-col">
												<div class="spsoccer-media">
													<div class="pull-left jersey-img">
														<img class="img-responsive" src="<?php echo $this->item->h_jersey; ?>">
													</div>
													<div class="spsoccer-media-body club-jersey-text">
														<p><?php echo JText::_('COM_SOSOCCER_TEAM_HOME_KIT'); ?></p>
													</div>
												</div>
											</div> <!-- /.spsoccer-col-sm-12 -->
										</div> <!-- /.spsoccer-row -->
										<?php } ?>

										<?php if(isset($this->item->a_jersey) && $this->item->a_jersey){ ?>
										<div class="spsoccer-row">
											<div class="spsoccer-col-sm-12 no-col">
												<div class="spsoccer-media">
													<div class="pull-left jersey-img">
														<img class="img-responsive" src="<?php echo $this->item->a_jersey; ?>">
													</div>
													<div class="spsoccer-media-body club-jersey-text">
														<p><?php echo JText::_('COM_SOSOCCER_TEAM_AWAY_KIT'); ?></p>
													</div>
												</div> <!-- /.spsoccer-media -->
											</div> <!-- /.spsoccer-col-sm-12 -->
										</div> <!-- /.spsoccer-row -->
										<?php } ?>

									</div> <!-- /.spsoccer-team-jersey-list -->
									<?php } //END:: Jerey ?>
						    </div> <!-- /.tabpanel -->
						</div> <!-- /.tab-content -->
					</div> <!-- /.team-details-tab -->
				</div> <!-- /.spsoccer-team-elements-list-wrap -->
			</div> <!-- /.spsoccer-col-sm -->
		</div> <!-- /.spsoccer-row -->
	</div> <!-- /.spsoccer-player -->
</div> <!-- /#spsoccer .spsoccer -->
