Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 605 Rev 738
Line 50... Line 50...
50
 
50
 
51
		     	$value=array($row['nom_sel'],$row['num_nom_sel'],$row['nom_ret'],$row['num_nom_ret'],$row['num_taxon'],$row['famille'], $row['location'], $row['id_location'], $row['ordre'], $row['date_observation'],$row['lieudit'], $row['station'], $row['milieu'], $row['commentaire'], $row['coord_x'],$row['coord_y']);
51
		     	$value=array($row['nom_sel'],$row['num_nom_sel'],$row['nom_ret'],$row['num_nom_ret'],$row['num_taxon'],$row['famille'], $row['location'], $row['id_location'], $row['ordre'], $row['date_observation'],$row['lieudit'], $row['station'], $row['milieu'], $row['commentaire'], $row['coord_x'],$row['coord_y']);
Line 52... Line 52...
52
    	    }
52
    	    }
-
 
53
 
-
 
54
			$output = json_encode($value);
53
 
55
			
Line 54... Line 56...
54
			$output = json_encode($value);
56
			header("Content-type: application/json");
Line 177... Line 179...
177
 
179
 
178
 
180
 
179
			 // Controle detournement utilisateur
181
			 // Controle detournement utilisateur
-
 
182
			    session_start();
-
 
183
			 	$this->controleUtilisateur($pairs['identifiant']);
-
 
184
			 	
-
 
185
			 					
-
 
186
				if (($pairs['num_nom_sel'] == '' || $pairs['num_nom_sel'] == 0) && $pairs['nom_sel'] != '') {
-
 
187
 
-
 
188
					// Utilisation d'un nom sans numéro nomenclatural, recherche d'une correspondance sur le nom
-
 
189
					$complement=$this->rechercherInformationsComplementairesSurNom($pairs['nom_sel']);
-
 
190
 
-
 
191
					// Si l'on a trouvé un résultat sur la recherche, il s'agit vraisemblablement d'un copié-collé
-
 
192
					// de nom de taxon qui n'a pas été validé par la selection
-
 
193
					if(count($complement) > 0) {
-
 
194
						$pairs['num_nom_sel'] = $complement[0][0];
Line 180... Line -...
180
			    session_start();
-
 
181
			 	$this->controleUtilisateur($pairs['identifiant']);
-
 
182
 
-
 
183
				if ($pairs['num_nom_sel']!='') {
-
 
184
 
-
 
185
 
195
					}
Line -... Line 196...
-
 
196
					
-
 
197
 
-
 
198
				}
186
 
199
 
Line 187... Line 200...
187
				// Utilisation d'un nom faisant parti du referentiel : recherche du nom valide correspondant
200
				if ($pairs['num_nom_sel']!='') {
188
 
201
					
189
 
202
					// Utilisation d'un nom faisant parti du referentiel : recherche du nom valide correspondant
190
					$complement=$this->rechercherInformationsComplementaires($pairs['num_nom_sel']);
203
					$complement=$this->rechercherInformationsComplementaires($pairs['num_nom_sel']);
Line 191... Line 204...
191
 
204
 
Line 192... Line -...
192
 
-
 
193
			        $pairs['nom_ret']=$complement['Nom_Retenu'];
-
 
194
			        $pairs['num_nom_ret']=$complement['Num_Nom_Retenu'];
205
 
Line 195... Line 206...
195
			        $pairs['num_taxon']=$complement['Num_Taxon'];
206
			        $pairs['nom_ret']=$complement['Nom_Retenu'];
196
			        $pairs['famille']=$complement['Famille'];
207
			        $pairs['num_nom_ret']=$complement['Num_Nom_Retenu'];
Line 385... Line 396...
385
 
396
 
Line 386... Line 397...
386
	    }
397
	    }
Line -... Line 398...
-
 
398
 
387
 
399
	    return $value;
-
 
400
 
-
 
401
	}
-
 
402
	
-
 
403
	function rechercherInformationsComplementairesSurNom($nom_saisi) {
-
 
404
		
-
 
405
		$DB=$this->connectDB($this->config);
-
 
406
		
-
 
407
		$value = array();
-
 
408
		
-
 
409
		if($nom_saisi != null && $nom_saisi != "") { 
-
 
410
		
-
 
411
			$query = 'SELECT * FROM eflore_nom_intitule '.
-
 
412
			'WHERE eni_id_categorie_format = 3 AND '.
-
 
413
			'eni_id_version_projet_nom = 25 AND '.
-
 
414
			'(eni_id_valeur_format = 3 OR eni_id_valeur_format = 4) AND '.
-
 
415
			'eni_intitule_nom LIKE "'.$nom_saisi.'%" '.
-
 
416
			'ORDER BY LENGTH(eni_intitule_nom)';
-
 
417
			
-
 
418
			$res =& $DB->query($query);
-
 
419
			    
-
 
420
			    
-
 
421
	        if (DB::isError($res)) {
-
 
422
    	        die($res->getMessage());
-
 
423
        	}
-
 
424
        	
-
 
425
	        while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) {
-
 
426
	        	$value[]=array($row['eni_id_nom'], $row['eni_intitule_nom']);
388
	    return $value;
427
    	    
-
 
428
	        }
389
 
429
		}
Line 390... Line 430...
390
 
430