<?php
/**
 * @package Sj Jobs Tabs For Js Jobs
 * @version 1.0.0
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @copyright (c) 2015 YouTech Company. All Rights Reserved.
 * @author YouTech Company http://www.smartaddons.com
 *
 */

defined('_JEXEC') or die;

JHtml::stylesheet('modules/' . $module->module . '/assets/css/style.css');
$tag_id = 'sjjobstabs_'.rand().time();
?>
<div class="sjjobs-tabs" id="<?php echo $tag_id; ?>">
	<div class="tabs-wrap">
		<div class="tabs-container">
			<ul class="tabs">
				<?php if ($locations) {?>
					<li class="" data-id="tab-location"><div><?php echo JText::_('MOD_JSJOBS_TABS_JOB_LOCATIONS'); ?></div></li>
				<?php }?>
				<?php if ($jobtitles) {?>
					<li class="" data-id="tab-title"><div><?php echo JText::_('MOD_JSJOBS_TABS_JOB_TITLES'); ?></div></li>
				<?php }?>
				<?php if ($companies) {?>
					<li class="" data-id="tab-company"><div><?php echo JText::_('MOD_JSJOBS_TABS_JOB_COMPANIES'); ?></div></li>
				<?php }?>
			</ul>
		</div>
	</div>
	<div class="tabs-content">
		<div class="tabs-content-inner">
			<?php if ($locations) {?>
				<?php
					$class_tab_location = 'ltabs00-' . $params->get('nb-column1', 6) . ' ltabs01-' . $params->get('nb-column1', 6) . ' ltabs02-' . $params->get('nb-column2', 4) . ' ltabs03-' . $params->get('nb-column3', 2) . ' ltabs04-' . $params->get('nb-column4', 1)
				?>
				<div class="tab-content <?php echo $class_tab_location; ?>" id="tab-location">
					<div class="items-container">
						<div class="items-container-inner">
							<div class="items-inner">
								<?php foreach ($locations as $loc) {?>
									<div class="items-grid item">
										<a href="#"><?php echo $loc->cityName; ?></a>
									</div>
								<?php }?>
							</div>
						</div>
					</div>
				</div>
			<?php }?>

			<?php if ($jobtitles) {?>
				<?php
					$class_tab_title = 'ltabs00-' . $params->get('t-nb-column1', 6) . ' ltabs01-' . $params->get('t-nb-column1', 6) . ' ltabs02-' . $params->get('t-nb-column2', 4) . ' ltabs03-' . $params->get('t-nb-column3', 2) . ' ltabs04-' . $params->get('t-nb-column4', 1)
				?>
				<div class="tab-content <?php echo $class_tab_title; ?>" id="tab-title">
					<div class="items-container">
						<div class="items-container-inner">
							<div class="items-inner">
								<?php foreach ($jobtitles as $item) {?>
									<?php
										$jobaliasid = JSModel::getJSModel('common')->removeSpecialCharacter($item->jobaliasid);
            							$link_viewjob = JRoute::_("index.php?option=com_jsjobs&c=job&view=job&layout=view_job&bd=".$jobaliasid."&Itemid=".JFactory::getApplication()->input->getVar('Itemid', 0));									
									?>
									<div class="items-grid item">
										<a href="<?php echo $link_viewjob; ?>"><?php echo $item->title; ?></a>
									</div>
								<?php }?>
							</div>
						</div>
					</div>
				</div>
			<?php }?>

			<?php if ($companies) {?>
				<?php
					$class_tab_company = 'ltabs00-' . $params->get('c-nb-column1', 6) . ' ltabs01-' . $params->get('c-nb-column1', 6) . ' ltabs02-' . $params->get('c-nb-column2', 4) . ' ltabs03-' . $params->get('c-nb-column3', 2) . ' ltabs04-' . $params->get('c-nb-column4', 1)
				?>
				<div class="tab-content <?php echo $class_tab_company; ?>" id="tab-company">
					<div class="items-container">
						<div class="items-container-inner">
							<div class="items-inner">
								<?php foreach ($companies as $com) {?>
									<?php
										$companyaliasid = JSModel::getJSModel('common')->removeSpecialCharacter($com->aliasid);
										$com_view_link = JRoute::_("index.php?option=com_jsjobs&c=job&view=job&layout=jobs&cd=" . $companyaliasid . "&Itemid=" . JFactory::getApplication()->input->getVar('Itemid', 0));
									?>
									<div class="items-grid item">
										<a href="<?php echo $com_view_link; ?>"><?php echo $com->name; ?></a>
									</div>
								<?php }?>
							</div>
						</div>
					</div>
				</div>
			<?php }?>
		</div>
	</div>
	<div class="clr clear clearfix"></div>
</div>