<?php
mt_srand();
$index = mt_rand(1, 9999);
$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
$path = $path == '/' ? '' : $path;
$action = "";
if($tpl['option_arr']['o_seo_url'] == 'Yes')
{
	if(empty($tpl['option_arr']['o_job_page']))
	{
		$action = $path . '/job-home.html';
	}else{
		$action = $tpl['option_arr']['o_job_page'];
	}
}
?>
<div id="pjWrapper">
	<div class="container-fluid pjJlContainer">
		<?php include_once dirname(__FILE__) . '/elements/header.php';?>
		
		<div class="pjJlBody">
			<div class="pjJlForm pjJlFormSearch">
				<form action="<?php echo $action;?>" id="pjJLAdvancedSearch_<?php echo $index; ?>" method="get">
					<?php
					if ($tpl['option_arr']['o_seo_url'] == 'No' || ($tpl['option_arr']['o_seo_url'] == 'Yes' && !empty($tpl['option_arr']['o_job_page'])) )
					{ 
						?>
						<input type="hidden" name="controller" value="pjLoad" />
						<input type="hidden" name="action" value="pjActionJobs" />
						<?php
					} 
					?>
					<input type="hidden" name="job_search" value="1" />
					
					<p class="pjJlFormTitle"><?php __('front_advanced_job_search');?></p><!-- /.pjJlFormTitle -->
					
					<div class="row">
						<?php
						if(!empty($tpl['category_arr']))
						{
							?>
							<div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
								<div class="form-group">
									<label for=""><?php __('front_label_category');?>: </label>
									<div class="pre-scrollable pjJlCheckboxes">
										<ul class="list-unstyled pjJlListCheckboxes">
											<?php
											foreach($tpl['category_arr'] as $k => $v)
											{
												?>
												<li>
													<div class="pjJlCheckbox pjJlCustomCheckbox">
														<input type="checkbox" name="category_id[]" id="pjJlIndustrieCategory_<?php echo $v['id'];?>" value="<?php echo $v['id'];?>"/>
	
														<label for="pjJlIndustrieCategory_<?php echo $v['id'];?>">
															<span class="pjJlCustomCheckboxFake">
																<i class="fa fa-check"></i>
															</span>
	
															<?php echo stripslashes($v['name']);?>
														</label>
													</div><!-- /.pjJlCheckbox pjJlCustomCheckbox -->
												</li>
												<?php
											} 
											?>
										</ul><!-- /.list-unstyled pjJlListCheckboxes -->
									</div><!-- pre-scrollable pjJlCheckboxes -->
								</div><!-- /.form-group -->
							</div><!-- /.col-lg-8 col-md-8 col-sm-8 col-xs-12 -->
							<?php
						}
						?>

						<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
							<div class="form-group">
								<label for=""><?php __('front_include_these_words');?>: </label>

								<input type="text" name="keyword" class="form-control" placeholder="<?php __('front_keyword');?>" />
							</div><!-- /.form-group -->
							
							<div class="form-group">
								<label for=""><?php __('front_location');?>: </label>

								<input type="text" name="location" class="form-control" placeholder="<?php __('front_location_placeholder');?>" />
							</div><!-- /.form-group -->
							
							<div class="form-group">
								<label for=""><?php __('front_label_company_name');?>: </label>

								<input type="text" name="company_name" class="form-control" placeholder="<?php __('front_company_placeholder');?>" />
							</div><!-- /.form-group -->
						</div><!-- /.col-lg-4 col-md-4 col-sm-4 col-xs-12 -->

						<?php
						if(!empty($tpl['type_arr']))
						{
							?>
							<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12">
								<div class="form-group">
									<label for=""><?php __('front_label_type');?>: </label>
									<div class="row">
										<?php
										foreach($tpl['type_arr'] as $k => $v)
										{
											?>
											<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
												<div class="pjJlCheckbox pjJlCustomCheckbox">
													<input type="checkbox" name="type_id[]" id="pjJlIndustrieType_<?php echo $v['id'];?>" value="<?php echo $v['id'];?>"/>

													<label for="pjJlIndustrieType_<?php echo $v['id'];?>">
														<span class="pjJlCustomCheckboxFake">
															<i class="fa fa-check"></i>
														</span>

														<?php echo stripslashes($v['name']);?>
													</label>
												</div><!-- /.pjJlCheckbox pjJlCustomCheckbox -->
											</div><!-- /.col-lg-4 col-md-4 col-sm-4 col-xs-12 -->
											<?php
										} 
										?>
									</div><!-- /.row -->
								</div><!-- /.form-group -->
							</div><!-- /.col-lg-8 col-md-12 col-sm-12 col-xs-12 -->
							<?php
						}
						if(!empty($tpl['filter_arr']))
						{
							foreach(__('filter_types', true) as $key => $val)
							{
								if(isset($tpl['filter_arr'][$key]))
								{
									?>
									<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<div class="form-group">
											<label for=""><?php echo $val;?>: </label>
											<div class="row">
												<?php
												foreach($tpl['filter_arr'][$key] as $k => $v)
												{
													?>
													<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
														<div class="pjJlCheckbox pjJlCustomCheckbox">
															<input type="checkbox" name="filter_id[]" id="pjJlExperience_<?php echo $v['id'];?>" value="<?php echo $v['id'];?>"/>
		
															<label for="pjJlExperience_<?php echo $v['id'];?>">
																<span class="pjJlCustomCheckboxFake">
																	<i class="fa fa-check"></i>
																</span>
		
																<?php echo stripslashes($v['name']);?>
															</label>
														</div><!-- /.pjJlCheckbox pjJlCustomCheckbox -->
													</div><!-- /.col-lg-4 col-md-4 col-sm-6 col-xs-12 -->
													<?php 
												} 
												?>
											</div>
										</div>
									</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 -->
									<?php
								}
							}
						}
						?>
						<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions">
							<button type="submit" class="btn btn-default pjJlBtn pjJlBtnPrimary"><?php __('front_btn_find_jobs');?></button>
						</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 pjJlFormActions -->
					</div><!-- /.row -->
				</form>
			</div><!-- /.pjJlForm pjJlFormSearch  -->
		</div><!-- /.pjJlBody -->
	</div><!-- /.container-fluid pjJlContainer -->
</div><!-- /.pjWrapper -->

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