set_time_limit(400000);
session_start();
// error_reporting(0);
$action = "apply";
setcookie("cjobs" , "-$job-" );
setcookie("caction" , $action );
setcookie("cbackurl" , $backurl );
// header("Location:system_job_process.php");
include("setting.php");
include("class.phpmailer.php");
include("system_function_files.php");
check_license_validity();
$tmp_jobs = $_GET['job'];
$tmp_action = $action;
$tmp_backurl = $backurl;
if ($cjobs ){ $tmp_jobs = $cjobs; }
if ($caction ){ $tmp_action = $caction; }
if ($cbackurl ){ $tmp_backurl = $cbackurl; }
if (!$clogin_jobseeker) {
setcookie("caction" , $tmp_action );
setcookie("cjobs" , $tmp_jobs );
setcookie("cbackurl" , $tmp_backurl );
$destination = "jobseeker_login.php";
}
else {
$processed = 0;
$arr_jobs = split("-", $tmp_jobs);
$destination = $tmp_backurl . "#list";
$db_connect = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name, $db_connect) || die(mysql_error());
mysql_query("SET character_set_results=UTF8");
mysql_query("SET collation_connection=utf8_general_ci");
mysql_query("SET NAMES 'latin1'");
$cur_job = $tmp_jobs;
echo $cur_job;
if ($cur_job) {
$processed++;
// procedures for adding favourite
if ($tmp_action == "favourite") {
$sql_query = "SELECT * FROM jobseeker_favourite WHERE favourite_jobseeker = '$clogin_jobseeker' AND favourite_job = '$cur_job'";
$result = mysql_query($sql_query) or die(mysql_error());
$found = mysql_num_rows($result);
if (!$found) {
$sql_query = "
INSERT INTO jobseeker_favourite
SET
favourite_jobseeker = '$clogin_jobseeker',
favourite_job = '$cur_job',
favourite_date = '$date_database'
";
mysql_query($sql_query) or die(mysql_error());
}
} // if ($tmp_action == "favourite")
// procedures for quick apply
if ($tmp_action == "apply") {
$sql_query = "SELECT * FROM job_application WHERE application_jobseeker = '$clogin_jobseeker' AND application_job = '$cur_job'";
$result = mysql_query($sql_query) or die(mysql_error());
$found = mysql_num_rows($result);
if (!$found) {
$sql_query = "
INSERT INTO job_application
SET
application_jobseeker = '$clogin_jobseeker',
application_job = '$cur_job',
application_date = '$date_database'
";
mysql_query($sql_query) or die(mysql_error());
$db_connect = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name, $db_connect) || die(mysql_error());
mysql_query("SET character_set_results=UTF8");
mysql_query("SET collation_connection=utf8_general_ci");
mysql_query("SET NAMES 'latin1'");
// add to session
if ($HTTP_POST_VARS) {
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
session_register("c$key");
$_SESSION["c$key"] = $val;
}
}
$job_req_religion = grab_multiple_fields($_POST['job_req_religion']);
$job_req_race = grab_multiple_fields($_POST['job_req_race']);
$job_req_marital = grab_multiple_fields($_POST['job_req_marital']);
$_SESSION["cjob_req_religion"] = $job_req_religion;
$_SESSION["cjob_req_race"] = $job_req_race;
$_SESSION["cjob_req_marital"] = $job_req_marital;
// validate form fields
$form_error = valid_special_form($_POST);
// exclude from validation
if ($job_salary_type == "negotiable") {
if (!$job_salary_min) { $form_error--; $_SESSION["c". "job_salary_min" . "_warn"] = 0; }
if (!$job_salary_max) { $form_error--; $_SESSION["c". "job_salary_max" . "_warn"] = 0; }
}
// continue ...
if ($form_error) {
setcookie("warning", "incomplete_form");
if ($package) { $destination = "jobseeker_matches.php"; }
else { $destination = "jobseeker_matches.php"; }
}
else {
$job_package = $package;
$job_employer = $clogin_employer;
$job_status = "pending";
$job_date_expire = $date_database;
$job_lastdate = "$job_lastdate_year-$job_lastdate_month-$job_lastdate_date";
$sql_query = "SELECT * FROM employer WHERE employer_id = '$job_employer'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$employer_id = $row[employer_id];
$employer_type = $row[employer_type];
$employer_title = $row[employer_title];
$employer_firstname = $row[employer_firstname];
$employer_lastname = $row[employer_lastname];
$employer_expired = $row[employer_date_expired];
if ($status_auto_approval == "yes" ) { $job_status = "approved"; }
if ($employer_type == "subscription" ) { $job_date_expire = $employer_expired; }
$sql_query = "
UPDATE job SET
job_term = '$job_term',
job_title = '$job_title',
job_position = '$job_position',
job_industry = '$job_industry',
job_function = '$job_function',
job_lastdate = '$job_lastdate',
job_salary_type = '$job_salary_type',
job_salary_min = '$job_salary_min',
job_salary_max = '$job_salary_max',
job_salary_payment = '$job_salary_payment',
job_office_city = '$job_office_city',
job_office_state = '$job_office_state',
job_office_zip = '$job_office_zip',
job_office_country = '$job_office_country',
job_office_location = '$job_office_location',
job_req_religion = '$job_req_religion',
job_req_race = '$job_req_race',
job_req_marital = '$job_req_marital',
job_req_age_min = '$job_req_age_min',
job_req_age_max = '$job_req_age_max',
job_req_workexp = '$job_req_workexp',
job_req_academic = '$job_req_academic',
job_details = '$job_details',
job_status = '$job_status'
WHERE job_id = '$job_id'
";
mysql_query($sql_query) or die(mysql_error());
$db_connect = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name, $db_connect) || die(mysql_error());
mysql_query("SET character_set_results=UTF8");
mysql_query("SET collation_connection=utf8_general_ci");
mysql_query("SET NAMES 'latin1'");
$sql_query = "SELECT * FROM job WHERE job_id = '$job'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$job_id = $row[job_id];
$job_number = $job_id + $start_job;
$job_title = $row[job_title];
$job_employer = $row[job_employer];
$job_package = $row[job_package];
$db_connect = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_name, $db_connect) || die(mysql_error());
mysql_query("SET character_set_results=UTF8");
mysql_query("SET collation_connection=utf8_general_ci");
mysql_query("SET NAMES 'latin1'");
$sql_query = "SELECT * FROM jobseeker WHERE jobseeker_id = '$jobseeker_id'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$jobseeker_id = $row[jobseeker_id];
$jobseeker_username = $row[jobseeker_username];
$jobseeker_password = $row[jobseeker_password];
$jobseeker_title = $row[jobseeker_title];
$sql_query = "SELECT * FROM setup_personaltitle WHERE personaltitle_id = '$jobseeker_title'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_title = $row_tmp[personaltitle_name];
$jobseeker_firstname = $row[jobseeker_firstname];
$jobseeker_lastname = $row[jobseeker_lastname];
$jobseeker_fullname = "$jobseeker_title $jobseeker_firstname $jobseeker_lastname";
$jobseeker_birthdate = get_formatted_date($row[jobseeker_birthdate], $date_format);
$jobseeker_nationality = $row[jobseeker_nationality];
$jobseeker_idnumber = $row[jobseeker_idnumber];
$jobseeker_gender = $row[jobseeker_gender];
$sql_query = "SELECT * FROM setup_gender WHERE gender_id = '$jobseeker_gender'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_gender = $row_tmp[gender_name];
$jobseeker_religion = $row[jobseeker_religion];
$sql_query = "SELECT * FROM setup_religion WHERE religion_id = '$jobseeker_religion'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_religion = $row_tmp[religion_name];
$jobseeker_race = $row[jobseeker_race];
$sql_query = "SELECT * FROM setup_race WHERE race_id = '$jobseeker_race'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_race = $row_tmp[race_name];
$jobseeker_marital = $row[jobseeker_marital];
$sql_query = "SELECT * FROM setup_maritalstatus WHERE maritalstatus_id = '$jobseeker_marital'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_marital = $row_tmp[maritalstatus_name];
$jobseeker_address = $row[jobseeker_address];
$jobseeker_address2 = $row[jobseeker_address2];
$jobseeker_city = $row[jobseeker_city];
$jobseeker_state = $row[jobseeker_state];
$jobseeker_zip = $row[jobseeker_zip];
$jobseeker_country = $row[jobseeker_country];
$sql_query = "SELECT * FROM setup_country WHERE country_id = '$jobseeker_country'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_country = $row_tmp[country_name];
$jobseeker_phone = $row[jobseeker_phone];
$jobseeker_cellphone = $row[jobseeker_cellphone];
$jobseeker_fax = $row[jobseeker_fax];
$jobseeker_email = $row[jobseeker_email];
$jobseeker_website = $row[jobseeker_website];
// get resume details ...
$jobseeker_r_title = $row[jobseeker_resume_title];
$jobseeker_r_workingyear = $row[jobseeker_resume_workingyear];
$jobseeker_r_expectedsalary = $row[jobseeker_resume_expectedsalary];
$jobseeker_r_expectedsalary = $currency_symbol . number_format($jobseeker_r_expectedsalary, 2, $web_decimal_separator, $web_thousand_separator);;
$jobseeker_r_fresh = $row[jobseeker_resume_fresh];
if ($jobseeker_r_fresh == "Y") { $jobseeker_r_fresh = $lang[lang_jobseeker_resume1_field_resume_fresh_option_yes]; }
else { $jobseeker_r_fresh = $lang[lang_jobseeker_resume1_field_resume_fresh_option_no]; }
$jobseeker_r_academic = $row[jobseeker_resume_academic];
$sql_query = "SELECT * FROM setup_academic WHERE academic_id = '$jobseeker_r_academic'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$jobseeker_r_academic = $row_tmp[academic_name];
$jobseeker_r_availability = $row[jobseeker_resume_availability];
$jobseeker_r_availabilitydate = get_formatted_date($row[jobseeker_resume_availabilitydate], $date_format);
if ($jobseeker_r_availability == "immediate" ) { $jobseeker_r_availability = $lang[lang_jobseeker_resume1_field_resume_availability_option_immediate]; }
else { $jobseeker_r_availability = $jobseeker_r_availabilitydate; }
$sql_query = "SELECT * FROM jobseeker WHERE jobseeker_id = '$jobseeker_id'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$jobseeker_id = $row[jobseeker_id];
$jobseeker_resume_title = $row[jobseeker_resume_title];
$jobseeker_resume_fresh = $row[jobseeker_resume_fresh];
$jobseeker_resume_academic = $row[jobseeker_resume_academic];
$jobseeker_resume_workingyear = $row[jobseeker_resume_workingyear];
$jobseeker_resume_expectedsalary = $row[jobseeker_resume_expectedsalary];
$jobseeker_resume_availability = $row[jobseeker_resume_availability];
$jobseeker_resume_availabilitydate = $row[jobseeker_resume_availabilitydate];
$jobseeker_resume_availabilitydate_tmp = explode("-", $jobseeker_resume_availabilitydate);
$jobseeker_resume_availabilitydate_year = $jobseeker_resume_availabilitydate_tmp[0] * 1;
$jobseeker_resume_availabilitydate_month = $jobseeker_resume_availabilitydate_tmp[1] * 1;
$jobseeker_resume_availabilitydate_date = $jobseeker_resume_availabilitydate_tmp[2] * 1;
$jobseeker_resume_choice = $row[jobseeker_resume_choice];
$jobseeker_resume_file = $row[jobseeker_resume_file];
if ($jobseeker_resume_file && file_exists("$dir_resume/$jobseeker/$jobseeker_resume_file")) {
$jobseeker_resume_file_url = "$url_resume/$jobseeker/$jobseeker_resume_file";
$jobseeker_resume_file_available = "Y";
}
// get brief information / summary ...
$jobseeker_summary = $row[jobseeker_summary];
// get interest details ...
$jobseeker_i_industry = "-". $row[jobseeker_interest_industry];
$jobseeker_i_jobfunction = "-". $row[jobseeker_interest_jobfunction];
$jobseeker_i_position = $row[jobseeker_interest_position];
$jobseeker_i_employmentterm = "-" . $row[jobseeker_interest_employmentterm];
$jobseeker_i_joblocation = "-" . $row[jobseeker_interest_joblocation];
$jobseeker_certification = $row[jobseeker_education_certification];
if (strpos($jobseeker_i_industry, "-0-") > 0) { $jobseeker_i_industry = $lang[lang_value_any]; }
else {
$tmp_industry = explode("-", $jobseeker_i_industry);
$tmp_industry_text = "";
for ($i=0; $i<=sizeof($tmp_industry); $i++) {
$cur_industry = $tmp_industry[$i];
if ($cur_industry) {
$sql_query = "SELECT * FROM setup_industry WHERE industry_id = '$cur_industry'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$industry_name = $row[industry_name];
if ($industry_name) { $tmp_industry_text .= "$industry_name
"; }
}
}
$jobseeker_i_industry = $tmp_industry_text;
}
if (strpos($jobseeker_i_jobfunction, "-0-") > 0) { $jobseeker_i_jobfunction = $lang[lang_value_any]; }
else {
$tmp_jobfunction = explode("-", $jobseeker_i_jobfunction);
$tmp_jobfunction_text = "";
for ($i=0; $i<=sizeof($tmp_jobfunction); $i++) {
$cur_jobfunction = $tmp_jobfunction[$i];
if ($cur_jobfunction) {
$sql_query = "SELECT * FROM setup_jobfunction WHERE jobfunction_id = '$cur_jobfunction'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$jobfunction_path = translate_path($row[jobfunction_path]);
$jobfunction_path = substr($jobfunction_path, 0, strlen($jobfunction_path) - 9);
if ($jobfunction_path) { $tmp_jobfunction_text .= "$jobfunction_path
"; }
}
}
$jobseeker_i_jobfunction = $tmp_jobfunction_text;
}
$tmp_term = explode("-", $jobseeker_i_employmentterm);
$tmp_term_text = "";
for ($i=0; $i<=sizeof($tmp_term); $i++) {
$cur_term = $tmp_term[$i];
if ($cur_term) {
$sql_query = "SELECT * FROM setup_term WHERE term_id = '$cur_term'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$term_name = $row[term_name];
if ($term_name) { $tmp_term_text .= "$term_name , "; }
}
}
$jobseeker_i_employmentterm = substr($tmp_term_text, 0, strlen($text_term) - 3);
if (strpos($jobseeker_i_joblocation, "-0-") > 0) { $jobseeker_i_joblocation = $lang[lang_value_any]; }
else {
$tmp_joblocation = explode("-", $jobseeker_i_joblocation);
$tmp_joblocation_text = "";
for ($i=0; $i<=sizeof($tmp_joblocation); $i++) {
$cur_joblocation = $tmp_joblocation[$i];
if ($cur_joblocation) {
$sql_query = "SELECT * FROM setup_joblocation WHERE joblocation_id = '$cur_joblocation'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$joblocation_name = $row[joblocation_name];
if ($joblocation_name) { $tmp_joblocation_text .= "$joblocation_name
"; }
}
}
$jobseeker_i_joblocation = $tmp_joblocation_text;
}
// get main photo ...
$sql_query = "SELECT * FROM jobseeker_photo WHERE photo_main = 'yes' AND photo_jobseeker = '$jobseeker_id' AND photo_status = 'approved'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$jobseeker_photo_found = mysql_num_rows($result);
$jobseeker_photo_id = $row[photo_id];
// get education history ...
$i = 0;
$sql_query = "
SELECT * FROM jobseeker_education
WHERE
education_jobseeker = '$jobseeker_id' AND
education_start != '' AND
education_end != '' AND
education_school != ''
ORDER BY education_start ASC
";
$result = mysql_query($sql_query) or die(mysql_error());
$education = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
if ($i % 2 == 1) { $bg_color = "FFFFFF"; }
else { $bg_color = "EAF2FF"; }
$jobseeker_e_id = $row[education_id];
$jobseeker_e_year_start = $row[education_start];
$jobseeker_e_year_end = $row[education_end];
$jobseeker_e_school = $row[education_school];
$jobseeker_e_qualification = $row[education_qualification];
$jobseeker_e_major = $row[education_major];
$jobseeker_e_gpa = $row[education_gpa];
$arr_jobseeker_e_id[$i] = $jobseeker_e_id;
$arr_jobseeker_e_year_start[$i] = $jobseeker_e_year_start;
$arr_jobseeker_e_year_end[$i] = $jobseeker_e_year_end;
$arr_jobseeker_e_school[$i] = $jobseeker_e_school;
$arr_jobseeker_e_qualification[$i] = $jobseeker_e_qualification;
$arr_jobseeker_e_major[$i] = $jobseeker_e_major;
$arr_jobseeker_e_gpa[$i] = $jobseeker_e_gpa;
$i++;
}
// get skill levels ...
$sql_query = "SELECT * FROM setup_skilllevel";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
while ($row_tmp = mysql_fetch_array($result_tmp)) {
$skilllevel_id = $row_tmp[skilllevel_id];
$skilllevel_name = $row_tmp[skilllevel_name];
$arr_skill_id[$skilllevel_id] = $skilllevel_name;
}
// get language skills ...
$i = 0;
$sql_query = "
SELECT * FROM jobseeker_language, setup_skilllanguage
WHERE
language_jobseeker = '$jobseeker_id' AND
language_name = skilllanguage_id
ORDER BY language_id ASC
";
$result = mysql_query($sql_query) or die(mysql_error());
$language = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
if ($i % 2 == 1) { $bg_color = "FFFFFF"; }
else { $bg_color = "EAF2FF"; }
$jobseeker_l_id = $row[language_id];
$jobseeker_l_name = $row[skilllanguage_name];
$jobseeker_l_reading = $row[language_reading];
$jobseeker_l_writting = $row[language_writting];
$jobseeker_l_speaking = $row[language_speaking];
$jobseeker_l_listening = $row[language_listening];
$jobseeker_l_reading = $arr_skill_id[$jobseeker_l_reading];
$jobseeker_l_writting = $arr_skill_id[$jobseeker_l_writting];
$jobseeker_l_speaking = $arr_skill_id[$jobseeker_l_speaking];
$jobseeker_l_listening = $arr_skill_id[$jobseeker_l_listening];
$arr_jobseeker_l_id[$i] = $jobseeker_l_id;
$arr_jobseeker_l_name[$i] = $jobseeker_l_name;
$arr_jobseeker_l_reading[$i] = $jobseeker_l_reading;
$arr_jobseeker_l_writting[$i] = $jobseeker_l_writting;
$arr_jobseeker_l_speaking[$i] = $jobseeker_l_speaking;
$arr_jobseeker_l_listening[$i] = $jobseeker_l_listening;
$i++;
}
// get technical skills ...
$i = 0;
$sql_query = "
SELECT * FROM jobseeker_technical , setup_skillcomputer
WHERE
technical_jobseeker = '$jobseeker_id' AND
technical_skill = skillcomputer_id
ORDER BY technical_id ASC
";
$result = mysql_query($sql_query) or die(mysql_error());
$computer = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
if ($i % 2 == 1) { $bg_color = "FFFFFF"; }
else { $bg_color = "EAF2FF"; }
$jobseeker_t_id = $row[technical_id];
$jobseeker_t_skill = $row[skillcomputer_name];
$jobseeker_t_exp = $row[technical_exp];
$jobseeker_t_level = $row[technical_level];
$jobseeker_t_level = $arr_skill_id[$jobseeker_t_level];
if (!$jobseeker_t_exp) { $jobseeker_t_exp = 0; }
$arr_jobseeker_t_id[$i] = $jobseeker_t_id;
$arr_jobseeker_t_skill[$i] = $jobseeker_t_skill;
$arr_jobseeker_t_exp[$i] = $jobseeker_t_exp;
$arr_jobseeker_t_level[$i] = $jobseeker_t_level;
$i++;
}
// get other skills ...
$i = 0;
$sql_query = "
SELECT * FROM jobseeker_other , setup_skillother
WHERE
other_jobseeker = '$jobseeker_id' AND
other_skill = skillother_id
ORDER BY other_id ASC
";
$result = mysql_query($sql_query) or die(mysql_error());
$other = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
if ($i % 2 == 1) { $bg_color = "FFFFFF"; }
else { $bg_color = "EAF2FF"; }
$jobseeker_o_id = $row[other_id];
$jobseeker_o_skill = $row[skillother_name];
$jobseeker_o_exp = $row[other_exp];
$jobseeker_o_level = $row[other_level];
$jobseeker_o_level = $arr_skill_id[$jobseeker_o_level];
if (!$jobseeker_o_exp) { $jobseeker_o_exp = 0; }
$arr_jobseeker_o_id[$i] = $jobseeker_o_id;
$arr_jobseeker_o_skill[$i] = $jobseeker_o_skill;
$arr_jobseeker_o_exp[$i] = $jobseeker_o_exp;
$arr_jobseeker_o_level[$i] = $jobseeker_o_level;
$i++;
}
// get work history ...
$sql_query = "SELECT * FROM jobseeker_workhistory WHERE history_jobseeker = '$jobseeker_id' ORDER BY history_end_present DESC, history_end DESC";
$result = mysql_query($sql_query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
if ( $i % 2 == 1 ) { $bg_color = "FFFFFF"; }
else { $bg_color = "EAF2FF"; }
$history_id = $row[history_id];
$history_jobseeker = $row[history_jobseeker];
$history_start = $row[history_start];
$history_end = $row[history_end];
$history_end_present = $row[history_end_present];
$history_company = $row[history_company];
$history_company2 = str_replace("'", "\'", $history_company);
$history_industry = $row[history_industry];
$history_jobfunction = $row[history_jobfunction];
$history_position = $row[history_position];
$history_salary = $row[history_salary];
$history_salary = "$currency_symbol " . number_format($history_salary, 2, $web_decimal_separator, $web_thousand_separator);
$history_achievement = $row[history_achievement];
$sql_query = "SELECT * FROM setup_jobfunction WHERE jobfunction_id = '$history_jobfunction'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$history_jobfunction = $row_tmp[jobfunction_name];
$sql_query = "SELECT * FROM setup_industry WHERE industry_id = '$history_industry'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$history_industry = $row_tmp[industry_name];
$history_start = str_replace(" 00:00:00", "", $history_start);
list ($yy, $mm, $dd) = split("-", $history_start);
$history_start_month = $setup_monthname[$mm * 1];
$history_start_year = $yy;
$history_start = "$history_start_month $history_start_year";
$history_end = str_replace(" 00:00:00", "", $history_end);
list ($yy, $mm, $dd) = split("-", $history_end);
$history_end_month = $setup_monthname[$mm * 1];
$history_end_year = $yy;
$history_end = "$history_end_month $history_end_year";
if ($history_end_present == "Y") { $history_end = $lang[lang_jobseeker_resume5_form_field_period_present]; }
$arr_jobseeker_o_id[$i] = $jobseeker_o_id;
$arr_jobseeker_o_skill[$i] = $jobseeker_o_skill;
$arr_jobseeker_o_exp[$i] = $jobseeker_o_exp;
$arr_jobseeker_o_level[$i] = $jobseeker_o_level;
$i++;
}
$i = 0;
$sql_query = "SELECT * FROM jobseeker_workhistory WHERE history_jobseeker = '$jobseeker_id' ORDER BY history_end_present DESC, history_end DESC";
$result = mysql_query($sql_query) or die(mysql_error());
$history = mysql_num_rows($result);
while($row = mysql_fetch_array($result)) {
if ($i % 2 == 0) { $bgcolor = "#EAF8FE"; }
else { $bgcolor = "#FFFFFF"; }
$history_id = $row[history_id];
$history_jobseeker = $row[history_jobseeker];
$history_start = $row[history_start];
$history_end = $row[history_end];
$history_end_present = $row[history_end_present];
$history_company = $row[history_company];
$history_company2 = str_replace("'", "\'", $history_company);
$history_industry = $row[history_industry];
$history_jobfunction = $row[history_jobfunction];
$history_position = $row[history_position];
$history_salary = $row[history_salary];
$history_salary = "$currency_symbol " . number_format($history_salary, 2, $web_decimal_separator, $web_thousand_separator);
$history_achievement = $row[history_achievement];
$sql_query = "SELECT * FROM setup_jobfunction WHERE jobfunction_id = '$history_jobfunction'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$history_jobfunction = $row_tmp[jobfunction_name];
$sql_query = "SELECT * FROM setup_industry WHERE industry_id = '$history_industry'";
$result_tmp = mysql_query($sql_query) or die(mysql_error());
$row_tmp = mysql_fetch_array($result_tmp);
$history_industry = $row_tmp[industry_name];
$history_start = str_replace(" 00:00:00", "", $history_start);
list ($yy, $mm, $dd) = split("-", $history_start);
$history_start_month = $setup_monthname[$mm * 1];
$history_start_year = $yy;
$history_start = "$history_start_month $history_start_year";
$history_end = str_replace(" 00:00:00", "", $history_end);
list ($yy, $mm, $dd) = split("-", $history_end);
$history_end_month = $setup_monthname[$mm * 1];
$history_end_year = $yy;
$history_end = "$history_end_month $history_end_year";
if($history_end_present == "Y") { $history_end = $lang[lang_jobseeker_resume5_form_field_period_present]; }
$arr_history_bgcolor[$i] = $bgcolor;
$arr_history_id[$i] = $history_id;
$arr_history_start[$i] = $history_start;
$arr_history_end[$i] = $history_end;
$arr_history_company[$i] = $history_company;
$arr_history_company2[$i] = $history_company2;
$arr_history_industry[$i] = $history_industry;
$arr_history_jobfunction[$i] = $history_jobfunction;
$arr_history_position[$i] = $history_position;
$arr_history_salary[$i] = $history_salary;
$arr_history_achievement[$i] = $history_achievement;
$i++;
}
// get all photo ...
$trow = 0;
$sql_query = "SELECT * FROM jobseeker_photo WHERE photo_jobseeker = '$jobseeker_id' AND photo_status = 'approved'";
$result = mysql_query($sql_query) or die(mysql_error());
$photo_found = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$photo_id = $row[photo_id];
$photo_number = $photo_id + $start_photo;
$photo_main = $row[photo_main];
$arr_photo_row_id[$trow] = $photo_id;
$arr_photo_row_number[$trow] = $photo_number;
$arr_photo_row_main[$trow] = $photo_main;
for ($tcol=0; $tcol<=3; $tcol++) {
if ($row = mysql_fetch_array($result)) {
$photo_id = $row[photo_id];
$photo_number = $photo_id + $start_photo;
$photo_main = $row[photo_main];
$arr_photo_col_id[$trow][$tcol] = $photo_id;
$arr_photo_col_number[$trow][$tcol] = $photo_number;
$arr_photo_col_main[$trow][$tcol] = $photo_main;
} // end if
} // end for
$trow++;
}
// get previous and next urls ...
$sql_query = "SELECT * FROM job_application WHERE application_job = '$job' AND application_jobseeker = '$jobseeker'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$id_current = $row[application_id];
$sql_query = "SELECT * FROM job_application WHERE application_job = '$job' AND application_id < '$id_current' ORDER BY application_id DESC";
$result = mysql_query($sql_query) or die(mysql_error());
$found_next = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$id_next = $row[application_jobseeker];
$sql_query = "SELECT * FROM job_application WHERE application_job = '$job' AND application_id > '$id_current' ORDER BY application_id ASC";
$result = mysql_query($sql_query) or die(mysql_error());
$found_previous = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$id_previous = $row[application_jobseeker];
// determine the successfull job destination page ...
$destination = "jobseeker_matches.php";
if ($employer_type == "listing" && $job_package_price > 0) { $destination = "jobseeker_matches.php"; }
// get employer email ...
$sql_query = "SELECT * FROM employer WHERE employer_id = '$job_employer'";
$result = mysql_query($sql_query) or die(mysql_error());
$row = mysql_fetch_array($result);
$employer_firstname = $row[employer_firstname];
$employer_lastname = $row[employer_lastname];
$employer_email = $row[employer_email];
// send email job_new ...
// send email job_approved ...
if ($status_email_document_new == "yes") {
$document_number = $document_id + $start_document;
$message_content = $content_document_new;
$message_content = str_replace("[employer_firstname]" , $employer_firstname , $message_content);
$message_content = str_replace("[employer_lastname]" , $employer_lastname , $message_content);
$message_content = str_replace("[job_id]" , $job_number , $message_content);
$message_content = str_replace("[job_title]" , $job_title , $message_content);
$message_content = str_replace("[jobseeker_id]" , $jobseeker_id , $message_content);
$message_content = str_replace("[jobseeker_firstname]" , $jobseeker_firstname , $message_content);
$message_content = str_replace("[jobseeker_lastname]" , $jobseeker_lastname , $message_content);
$message_content = str_replace("[jobseeker_address]" , $jobseeker_address , $message_content);
$message_content = str_replace("[jobseeker_city]" , $jobseeker_city , $message_content);
$message_content = str_replace("[jobseeker_state]" , $jobseeker_state , $message_content);
$message_content = str_replace("[jobseeker_phone]" , $jobseeker_phone , $message_content);
$message_content = str_replace("[jobseeker_cellphone]" , $jobseeker_cellphone , $message_content);
$message_content = str_replace("[jobseeker_birthdate]" , $jobseeker_birthdate , $message_content);
$message_content = str_replace("[jobseeker_country]" , $jobseeker_country , $message_content);
$message_content = str_replace("[jobseeker_gender]" , $jobseeker_gender , $message_content);
$message_content = str_replace("[jobseeker_marital]" , $jobseeker_marital , $message_content);
$message_content = str_replace("[jobseeker_race]" , $jobseeker_race , $message_content);
$message_content = str_replace("[jobseeker_fax]" , $jobseeker_fax , $message_content);
$message_content = str_replace("[jobseeker_nationality]" , $jobseeker_nationality , $message_content);
$message_content = str_replace("[jobseeker_religion]" , $jobseeker_religion , $message_content);
$message_content = str_replace("[jobseeker_address2]" , $jobseeker_address2 , $message_content);
$message_content = str_replace("[jobseeker_address]" , $jobseeker_address , $message_content);
$message_content = str_replace("[jobseeker_i_position]" , $jobseeker_i_position , $message_content);
$message_content = str_replace("[jobseeker_i_jobfunction]" , $jobseeker_i_jobfunction , $message_content);
$message_content = str_replace("[jobseeker_i_employmentterm]" , $jobseeker_i_employmentterm , $message_content);
$message_content = str_replace("[jobseeker_r_expectedsalary]" , $jobseeker_r_expectedsalary , $message_content);
$message_content = str_replace("[jobseeker_i_joblocation]" , $jobseeker_i_joblocation , $message_content);
$message_content = str_replace("[jobseeker_e_id]" , $jobseeker_e_id , $message_content);
$message_content = str_replace("[jobseeker_e_year_start]" , $jobseeker_e_year_start , $message_content);
$message_content = str_replace("[jobseeker_e_year_end]" , $jobseeker_e_year_end , $message_content);
$message_content = str_replace("[jobseeker_e_school]" , $jobseeker_e_school , $message_content);
$message_content = str_replace("[jobseeker_e_qualification]" , $jobseeker_e_qualification , $message_content);
$message_content = str_replace("[jobseeker_e_major]" , $jobseeker_e_major , $message_content);
$message_content = str_replace("[jobseeker_e_gpa]" , $jobseeker_e_gpa , $message_content);
$message_content = str_replace("[jobseeker_l_id]" , $jobseeker_l_id , $message_content);
$message_content = str_replace("[jobseeker_l_name]" , $jobseeker_l_name , $message_content);
$message_content = str_replace("[jobseeker_l_reading]" , $jobseeker_l_reading , $message_content);
$message_content = str_replace("[jobseeker_l_writting]" , $jobseeker_l_writting , $message_content);
$message_content = str_replace("[jobseeker_l_speaking]" , $jobseeker_l_speaking , $message_content);
$message_content = str_replace("[jobseeker_l_listening]" , $jobseeker_l_listening , $message_content);
$message_content = str_replace("[history_id]" , $history_id , $message_content);
$message_content = str_replace("[history_start]" , $history_start , $message_content);
$message_content = str_replace("[history_end]" , $history_end , $message_content);
$message_content = str_replace("[history_salary]" , $history_salary , $message_content);
$message_content = str_replace("[history_industry]" , $history_industry , $message_content);
$message_content = str_replace("[jobseeker_email]" , $jobseeker_email , $message_content);
$message_content = str_replace("[jobseeker_i_industry]" , $jobseeker_i_industry , $message_content);
$message_content = str_replace("[history_jobfunction]" , $history_jobfunction , $message_content);
$message_content = str_replace("[jobseeker_o_id]" , $jobseeker_o_id , $message_content);
$message_content = str_replace("[jobseeker_o_skill]" , $jobseeker_o_skill , $message_content);
$message_content = str_replace("[jobseeker_o_exp]" , $jobseeker_o_exp , $message_content);
$message_content = str_replace("[jobseeker_o_level]" , $jobseeker_o_level , $message_content);
$message_content = str_replace("[jobseeker_t_id]" , $jobseeker_t_id , $message_content);
$message_content = str_replace("[jobseeker_t_skill]" , $jobseeker_t_skill , $message_content);
$message_content = str_replace("[jobseeker_t_exp]" , $jobseeker_t_exp , $message_content);
$message_content = str_replace("[jobseeker_summary]" , $jobseeker_summary , $message_content);
$message_content = str_replace("[history_achievement]" , $history_achievement , $message_content);
$message_content = str_replace("[history_position]" , $history_position , $message_content);
$message_content = str_replace("[history_company]" , $history_company , $message_content);
$message_content = str_replace("[jobseeker_t_level]" , $jobseeker_t_level , $message_content);
$message_content = str_replace("[photo_number]" , $photo_number , $message_content);
$message_content = str_replace("[jobseeker_l_id]" , $jobseeker_l_id , $message_content);
$message_content = str_replace("[education_start]" , $education_start , $message_content);
$message_content = str_replace("[education_id]" , $education_id , $message_content);
$message_content = str_replace("[jobseeker_photo_id]" , $jobseeker_photo_id , $message_content);
$message_content = str_replace("[jobseeker_resume_file]" , $jobseeker_resume_file , $message_content);
$mail = new PHPMailer();
$mail->Host = $smtp_server;
$mail->SMTPAuth = $smtp_auth;
$mail->Username = $smtp_username;
$mail->Password = $smtp_password;
$mail->From = $web_owner_contact_email;
$mail->FromName = $web_owner_contact_name;
$mail->WordWrap = $email_wordwrap;
$mail->ClearAddresses();
$mail->AddAddress($employer_email);
$mail->IsHTML(true);
$mail->Subject = $subject_document_new;
$mail->Body = $message_content;
if ($status_email_notify_admin == "yes") { $mail->AddBCC($web_owner_contact_email); }
$mail->Send();
// print $message_content;
}
// clear session ...
if ($HTTP_POST_VARS) {
reset($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
session_unregister("c$key");
}
}
}
mysql_close($db_connect);
}
else {
setcookie("warning", $setup_demo_sorry);
if ($package) { $destination = "jobseeker_matches.php"; }
else { $destination = "jobseeker_matches.php"; }
}
mysql_close($db_connect);
setcookie("cjobs" , "" );
setcookie("caction" , "" );
setcookie("cbackurl" , "" );
setcookie("warning" , $tmp_action );
setcookie("cresponse_processed" , $processed );
}
}
}
header("Location:$destination");
?>