Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2131 Rev 2163
Line 95... Line 95...
95
class CelTaxonNomFrom {
95
class CelTaxonNomFrom {
96
  const db = 'tb_eflore';
96
  const db = 'tb_eflore';
97
  const bdtfx = 'bdtfx_v2_00';
97
  const bdtfx = 'bdtfx_v2_00';
98
  const bdtxa = 'bdtxa_v1_01';
98
  const bdtxa = 'bdtxa_v1_01';
99
  const isfan = 'isfan_v2013';
99
  const isfan = 'isfan_v2013';
100
  const bdtao = 'bdtao_v1_00';
100
  const apd = 'apd_v1_00';
Line 101... Line 101...
101
 
101
 
102
  // get from num_nom(_sel)
102
  // get from num_nom(_sel)
103
  static function NN($db, $id, $ref) {
103
  static function NN($db, $id, $ref) {
104
	if(!$db || !$id || !$ref) return FALSE;
104
	if(!$db || !$id || !$ref) return FALSE;
Line 129... Line 129...
129
	  return $db->query(sprintf("SELECT o.num_nom_retenu AS nom_ret_nn, o.num_taxonomique AS nt, CONCAT(o.nom_sci, ' ', o.auteur) AS nom_sel".
129
	  return $db->query(sprintf("SELECT o.num_nom_retenu AS nom_ret_nn, o.num_taxonomique AS nt, CONCAT(o.nom_sci, ' ', o.auteur) AS nom_sel".
130
								" , o.famille, CONCAT(ret.nom_sci, ' ', ret.auteur) AS nom_ret".
130
								" , o.famille, CONCAT(ret.nom_sci, ' ', ret.auteur) AS nom_ret".
131
								" FROM %s.%s o".
131
								" FROM %s.%s o".
132
								" LEFT JOIN %s.%s ret ON o.num_nom_retenu != 0 AND o.num_nom_retenu = ret.num_nom".
132
								" LEFT JOIN %s.%s ret ON o.num_nom_retenu != 0 AND o.num_nom_retenu = ret.num_nom".
133
								" WHERE o.num_nom = %d -- %s:%d", self::db, self::isfan,  self::db, self::isfan, intval($id), __FILE__, __LINE__))->fetch(PDO::FETCH_ASSOC);
133
								" WHERE o.num_nom = %d -- %s:%d", self::db, self::isfan,  self::db, self::isfan, intval($id), __FILE__, __LINE__))->fetch(PDO::FETCH_ASSOC);
134
	case "bdtao":
134
	case "apd":
135
	  return $db->query(sprintf("SELECT o.num_nom_retenu AS nom_ret_nn, o.num_taxonomique AS nt, CONCAT(o.nom_sci, ' ', o.auteur) AS nom_sel".
135
	  return $db->query(sprintf("SELECT o.num_nom_retenu AS nom_ret_nn, o.num_taxonomique AS nt, CONCAT(o.nom_sci, ' ', o.auteur) AS nom_sel".
136
								" , o.famille, CONCAT(ret.nom_sci, ' ', ret.auteur) AS nom_ret".
136
								" , o.famille, CONCAT(ret.nom_sci, ' ', ret.auteur) AS nom_ret".
137
								" FROM %s.%s o".
137
								" FROM %s.%s o".
138
								" LEFT JOIN %s.%s ret ON o.num_nom_retenu != 0 AND o.num_nom_retenu = ret.num_nom".
138
								" LEFT JOIN %s.%s ret ON o.num_nom_retenu != 0 AND o.num_nom_retenu = ret.num_nom".
139
								" WHERE o.num_nom = %d -- %s:%d", self::db, self::bdtao,  self::db, self::bdtao, intval($id), __FILE__, __LINE__))->fetch(PDO::FETCH_ASSOC);
139
								" WHERE o.num_nom = %d -- %s:%d", self::db, self::apd,  self::db, self::apd, intval($id), __FILE__, __LINE__))->fetch(PDO::FETCH_ASSOC);
140
	}
140
	}
141
	return FALSE;
141
	return FALSE;
142
  }
142
  }
143
}
143
}