Subversion Repositories eFlore/Applications.coel

Rev

Rev 1704 | Rev 1730 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1704 Rev 1721
Line 272... Line 272...
272
 
272
 
273
        // par défaut, spécifier un département restreint à la France
273
        // par défaut, spécifier un département restreint à la France
274
        // TODO: INNER JOIN
274
        // TODO: INNER JOIN
275
		if (isset($p['str-d'])) {
275
		if (isset($p['str-d'])) {
276
            $join[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_pays';
276
            $join[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_pays';
277
			$where[] = 'cv.cmlv_abreviation = "FR"';
277
			$where[] = "cv.cmlv_abreviation IN ('FR', 'RE', 'YT', 'GP', 'MQ', 'GF', 'NC')";
278
			$where[] = sprintf("cs_code_postal REGEXP '^(%s).*'", implode('|', $p['str-d']));
278
			$where[] = sprintf("cs_code_postal REGEXP '^(%s).*'", implode('|', $p['str-d']));
Line 279... Line 279...
279
		}
279
		}
280
 
280
 
281
        // http://download.geonames.org/export/dump/admin1CodesASCII.txt
281
        // http://download.geonames.org/export/dump/admin1CodesASCII.txt
282
		if (isset($p['regions'])) {
282
		if (isset($p['regions'])) {
283
            $join[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_region';
283
            $join[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_region';
Line 284... Line 284...
284
			$where[] = sprintf('cv.cmlv_abreviation IN ("%s")', implode('","', $p['regions']));
284
			$where[] = sprintf('cv.cmlv_abreviation IN ("%s")', implode('","', $p['regions']));
-
 
285
		}
285
		}
286
 
286
 
287
		if (isset($p['pays'])) {
287
		if (isset($p['pays'])) {
288
            if(array_search('FR', $p['pays']) !== FALSE) $p['pays'] = array_merge($p['pays'], array('RE','YT','GP','MQ','GF','NC'));
Line 288... Line 289...
288
            $join[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_pays';
289
            $join[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_pays';