include_once("include_files.php");
include_once(PATH_TO_MAIN_PHYSICAL_LANGUAGE.$language.'/'.FILENAME_JOBFAIR);
$template->set_filenames(array('jobfair' => 'jobfair.htm', // it shows main article through article.php
'jobfair2' => 'jobfair2.htm', //page displays through jobfair.php
));
include_once(FILENAME_BODY);
$action = tep_db_prepare_input($_GET['action']);
$jobfair_seo = tep_db_prepare_input($_GET['jobfair_seo']);
//print_r($_GET);
$hidden_fields='';
$jobfair_id = tep_db_prepare_input($_GET['jobfair_id']);
$page_no = tep_db_prepare_input($_GET['page']);
$now=date("Y-m-d");//date("Y-m-d H:i:s");
if(tep_not_null($jobfair_seo))
{
if($row_check=getAnyTableWhereData(JOBFAIR_TABLE,"jobfair_seo_name='".tep_db_input($jobfair_seo)."'","id"))
{
$jobfair_id =$row_check['id'];
}
else
tep_redirect(tep_href_link(FILENAME_JOBFAIR));
}
////////////////////////////////////////////////////////////////////////////////////////////////////
if($jobfair_id=="")
{
$jobfair_view_array=array();
$jobfair_view_array[]=array('id'=>'','text'=>INFO_TEXT_SORT_BY);
$jobfair_view_array[]=array('id'=>'1a','text'=>INFO_TEXT_START_ASC);
$jobfair_view_array[]=array('id'=>'1b','text'=>INFO_TEXT_START_DESC);
$jobfair_view_array[]=array('id'=>'2a','text'=>INFO_TEXT_NAME_ASC);
$jobfair_view_array[]=array('id'=>'2b','text'=>INFO_TEXT_NAME_DESC);
$jobfair_view_array[]=array('id'=>'3a','text'=>INFO_TEXT_END_ASC);
$jobfair_view_array[]=array('id'=>'3b','text'=>INFO_TEXT_END_DESC);
$sort_array=array("jf.jobfair_begindate","jf.jobfair_title","jf.jobfair_enddate");
include_once(PATH_TO_MAIN_PHYSICAL_CLASS.'sort_by_clause.php');
// $obj_sort_by_clause=new sort_by_clause($sort_array,'jf.jobfair_begindate asc');
$obj_sort_by_clause=new sort_by_clause($sort_array,'jf.inserted desc');
$order_by_clause=$obj_sort_by_clause->return_value;
$jobfair_query_raw = "select jf.* from ".JOBFAIR_TABLE." as jf where jf.jobfair_status='Yes' and jf.jobfair_enddate>='".$now."' order by ".$order_by_clause;
//echo $jobfair_query_raw."
";
$jobfair_split = new splitPageResults($page_no, MAX_DISPLAY_JOBFAIRS, $jobfair_query_raw, $jobfair_query_numrows);
$jobfair_query = tep_db_query($jobfair_query_raw);
if(tep_db_num_rows($jobfair_query) > 0)
{
$alternate=0;
while ($jobfair = tep_db_fetch_array($jobfair_query))
{
$ide = $jobfair["id"];
$jobfair_seo_name = $jobfair["jobfair_seo_name"].'-jobfair';
$jf_short_desc=((strlen($jobfair['jobfair_short_description'])<100)?$jobfair['jobfair_short_description']:substr($jobfair['jobfair_short_description'],0,100)."..");
$jobfair_image='';
if(tep_not_null($jobfair["jobfair_logo"]) && is_file(PATH_TO_MAIN_PHYSICAL.PATH_TO_JOBFAIR_LOGO.$jobfair["jobfair_logo"]))
$jobfair_image=tep_image(FILENAME_IMAGE."?image_name=".PATH_TO_JOBFAIR_LOGO.$jobfair["jobfair_logo"].'','','','','class="img-fluid img-hover img-thumbnail mini-profile-img mr-3"');
$jobfair_url=tep_href_link(get_display_link($ide,$jobfair_seo_name));
$template->assign_block_vars('jobfair', array(
'jobfair_name' =>''.tep_db_output($jobfair['jobfair_title']).'',
'jobfair_location'=>tep_db_output($jobfair["jobfair_location"]),
'jobfair_desc'=>$jf_short_desc,//nl2br(stripslashes(strip_tags($jobfair['jobfair_short_description']))),
'jobfair_image' =>$jobfair_image,
'startdate'=>tep_db_output(formate_date($jobfair["jobfair_begindate"],'d-M-Y')),
'enddate'=>tep_db_output(formate_date($jobfair["jobfair_enddate"],'d-M-Y')),
'more_jobfair' =>''.INFO_TEXT_MORE.'>>',
));
$alternate++;
}
@tep_db_free_result($jobfair_query);
}
}
else if($jobfair_id!="")
{
if(!$row_check=getAnyTableWhereData(JOBFAIR_TABLE,"id=".tep_db_input($jobfair_id)." and jobfair_status='Yes'","*"))
{
$messageStack->add_session(INFO_TEXT_SORRY_NO_JOBFAIR, 'error');
tep_redirect(FILENAME_JOBFAIR);
}
else
{
$jobfair_id=$row_check['id'];
$hidden_field=tep_draw_hidden_field('jobfair_id',$row_check['id']);
$email_form=tep_draw_form("email_form",FILENAME_EMAIL_JOBFAIR,'','post').$hidden_field;
$email="".INFO_TEXT_EMAIL."";
$email_button="
";
$jobfair_title=tep_db_output($row_check['jobfair_title']);
$jobfair_location=tep_db_output($row_check['jobfair_location']);
$jobfair_venue=stripslashes(tep_db_output($row_check['jobfair_venue']));
$jobfair_startdate=tep_db_output(formate_date($row_check["jobfair_begindate"],'d-M-Y'));
$jobfair_description=stripslashes($row_check['jobfair_description']);
if(tep_not_null($row_check["jobfair_logo"]) && is_file(PATH_TO_MAIN_PHYSICAL.PATH_TO_JOBFAIR_LOGO.$row_check["jobfair_logo"]))
$jobfair_logo=tep_image(FILENAME_IMAGE."?image_name=".PATH_TO_JOBFAIR_LOGO.$row_check["jobfair_logo"].'','','','','class="extra-large-profile-img me-4"');
///******replacing youtube link with embed code****/////////////////
$jobfair_video_link=$row_check["jobfair_video"];
$search_video='/youtube\.com\/watch\?v=([a-zA-Z0-9]+)/smi';
$replace_video= 'youtube.com/embed/$1';
$embed_code = preg_replace($search_video,$replace_video,$jobfair_video_link);//preg_replace("/watch\?v=/i", 'embed/', $link);
$jobfair_video='';
///////***************/////////////////////
$jobfair_googlemap_url='';
$jobfair_short_desc=stripslashes($row_check['jobfair_short_description']);
/*****************display of company name codeing begins*********************************/
///*********************************************************************************/////
define('MAX_DISPLAY_DIRECTORY_RESULT',100);
$now=date('Y-m-d H:i:s');
$whereClause1=" select distinct(j.recruiter_id) as recruiter_id from ".JOB_TABLE." as j where j.expired >='$now' and j.re_adv <='$now' and j.job_status='Yes' and ( j.deleted is NULL or j.deleted='0000-00-00 00:00:00')";
$whereClause="where rl.recruiter_status='Yes' and r.recruiter_id in ($whereClause1)";
// $whereClause="where rl.recruiter_status='Yes'";
$query1 = "select count(r.recruiter_id ) as x1 from ".RECRUITER_TABLE." as r left join ".RECRUITER_LOGIN_TABLE." as rl on ( r.recruiter_id = rl.recruiter_id) ". $whereClause;
$result1=tep_db_query($query1);
$tt_row=tep_db_fetch_array($result1);
$x1=$tt_row['x1'];//echo $query1;
//echo $x1;die();
///only for sorting starts
include_once(PATH_TO_MAIN_PHYSICAL_CLASS.'sort_by_clause.php');
$sort_array=array("recruiter_company_name",'inserted');
$obj_sort_by_clause=new sort_by_clause($sort_array,'recruiter_company_name asc');
$order_by_clause=$obj_sort_by_clause->return_value;
if(tep_not_null($_GET['directoru_char']))
{
$get_char=$_GET['directoru_char'];
if (in_array($get_char,array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' )) && $get_char!='')
{
$recofigar_limit=(int)get_company_direct_limit($get_char);
if($recofigar_limit>MAX_DISPLAY_DIRECTORY_RESULT)
$recofigar_limit=$recofigar_limit-($recofigar_limit%MAX_DISPLAY_DIRECTORY_RESULT);//
$_POST['lower']=$recofigar_limit;
if($recofigar_limit>0)
$_POST['page'][0]=(int)$recofigar_limit/MAX_DISPLAY_DIRECTORY_RESULT;
}
}
$see_before_page_number_array=see_before_page_number123($sort_array,$field,'job_title',$order,'asc',$lower,'0',$higher,MAX_DISPLAY_DIRECTORY_RESULT);
//$lower=
$lower=$see_before_page_number_array['lower'];
$higher=$see_before_page_number_array['higher'];
$field=$see_before_page_number_array['field'];
$order=$see_before_page_number_array['order'];
$hidden_fields.=tep_draw_hidden_field('sort',$sort);
$totalpage=ceil($x1/$higher);
$table_names=JOB_JOBFAIR_TABLE.' as jjf,'.JOB_TABLE.' as j,'.RECRUITER_TABLE.' as r,'.RECRUITER_JOBFAIR_TABLE.' as rjf';
$whereClause="jjf.jobfair_id=".$jobfair_id." and jjf.job_id=j.job_id and j.recruiter_id=r.recruiter_id and r.recruiter_id=rjf.recruiter_id and rjf.approved='Yes' and j.add_jobfair='Yes'";//
$field_names="distinct(jjf.jobfair_id),jjf.job_id, j.job_salary, j.job_location, j.job_country_id, r.recruiter_company_name, rjf.recruiter_id,r.recruiter_logo, j.job_title,j.max_experience,j.job_skills, j.min_experience";
$query = "select $field_names from $table_names where $whereClause ORDER BY $field $order limit $lower,$higher";//order by rjf.inserted desc limit 0,12" ;
//echo $query;
$result=tep_db_query($query);//echo "
$query";//exit;
$x=tep_db_num_rows($result);//echo $x;exit;
$pno= ceil($lower+$higher)/($higher);
$job_display='
',
'print' =>''.INFO_TEXT_PRINT.'',
'jobfair_title'=>$jobfair_title,
'jobfair_short_desc'=>$jobfair_short_desc,
'jobfair_logo'=>$jobfair_logo,
'jobfair_location'=>$jobfair_location,
'jobfair_startdate'=>$jobfair_startdate,
'jobfair_venue'=>$jobfair_venue,
'jobfair_description'=>$jobfair_description,
'jobfair-video'=>($jobfair_video_link==''?'':'