- $wp = new PlWikiPage('Docs.Emploi');
- $wp->buildCache();
-
- $page->setTitle('Conseil Pro');
-
- // Retrieval of sector names
- $res = XDB::iterRow("SELECT id, name AS label
- FROM profile_job_sector_enum");
- $sectors[''] = '';
- while (list($tmp_id, $tmp_label) = $res->next()) {
- $sectors[$tmp_id] = $tmp_label;
- }
- $page->assign_by_ref('sectors', $sectors);
-
- // nb de mentors
- $res = XDB::query("SELECT count(*) FROM profile_mentor");
- $page->assign('mentors_number', $res->fetchOneCell());
-
- // On vient d'un formulaire
- $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 ($subSectorSelection != "''") {
- $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);
- $set->addMod('mentor', 'Référents');
- $set->apply('referent/search', $page, $action, $subaction);
- if ($set->count() > 100) {
- $page->assign('recherche_trop_large', true);
- }
- }
- $page->changeTpl('profile/referent.tpl');
- }
-
- function handler_ref_sect(&$page, $sect)
- {
- header('Content-Type: text/html; charset=utf-8');
- $page->changeTpl('include/field.select.tpl', NO_SKIN);
- $page->assign('onchange', 'setSSectors()');
- $page->assign('id', 'ssect_field');
- $page->assign('name', 'subSector');
- $it = XDB::iterator("SELECT id, name AS field
- FROM profile_job_subsector_enum
- WHERE sectorid = {?}", $sect);
- $page->assign('list', $it);
- }
-
- function handler_ref_country(&$page, $sect, $ssect = '')
- {
- header('Content-Type: text/html; charset=utf-8');