function SetUpAdvancedSearch() { global $sSrchAdvanced; // Field position $sSrchStr = ""; $GLOBALS["x_position"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_position"]) : @$_GET["x_position"]; $GLOBALS["z_position"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_position"]) : @$_GET["z_position"]; $arrFldOpr = split(",", $GLOBALS["z_position"]); if ($GLOBALS["x_position"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`position` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_position"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field salary $sSrchStr = ""; $GLOBALS["x_salary"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_salary"]) : @$_GET["x_salary"]; $GLOBALS["z_salary"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_salary"]) : @$_GET["z_salary"]; //$GLOBALS["y_salary"] = (get_magic_quotes_gpc()) ? stripslashes(@$_GET["y_salary"]) : @$_GET["y_salary"]; //$GLOBALS["w_salary"] = (get_magic_quotes_gpc()) ? stripslashes(@$_GET["w_salary"]) : @$_GET["w_salary"]; $arrFldOpr = split(",", $GLOBALS["z_salary"]); if ($GLOBALS["x_salary"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`salary` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_salary"]) . @$arrFldOpr[2] . " "; } //if ($GLOBALS["x_salary"] <> "" And is_numeric($GLOBALS["x_salary"]) And $GLOBALS["y_salary"] <> "" And is_numeric($GLOBALS["y_salary"]) And isValidOpr($arrFldOpr)) { //$sSrchStr .= "`salary` BETWEEN " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_salary"]) . @$arrFldOpr[2] . " AND " . @$arrFldOpr[1] . AdjustSql($GLOBALS["y_salary"]) . @$arrFldOpr[2] ; //} if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field location $sSrchStr = ""; $GLOBALS["x_location"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_location"]) : @$_GET["x_location"]; $GLOBALS["z_location"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_location"]) : @$_GET["z_location"]; $arrFldOpr = split(",", $GLOBALS["z_location"]); if ($GLOBALS["x_location"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`location` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_location"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } if ($sSrchAdvanced != "") { // Save settings $_SESSION[ewSessionTblAdvSrch . "_x_position"] = $GLOBALS["x_position"]; $_SESSION[ewSessionTblAdvSrch . "_x_salary"] = $GLOBALS["x_salary"]; $_SESSION[ewSessionTblAdvSrch . "_v_salary"] = $GLOBALS["v_salary"]; $_SESSION[ewSessionTblAdvSrch . "_y_salary"] = $GLOBALS["y_salary"]; $_SESSION[ewSessionTblAdvSrch . "_x_location"] = $GLOBALS["x_location"]; } }
function SetUpAdvancedSearch() { global $sSrchAdvanced; // Field uk_license $sSrchStr = ""; $GLOBALS["x_uk_license"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_uk_license"]) : @$_GET["x_uk_license"]; $GLOBALS["z_uk_license"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_uk_license"]) : @$_GET["z_uk_license"]; $arrFldOpr = split(",", $GLOBALS["z_uk_license"]); if ($GLOBALS["x_uk_license"] != "" and is_numeric($GLOBALS["x_uk_license"]) and isValidOpr($arrFldOpr)) { $sSrchStr .= "`uk_license` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_uk_license"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field european_license $sSrchStr = ""; $GLOBALS["x_european_license"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_european_license"]) : @$_GET["x_european_license"]; $GLOBALS["z_european_license"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_european_license"]) : @$_GET["z_european_license"]; $arrFldOpr = split(",", $GLOBALS["z_european_license"]); if ($GLOBALS["x_european_license"] != "" and is_numeric($GLOBALS["x_european_license"]) and isValidOpr($arrFldOpr)) { $sSrchStr .= "`european_license` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_european_license"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field marital_status $sSrchStr = ""; $GLOBALS["x_marital_status"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_marital_status"]) : @$_GET["x_marital_status"]; $GLOBALS["z_marital_status"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_marital_status"]) : @$_GET["z_marital_status"]; $arrFldOpr = split(",", $GLOBALS["z_marital_status"]); if ($GLOBALS["x_marital_status"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`marital_status` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_marital_status"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field has_dependent $sSrchStr = ""; $GLOBALS["x_has_dependent"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_has_dependent"]) : @$_GET["x_has_dependent"]; $GLOBALS["z_has_dependent"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_has_dependent"]) : @$_GET["z_has_dependent"]; $arrFldOpr = split(",", $GLOBALS["z_has_dependent"]); if ($GLOBALS["x_has_dependent"] != "" and is_numeric($GLOBALS["x_has_dependent"]) and isValidOpr($arrFldOpr)) { $sSrchStr .= "`has_dependent` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_has_dependent"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field can_relocate $sSrchStr = ""; $GLOBALS["x_can_relocate"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_can_relocate"]) : @$_GET["x_can_relocate"]; $GLOBALS["z_can_relocate"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_can_relocate"]) : @$_GET["z_can_relocate"]; $arrFldOpr = split(",", $GLOBALS["z_can_relocate"]); if ($GLOBALS["x_can_relocate"] != "" and is_numeric($GLOBALS["x_can_relocate"]) and isValidOpr($arrFldOpr)) { $sSrchStr .= "`can_relocate` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_can_relocate"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field can_travel $sSrchStr = ""; $GLOBALS["x_can_travel"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_can_travel"]) : @$_GET["x_can_travel"]; $GLOBALS["z_can_travel"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_can_travel"]) : @$_GET["z_can_travel"]; $arrFldOpr = split(",", $GLOBALS["z_can_travel"]); if ($GLOBALS["x_can_travel"] != "" and is_numeric($GLOBALS["x_can_travel"]) and isValidOpr($arrFldOpr)) { $sSrchStr .= "`can_travel` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_can_travel"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field employement_status $sSrchStr = ""; $GLOBALS["x_employement_status"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_employement_status"]) : @$_GET["x_employement_status"]; $GLOBALS["z_employement_status"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_employement_status"]) : @$_GET["z_employement_status"]; $arrFldOpr = split(",", $GLOBALS["z_employement_status"]); if ($GLOBALS["x_employement_status"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`employement_status` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_employement_status"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field position_held $sSrchStr = ""; $GLOBALS["x_position_held"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_position_held"]) : @$_GET["x_position_held"]; $GLOBALS["z_position_held"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_position_held"]) : @$_GET["z_position_held"]; $arrFldOpr = split(",", $GLOBALS["z_position_held"]); if ($GLOBALS["x_position_held"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`position_held` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_position_held"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field salary $sSrchStr = ""; $GLOBALS["x_salary"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_salary"]) : @$_GET["x_salary"]; $GLOBALS["z_salary"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_salary"]) : @$_GET["z_salary"]; $arrFldOpr = split(",", $GLOBALS["z_salary"]); if ($GLOBALS["x_salary"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`salary` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_salary"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field salary_expectation_start $sSrchStr = ""; $GLOBALS["x_salary_expectation_start"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_salary_expectation_start"]) : @$_GET["x_salary_expectation_start"]; $GLOBALS["z_salary_expectation_start"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_salary_expectation_start"]) : @$_GET["z_salary_expectation_start"]; $arrFldOpr = split(",", $GLOBALS["z_salary_expectation_start"]); if ($GLOBALS["x_salary_expectation_start"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`salary_expectation_start` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_salary_expectation_start"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field salary_expectation_one $sSrchStr = ""; $GLOBALS["x_salary_expectation_one"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_salary_expectation_one"]) : @$_GET["x_salary_expectation_one"]; $GLOBALS["z_salary_expectation_one"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_salary_expectation_one"]) : @$_GET["z_salary_expectation_one"]; $arrFldOpr = split(",", $GLOBALS["z_salary_expectation_one"]); if ($GLOBALS["x_salary_expectation_one"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`salary_expectation_one` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_salary_expectation_one"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field salary_expectation_two $sSrchStr = ""; $GLOBALS["x_salary_expectation_two"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_salary_expectation_two"]) : @$_GET["x_salary_expectation_two"]; $GLOBALS["z_salary_expectation_two"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_salary_expectation_two"]) : @$_GET["z_salary_expectation_two"]; $arrFldOpr = split(",", $GLOBALS["z_salary_expectation_two"]); if ($GLOBALS["x_salary_expectation_two"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`salary_expectation_two` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_salary_expectation_two"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field achievement_sales $sSrchStr = ""; $GLOBALS["x_achievement_sales"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_achievement_sales"]) : @$_GET["x_achievement_sales"]; $GLOBALS["z_achievement_sales"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_achievement_sales"]) : @$_GET["z_achievement_sales"]; $arrFldOpr = split(",", $GLOBALS["z_achievement_sales"]); if ($GLOBALS["x_achievement_sales"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`achievement_sales` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_achievement_sales"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field achievement_food $sSrchStr = ""; $GLOBALS["x_achievement_food"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_achievement_food"]) : @$_GET["x_achievement_food"]; $GLOBALS["z_achievement_food"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_achievement_food"]) : @$_GET["z_achievement_food"]; $arrFldOpr = split(",", $GLOBALS["z_achievement_food"]); if ($GLOBALS["x_achievement_food"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`achievement_food` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_achievement_food"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field achievement_labour $sSrchStr = ""; $GLOBALS["x_achievement_labour"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_achievement_labour"]) : @$_GET["x_achievement_labour"]; $GLOBALS["z_achievement_labour"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_achievement_labour"]) : @$_GET["z_achievement_labour"]; $arrFldOpr = split(",", $GLOBALS["z_achievement_labour"]); if ($GLOBALS["x_achievement_labour"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`achievement_labour` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_achievement_labour"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } // Field notice $sSrchStr = ""; $GLOBALS["x_notice"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["x_notice"]) : @$_GET["x_notice"]; $GLOBALS["z_notice"] = get_magic_quotes_gpc() ? stripslashes(@$_GET["z_notice"]) : @$_GET["z_notice"]; $arrFldOpr = split(",", $GLOBALS["z_notice"]); if ($GLOBALS["x_notice"] != "" and isValidOpr($arrFldOpr)) { $sSrchStr .= "`notice` " . $arrFldOpr[0] . " " . @$arrFldOpr[1] . AdjustSql($GLOBALS["x_notice"]) . @$arrFldOpr[2] . " "; } if ($sSrchStr != "") { if ($sSrchAdvanced != "") { $sSrchAdvanced .= " AND "; } $sSrchAdvanced .= "(" . $sSrchStr . ")"; } if ($sSrchAdvanced != "") { // Save settings $_SESSION[ewSessionTblAdvSrch . "_x_uk_license"] = $GLOBALS["x_uk_license"]; $_SESSION[ewSessionTblAdvSrch . "_x_european_license"] = $GLOBALS["x_european_license"]; $_SESSION[ewSessionTblAdvSrch . "_x_marital_status"] = $GLOBALS["x_marital_status"]; $_SESSION[ewSessionTblAdvSrch . "_x_has_dependent"] = $GLOBALS["x_has_dependent"]; $_SESSION[ewSessionTblAdvSrch . "_x_can_relocate"] = $GLOBALS["x_can_relocate"]; $_SESSION[ewSessionTblAdvSrch . "_x_can_travel"] = $GLOBALS["x_can_travel"]; $_SESSION[ewSessionTblAdvSrch . "_x_employement_status"] = $GLOBALS["x_employement_status"]; $_SESSION[ewSessionTblAdvSrch . "_x_position_held"] = $GLOBALS["x_position_held"]; $_SESSION[ewSessionTblAdvSrch . "_x_salary"] = $GLOBALS["x_salary"]; $_SESSION[ewSessionTblAdvSrch . "_x_salary_expectation_start"] = $GLOBALS["x_salary_expectation_start"]; $_SESSION[ewSessionTblAdvSrch . "_x_salary_expectation_one"] = $GLOBALS["x_salary_expectation_one"]; $_SESSION[ewSessionTblAdvSrch . "_x_salary_expectation_two"] = $GLOBALS["x_salary_expectation_two"]; $_SESSION[ewSessionTblAdvSrch . "_x_achievement_sales"] = $GLOBALS["x_achievement_sales"]; $_SESSION[ewSessionTblAdvSrch . "_x_achievement_food"] = $GLOBALS["x_achievement_food"]; $_SESSION[ewSessionTblAdvSrch . "_x_achievement_labour"] = $GLOBALS["x_achievement_labour"]; $_SESSION[ewSessionTblAdvSrch . "_x_notice"] = $GLOBALS["x_notice"]; } }