Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1835 Rev 2143
Line 642... Line 642...
642
	}
642
	}
Line 643... Line 643...
643
 
643
 
644
	static function referenceTableExiste() {
644
	static function referenceTableExiste() {
645
		if(!self::$is_table) {
645
		if (!self::$is_table) {
646
			// une seule fois
646
			// une seule fois
647
			if(! Cel::db()->executerRequete("SHOW TABLES LIKE 'cel_references'", Cel::SQL_RETOUR_LIGNE)) return FALSE;
647
			if (! Cel::db()->requeterLigne("SHOW TABLES LIKE 'cel_references'")) return FALSE;
648
			self::$is_table = TRUE;
648
			self::$is_table = TRUE;
649
		}
649
		}
650
		return TRUE;
650
		return TRUE;
Line 664... Line 664...
664
			// XXX: problème de valeurs NULL ?
664
			// XXX: problème de valeurs NULL ?
665
			if(array_key_exists($cache_id, self::$cache['getNomCommun'])) return self::$cache['getNomCommun'][$cache_id];
665
			if(array_key_exists($cache_id, self::$cache['getNomCommun'])) return self::$cache['getNomCommun'][$cache_id];
666
		}
666
		}
Line 667... Line 667...
667
 
667
 
668
		// pas de cache:
668
		// pas de cache:
669
		$nom = Cel::db()->executerRequete(sprintf("SELECT nom_commun FROM cel_references " .
669
		$nom = Cel::db()->requeterLigne(sprintf("SELECT nom_commun FROM cel_references " .
670
												  "WHERE referentiel = '%s' AND num_taxon = %d LIMIT 1",
670
												  "WHERE referentiel = '%s' AND num_taxon = %d LIMIT 1",
671
												  $referentiel,
671
												  $referentiel,
672
												  $obs['nt']),
-
 
Line 673... Line 672...
673
										  Cel::SQL_RETOUR_LIGNE);
672
												  $obs['nt']));
674
 
673
 
Line 675... Line 674...
675
		if(! $nom) return NULL;
674
		if(! $nom) return NULL;
Line 727... Line 726...
727
			$ligne = array_merge($ligne, self::$cache['getBaseflor'][$cache_id]);
726
			$ligne = array_merge($ligne, self::$cache['getBaseflor'][$cache_id]);
728
			return;
727
			return;
729
		}
728
		}
Line 730... Line 729...
730
 
729
 
731
		// pas de cache:
730
		// pas de cache:
732
		$data = Cel::db()->executerRequete(sprintf("SELECT %s FROM cel_references " .
731
		$data = Cel::db()->requeterLigne(sprintf("SELECT %s FROM cel_references " .
733
											 "WHERE referentiel = '%s' AND num_nom_retenu = %d LIMIT 1",
732
											 "WHERE referentiel = '%s' AND num_nom_retenu = %d LIMIT 1",
734
											 implode(', ', array_keys(self::$baseflor_col)),
733
											 implode(', ', array_keys(self::$baseflor_col)),
735
											 $referentiel,
734
											 $referentiel,
736
											 $obs['nom_ret_nn']),
-
 
Line 737... Line 735...
737
									 Cel::SQL_RETOUR_LIGNE);
735
											 $obs['nom_ret_nn']));
738
 
736
 
739
		if(! $data) {
737
		if(! $data) {
740
			$ligne = array_merge($ligne, array_fill(0, count(self::$baseflor_col), NULL));
738
			$ligne = array_merge($ligne, array_fill(0, count(self::$baseflor_col), NULL));