| Line 30... |
Line 30... |
| 30 |
define('_COSTE_TEXTE_MAX_COSTE_PAGE', 4126);
|
30 |
define('_COSTE_TEXTE_MAX_COSTE_PAGE', 4126);
|
| 31 |
// SELECT MAX(tome) FROM coste_v2_00;
|
31 |
// SELECT MAX(tome) FROM coste_v2_00;
|
| 32 |
define('_COSTE_TEXTE_MAX_COSTE_TOME', 3);
|
32 |
define('_COSTE_TEXTE_MAX_COSTE_TOME', 3);
|
| 33 |
// SELECT MAX(num_taxonomique) FROM coste_v2_00;
|
33 |
// SELECT MAX(num_taxonomique) FROM coste_v2_00;
|
| 34 |
define('_COSTE_TEXTE_MAX_BDTFX_NT', 37809);
|
34 |
define('_COSTE_TEXTE_MAX_BDTFX_NT', 37809);
|
| 35 |
// SELECT MAX(num_nom) FROM bdtfx_v1_02;
|
35 |
// SELECT MAX(num_nom) FROM bdtfx_v2_00;
|
| 36 |
define('_COSTE_TEXTE_MAX_BDTFX_NN', 103386 + 10000);
|
36 |
define('_COSTE_TEXTE_MAX_BDTFX_NN', 120816 + 100000);
|
| Line 37... |
Line 37... |
| 37 |
|
37 |
|
| 38 |
/* restore_error_handler();
|
38 |
/* restore_error_handler();
|
| 39 |
error_reporting(E_ALL); */
|
39 |
error_reporting(E_ALL); */
|
| 40 |
class Textes {
|
40 |
class Textes {
|
| Line 175... |
Line 175... |
| 175 |
$res2[$v[$clef_index]] = $v;
|
175 |
$res2[$v[$clef_index]] = $v;
|
| 176 |
}
|
176 |
}
|
| Line 177... |
Line 177... |
| 177 |
|
177 |
|
| 178 |
// l'appelant s'occupera du json_encode()
|
178 |
// l'appelant s'occupera du json_encode()
|
| 179 |
// même si ça démange d'exit'er ici
|
179 |
// même si ça démange d'exit'er ici
|
| 180 |
header("Content-Type: application/json; charset=utf-8");
|
180 |
if(strpos($_SERVER['SCRIPT_NAME'], 'phpunit') === FALSE) header("Content-Type: application/json; charset=utf-8");
|
| 181 |
return array('entete' => array(
|
181 |
return array('entete' => array(
|
| 182 |
'depart' => $params['navigation.depart'],
|
182 |
'depart' => $params['navigation.depart'],
|
| 183 |
'limite' => $params['navigation.limite'],
|
183 |
'limite' => $params['navigation.limite'],
|
| 184 |
'total' => count($res2),
|
184 |
'total' => count($res2),
|
| Line 343... |
Line 343... |
| 343 |
$j = '';
|
343 |
$j = '';
|
| 344 |
// ces tests doivent correspondre aux champs générés par sqlSelectFields()
|
344 |
// ces tests doivent correspondre aux champs générés par sqlSelectFields()
|
| 345 |
// ou contraintes générées par sqlAddConstraint()
|
345 |
// ou contraintes générées par sqlAddConstraint()
|
| 346 |
if(array_key_exists('masque.famille', $params) ||
|
346 |
if(array_key_exists('masque.famille', $params) ||
|
| 347 |
array_key_exists('famille', $champs)) {
|
347 |
array_key_exists('famille', $champs)) {
|
| 348 |
$j .= 'LEFT JOIN tb_eflore.bdtfx_v1_02 b ON c.flore_bdtfx_nn = b.num_nom';
|
348 |
$j .= 'LEFT JOIN tb_eflore.bdtfx_v2_00 b ON c.flore_bdtfx_nn = b.num_nom';
|
| 349 |
}
|
349 |
}
|
| Line 350... |
Line 350... |
| 350 |
|
350 |
|
| 351 |
return $j;
|
351 |
return $j;
|
| Line 383... |
Line 383... |
| 383 |
|
383 |
|
| 384 |
if(isset($params['masque.ns'])) $p['masque.ns'] = trim($params['masque.ns']);
|
384 |
if(isset($params['masque.ns'])) $p['masque.ns'] = trim($params['masque.ns']);
|
| Line 385... |
Line 385... |
| 385 |
if(isset($params['masque.texte'])) $p['masque.texte'] = trim($params['masque.texte']);
|
385 |
if(isset($params['masque.texte'])) $p['masque.texte'] = trim($params['masque.texte']);
|
| 386 |
|
386 |
|
| 387 |
if(isset($params['masque.famille'])) {
|
387 |
if(isset($params['masque.famille'])) {
|
| 388 |
// mysql -N<<<"SELECT DISTINCT famille FROM bdtfx_v1_02;"|sed -r "s/(.)/\1\n/g"|sort -u|tr -d "\n"
|
388 |
// mysql -N<<<"SELECT DISTINCT famille FROM bdtfx_v2_00;"|sed -r "s/(.)/\1\n/g"|sort -u|tr -d "\n"
|
| 389 |
$p['masque.famille'] = preg_replace('/[^a-zA-Z %_]/', '', iconv("UTF-8",
|
389 |
$p['masque.famille'] = preg_replace('/[^a-zA-Z %_]/', '', iconv("UTF-8",
|
| 390 |
"ASCII//TRANSLIT",
|
390 |
"ASCII//TRANSLIT",
|
| Line 435... |
Line 435... |
| 435 |
static function requestFilterIds($uri) {
|
435 |
static function requestFilterIds($uri) {
|
| 436 |
if(count($uri) != 1) return NULL;
|
436 |
if(count($uri) != 1) return NULL;
|
| Line 437... |
Line 437... |
| 437 |
|
437 |
|
| 438 |
// getNN* renvoient le num_nom passé comme segment d'URI:
|
438 |
// getNN* renvoient le num_nom passé comme segment d'URI:
|
| 439 |
// - soit un id selon coste (num_nom dans coste_v2_00)
|
439 |
// - soit un id selon coste (num_nom dans coste_v2_00)
|
| 440 |
// - soit un id selon bdtfx (num_nom dans bdtfx_v1_02)
|
440 |
// - soit un id selon bdtfx (num_nom dans bdtfx_v2_00)
|
| 441 |
// ou bien l'extrait du pattern bdtfx.nn:(#id)
|
441 |
// ou bien l'extrait du pattern bdtfx.nn:(#id)
|
| 442 |
$ids_coste = array_filter(array_map(array(__CLASS__, 'getNNCoste'), explode(',', $uri[0])));
|
442 |
$ids_coste = array_filter(array_map(array(__CLASS__, 'getNNCoste'), explode(',', $uri[0])));
|
| Line 443... |
Line 443... |
| 443 |
$ids_bdtfx = array_filter(array_map(array(__CLASS__, 'getNNBdtfx'), explode(',', $uri[0])));
|
443 |
$ids_bdtfx = array_filter(array_map(array(__CLASS__, 'getNNBdtfx'), explode(',', $uri[0])));
|