}
require_once dirname(__FILE__) . '/search/search.inc.php';
- $page->changeTpl('search/index.tpl');
+ $page->changeTpl('search/index.tpl');
$page->assign('xorg_title','Polytechnique.org - Annuaire');
}
$view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true));
$view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'search/adv'));
$view->apply('search/adv', $page, $action, $subaction);
-
+
if ($subaction) {
return;
}
$_REQUEST['q']);
if (!$q) exit();
- // try to look in cached results
+ // try to look in cached results
$cache = XDB::query('SELECT `result`
FROM `search_autocomplete`
WHERE `name` = {?} AND
echo $res;
die();
}
-
+
// default search
$q = preg_quote($q);
$unique = '`user_id`';
$beginwith = true;
$field2 = false;
$qsearch = $q;
-
+
switch ($type) {
case 'binetTxt':
$db = '`binets_def` INNER JOIN
$beginwith = false;
break;
case 'sectionTxt':
- $db = '`sections` INNER JOIN
+ $db = '`sections` INNER JOIN
`auth_user_md5` ON(`auth_user_md5`.`section` = `sections`.`id`)';
$field = '`sections`.`text`';
$realid = '`sections`.`id`';
echo $res;
exit();
}
-
+
function handler_list(&$page, $type = null, $idVal = null)
{
// Give the list of all values possible of type and builds a select input for it
$db = '`groupesx_def`';
break;
case 'nationalite':
- $db = '`geoloc_pays` INNER JOIN
+ $db = '`geoloc_pays` INNER JOIN
`auth_user_md5` ON (`geoloc_pays`.`a2` = `auth_user_md5`.`nationalite`)';
$field = 'IF(`nat`=\'\', `pays`, `nat`)';
$id = '`a2`';
case 'region':
$db = '`geoloc_region`';
$field = '`name`';
- $id = '`region`';
+ $id = '`region`';
if (isset($_REQUEST['country'])) {
$where .= ' WHERE `a2` = "'.$_REQUEST['country'].'"';
}