<?php
mt_srand();
$index = mt_rand(1, 9999);
?>
<div id="pjWrapper">
	<div class="container-fluid pjJlContainer">
		<?php
		if(!empty($tpl['arr']))
		{ 
			?>
			<div class="row pjJlListResults pjJlListResultsAlt">
				<?php
				foreach($tpl['arr'] as $k => $v)
				{ 
					$job_title = stripslashes($v['job_title'] . " / " . $v['job_refid']);
					if ($tpl['option_arr']['o_seo_url'] == 'No')
					{
						$url = $_SERVER['SCRIPT_NAME'] . '?controller=pjLoad&amp;action=pjActionView&amp;id=' . $v['id'] .(isset($_GET['iframe']) ? '&amp;iframe' : NULL);
						if(!empty($tpl['option_arr']['o_job_page']))
						{
							$url = $tpl['option_arr']['o_job_page'] . '?controller=pjLoad&amp;action=pjActionView&amp;id=' . $v['id'];
						}
					} else {
						$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
						$path = $path == '/' ? '' : $path;
						$url = $path .'/'. $controller->friendlyURL($v['job_title']) . "-". $v['id'] . ".html";
					}
					$map = array(
						1 => 'pjJlResultTypeLightGreen',
						2 => 'pjJlResultTypeRed',
						3 => 'pjJlResultTypeBlue',
						4 => 'pjJlResultTypeOrange',
						5 => 'pjJlResultTypePurple',
						6 => 'pjJlResultTypeGreen'
					);
					?>
					<div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">
						<a href="<?php echo $url;?>" class="pjJlResult">
							<p class="text-capitalize pjJlResultTitle"><?php echo html_entity_decode($job_title);?></p><!-- /.pjJlResultTitle -->
							
							<p class="pjJlResultSubTitle">Administrative/Clerical Jobs</p><!-- /.pjJlResultSubTitle -->
																	
							<span class="label label-default pjJlResultType <?php echo $map[$v['type_id']]; ?>"><?php echo $v['type_title'];?></span><!-- /.clearfix -->
																	
							<ul class="list-inline pjJlResultMeta">
								<li>
									<dl>
										<dt><?php __('front_post_on');?>: </dt>
										<dd class="text-capitalize"><?php echo date($tpl['option_arr']['o_date_format'], strtotime($v['created']));?></dd>
									</dl>
								</li>
																	
								<?php
								if(!empty($v['company_name']))
								{
									?>
									<li>
										<dl>
											<dt><?php __('front_label_company_name');?>: </dt>
											<dd class="text-capitalize"><?php echo pjSanitize::html($v['company_name']);?></dd>
										</dl>
									</li>
									<?php
								}
								if(!empty($v['lang_city'])) 
								{
									?>
									<li>
										<dl>
											<dt><?php __('front_location');?>: </dt>
											<dd class="text-capitalize"><?php echo pjSanitize::html($v['lang_city']);?></dd>
										</dl>
									</li>
									<?php
								}else{
									if(!empty($v['address_city']))
									{
										?>
										<li>
											<dl>
												<dt><?php __('front_location');?>: </dt>
												<dd class="text-capitalize"><?php echo pjSanitize::html($v['address_city']);?></dd>
											</dl>
										</li>
										<?php
									}
								} 
								?>
							</ul><!-- /.list-inline pjJlResultMeta -->
																	
							<p>
								<?php echo pjUtil::truncateDescription(pjUtil::html2txt(html_entity_decode($v['job_description'])), 200, ' ');?>
							</p>
																	
							<div class="pjJlResultActions">
								<button type="button" class="btn btn-default pjJlBtn pjJlBtnPrimary pjJlBtnViewDetails"><?php __('front_btn_view_details');?></button>
							</div><!-- /.pjJlResultActions --><!-- /.col-lg-10 col-md-10 col-sm-10 col-xs-10 pjJlResultContent --><!-- /.row -->
						</a>
					</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-6 -->
					<?php
				} 
				?>
			</div><!-- /.row pjJlListResults pjJlListResultsAlt -->
			<?php
		}else{
			__('front_label_no_found');
		} 
		?>
	</div><!-- /.container-fluid pjJlContainer -->
</div><!-- /.pjWrapper -->

<?php include_once dirname(__FILE__) . '/elements/loadjs.php';?>