Subversion Repositories Sites.obs-saisons.fr

Rev

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

Rev 246 Rev 248
Line 277... Line 277...
277
    public function getExportStation() {
277
    public function getExportStation() {
Line 278... Line 278...
278
    	
278
    	
279
    	$requete_selection_stations = 'SELECT * FROM ods_stations '.
279
    	$requete_selection_stations = 'SELECT * FROM ods_stations '.
280
    								  ' LEFT JOIN ods_individus '.
280
    								  ' LEFT JOIN ods_individus '.
281
    								  ' ON ods_individus.oi_ce_station = ods_stations.os_id_station '.
281
    								  ' ON ods_individus.oi_ce_station = ods_stations.os_id_station '.
Line 282... Line 282...
282
    								  ' ORDER BY ods_stations.os_id_station, ods_individus.oi_ce_espece ';
282
    								  ' ORDER BY ods_stations.os_id_station, ods_individus.oi_ce_espece';
Line 283... Line 283...
283
    								  
283
    								  
284
 		$res_selection_stations = $this->executerRequete($requete_selection_stations);
284
 		$res_selection_stations = $this->executerRequete($requete_selection_stations);
Line 296... Line 296...
296
		
296
		
Line 297... Line 297...
297
		$resultats_formates = array();
297
		$resultats_formates = array();
Line -... Line 298...
-
 
298
		
298
		
299
		foreach($tableau_stations_infos as &$stations_infos) {
299
		foreach($tableau_stations_infos as &$stations_infos) {
300
			
-
 
301
			if(!isset($resultats_formates[$stations_infos['os_id_station']])) {
-
 
302
				if($stations_infos['os_ce_commune'] == "NULL") {
-
 
303
					$stations_infos['os_ce_commune'] = '';
-
 
304
				}
-
 
305
				
-
 
306
				$resultats_formates[$stations_infos['os_id_station']] = array(
-
 
307
					'station' => $stations_infos['os_nom'],
-
 
308
					'code_commune' => $stations_infos['os_ce_commune'],
-
 
309
					'nom_commune' => '',
-
 
310
					'latitude' => $stations_infos['os_latitude'],
-
 
311
					'longitude' => $stations_infos['os_longitude'],
-
 
312
					'altitude' => $stations_infos['os_altitude'],
-
 
313
					'id_participant' => $stations_infos['os_ce_participant'],
-
 
314
					'pseudo_participant' => '',
-
 
315
					'mail_participant' => '',
-
 
316
					'especes' => array()
-
 
317
				);
-
 
318
				
300
			
319
				if(is_numeric($stations_infos['os_ce_commune'])) {
Line 301... Line -...
301
			if($stations_infos['os_ce_commune'] == "NULL") {
-
 
302
				$stations_infos['os_ce_commune'] = '';
-
 
303
			}
-
 
304
			
-
 
305
			$resultats_formates[$stations_infos['os_id_station']] = array(
-
 
306
				'station' => $stations_infos['os_nom'],
-
 
307
				'code_commune' => $stations_infos['os_ce_commune'],
-
 
308
				'nom_commune' => '',
-
 
309
				'latitude' => $stations_infos['os_latitude'],
-
 
310
				'longitude' => $stations_infos['os_longitude'],
-
 
311
				'altitude' => $stations_infos['os_altitude'],
-
 
312
				'id_participant' => $stations_infos['os_ce_participant'],
-
 
313
				'pseudo_participant' => '',
320
					$codes_insee_communes[] = $stations_infos['os_ce_commune'];
314
				'mail_participant' => ''
-
 
315
			);
-
 
316
			
-
 
317
			$infos_espece = $especes[$stations_infos['oi_ce_espece']];
-
 
318
			if($infos_espece['type'] != "") {
-
 
Line 319... Line 321...
319
				$infos_espece['type'] = $this->obtenirValeurTripleParId($infos_espece['type']);
321
				}
-
 
322
			}
-
 
323
			
320
			}
324
			$infos_espece = $especes[$stations_infos['oi_ce_espece']];
-
 
325
			
-
 
326
			if($infos_espece != null) {
-
 
327
				
321
			
328
				if($infos_espece['type'] != "") {
322
			$resultats_formates[$stations_infos['os_id_station']]['especes'][] = $infos_espece;
329
					$infos_espece['type'] = $this->obtenirValeurTripleParId($infos_espece['type']);
Line 323... Line 330...
323
			
330
				}
324
			if(is_numeric($stations_infos['os_ce_commune'])) {
331
				
Line 336... Line 343...
336
			}
343
			}
Line 337... Line 344...
337
			
344
			
338
			$resultat['pseudo_participant'] = $correspondance_id_utilisateur[$resultat['id_participant']]['name'];
345
			$resultat['pseudo_participant'] = $correspondance_id_utilisateur[$resultat['id_participant']]['name'];
Line -... Line 346...
-
 
346
			$resultat['mail_participant'] = $correspondance_id_utilisateur[$resultat['id_participant']]['mail'];
-
 
347
			
-
 
348
			$types = array("Particulier" ,"Établissement scolaire", "Association" ,"Professionnel", "Autre","Inconnu");
-
 
349
			
-
 
350
			if(isset($correspondance_id_utilisateur[$resultat['id_participant']]['profile_type'])) {
339
			$resultat['mail_participant'] = $correspondance_id_utilisateur[$resultat['id_participant']]['mail'];
351
				$resultat['type_participant'] = $correspondance_id_utilisateur[$resultat['id_participant']]['profile_type'];
-
 
352
			} else {
340
			
353
				$resultat['type_participant'] = "Inconnu";
Line 341... Line 354...
341
			//TODO: selection champ infos complémentaires à transmettre
354
			}
342
		}
355
		}