<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	if (isset($_GET['err']))
	{
		$titles = __('error_titles', true);
		$bodies = __('error_bodies', true);
		pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]);
	}
	$u_statarr = __('u_statarr', true);
	
	pjUtil::printNotice(__('infoApplicationsTitle', true), __('infoApplicationsDesc', true));
	?>
	
	<div class="b10">
		<form action="" method="get" class="float_left pj-form frm-filter">
			<input type="text" name="q" class="pj-form-field pj-form-field-search w150" placeholder="<?php __('btnSearch'); ?>" />
		</form>
		<?php
		$filter = __('app_filter', true);
		?>
		<div class="float_right t5">
			<a href="#" class="pj-button btn-all"><?php __('lblAll');?></a>
			<a href="#" class="pj-button btn-filter btn-status" data-column="status" data-value="N"><?php echo $filter['N']; ?></a>
			<a href="#" class="pj-button btn-filter btn-status" data-column="status" data-value="T"><?php echo $filter['T']; ?></a>
			<a href="#" class="pj-button btn-filter btn-status" data-column="status" data-value="F"><?php echo $filter['F']; ?></a>
		</div>
		<br class="clear_both" />
	</div>

	<div id="grid"></div>
	<script type="text/javascript">
	var pjGrid = pjGrid || {};
	pjGrid.jsDateFormat = "<?php echo pjUtil::jsDateFormat($tpl['option_arr']['o_date_format']); ?>";
	pjGrid.isEmployer = "<?php echo $controller->isEmployer() ? 'true' : 'false'; ?>";
	pjGrid.queryString = "";
	<?php
	if(isset($_GET['job_id']) && (int) $_GET['job_id'] > 0 )
	{ 
		?>
		pjGrid.job_id = "<?php echo (int) $_GET['job_id'];?>";
		pjGrid.queryString += "&job_id=<?php echo $_GET['job_id']; ?>";
		<?php
	} 
	if (isset($_GET['employer_id']) && (int) $_GET['employer_id'] > 0 && !$controller->isEmployer())
	{
		?>pjGrid.queryString += "&employer_id=<?php echo (int) $_GET['employer_id']; ?>";<?php
	}
	?>
	var myLabel = myLabel || {};
	
	myLabel.appliedjob = "<?php __('lblAppliedJob'); ?>";
	myLabel.name = "<?php __('lblName'); ?>";
	myLabel.email = "<?php __('email'); ?>";
	myLabel.created = "<?php __('lblCreated'); ?>";
	myLabel.revert_status = "<?php __('revert_status'); ?>";
	myLabel.exported = "<?php __('lblExport'); ?>";
	myLabel.new = "<?php echo $filter['N']; ?>";
	myLabel.approved = "<?php echo $filter['T']; ?>";
	myLabel.rejected = "<?php echo $filter['F']; ?>";
	myLabel.delete_confirmation = "<?php __('lblDeleteConfirmation'); ?>";
	myLabel.delete_selected = "<?php __('lblDeleteSelected'); ?>";
	myLabel.status = "<?php __('lblStatus'); ?>";
	</script>
	<?php
}
?>