Rev 1517 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
class Dao extends Bdd {
public function rechercherCoordonnees() {
$requete = "SELECT longitude, latitude
FROM `cel_obs`
GROUP BY `longitude` , `latitude`";
$resultat = $this->recupererTous($requete);
return $resultat;
}
public function creerColonneCodeInseeCalculee() {
$create = "ALTER TABLE `cel_obs` ADD `code_insee_calcule` VARCHAR( 5 ) NOT NULL";
$this->requeter($create);
}
public function ajouterCodeInseeCalculee($latitude, $longitude, $code_insee) {
$insert = "UPDATE `cel_obs` SET `code_insee_calcule` = '$code_insee' ".
"WHERE latitude = '$latitude' AND longitude = '$longitude'";
$this->requeter($insert);
}
public function modifierCodeInsee() {
$update = "UPDATE `cel_obs` SET ce_zone_geo=concat('INSEE-C:' ,`code_insee_calcule`) ".
"WHERE ce_zone_geo= '' ";
$this->requeter($update);
}
}
?>