Subversion Repositories eFlore/Applications.cel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1500 delphine 1
<?php
2
class Dao extends Bdd {
3
	public function rechercherCoordonnees() {
4
		$requete = "SELECT longitude, latitude
5
					FROM `cel_obs`
6
					GROUP BY `longitude` , `latitude`";
7
		$resultat = $this->recupererTous($requete);
8
		return $resultat;
9
	}
10
 
1517 aurelien 11
	public function rechercherCoordonneesSansCorrespondances() {
12
		$requete = "SELECT longitude, latitude
13
						FROM `cel_obs`
14
						WHERE code_insee_calcule = ''
15
						GROUP BY `longitude` , `latitude`";
16
		$resultat = $this->recupererTous($requete);
17
		return $resultat;
18
	}
19
 
1500 delphine 20
	public function creerColonneCodeInseeCalculee() {
21
		$create = "ALTER TABLE `cel_obs` ADD `code_insee_calcule` VARCHAR( 5 ) NOT NULL";
22
		$this->requeter($create);
23
	}
24
 
25
	public function ajouterCodeInseeCalculee($latitude, $longitude, $code_insee) {
26
		$insert = "UPDATE `cel_obs` SET `code_insee_calcule` = '$code_insee' ".
1517 aurelien 27
					"WHERE latitude = $latitude AND longitude = $longitude";
1500 delphine 28
		$this->requeter($insert);
29
	}
30
 
31
	public function modifierCodeInsee() {
1517 aurelien 32
		$update = "UPDATE `cel_obs` SET `ce_zone_geo` = concat('INSEE-C:' , `code_insee_calcule`) ".
33
						"WHERE  ce_zone_geo = '' ";
1500 delphine 34
		$this->requeter($update);
35
	}
36
}
37
?>