- $where = array();
- $pays_sel = XDB::escape(Env::v('pays_sel'));
- $sectorSelection = XDB::escape(Env::v('sector'));
- $subSectorSelection = XDB::escape(Env::v('subSector'));
- $expertise_champ = XDB::escape(Env::v('expertise'));
-
- if ($pays_sel != "''") {
- $where[] = "mp.country = $pays_sel";
- }
- if ($sectorSelection != "''") {
- $where[] = "ms.sectorid = " . $sectorSelection;
- if ($selectedSubSector != "''") {
- $where[] = "ms.subsectorid = " . $subSectorSelection;
- }
- }
- if ($expertise_champ != "''") {
- $where[] = "MATCH(m.expertise) AGAINST($expertise_champ)";
- }
-
- if ($where) {
- $where = join(' AND ', $where);
-
- $set = new UserSet("INNER JOIN profile_mentor AS m ON (m.uid = u.user_id)
- LEFT JOIN profile_mentor_country AS mp ON (mp.uid = m.uid)
- LEFT JOIN profile_mentor_sector AS ms ON (ms.uid = m.uid)",
- $where);
+ require_once 'ufbuilder.inc.php';
+ $ufb = new UFB_MentorSearch();
+ if (!$ufb->isEmpty()) {
+ require_once 'userset.inc.php';
+ $ufc = $ufb->getUFC();
+ $set = new ProfileSet($ufc);