modules/archi/includes/archiAdresse.class.php
public function getArrayAdresseFromIdAdresse($idAdresse = 0)
    {
        $req = "
				select ha.idAdresse as idAdresse,
				ha.date as date,
				ha.description as description,
				ha.nom as nom,
				ha.idHistoriqueAdresse as idHistoriqueAdresse,
				ha.numero as numero,
				IF(ha.idIndicatif='0','',i.nom) as nomIndicatif,
				ha.idRue,
				IF (ha.idSousQuartier != 0, ha.idSousQuartier, r.idSousQuartier) AS idSousQuartier,
				IF (ha.idQuartier != 0, ha.idQuartier, sq.idQuartier) AS idQuartier,
				IF (ha.idVille != 0, ha.idVille, q.idVille) AS idVille,
				IF (ha.idPays != 0, ha.idPays, v.idPays) AS idPays,

				r.prefixe as prefixeRue,
				r.nom as nomRue,
				sq.nom as nomSousQuartier,
				q.nom as nomQuartier,
				v.nom as nomVille,
				p.nom as nomPays

				from historiqueAdresse hab, historiqueAdresse ha

				LEFT JOIN rue r         ON r.idRue = ha.idRue
				LEFT JOIN sousQuartier sq   ON sq.idSousQuartier = IF(ha.idRue='0' and ha.idSousQuartier!='0' ,ha.idSousQuartier ,r.idSousQuartier )
				LEFT JOIN quartier q        ON q.idQuartier = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier!='0' ,ha.idQuartier ,sq.idQuartier )
				LEFT JOIN ville v       ON v.idVille = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille!='0' ,ha.idVille ,q.idVille )
				LEFT JOIN indicatif i ON i.idIndicatif = ha.idIndicatif
				LEFT JOIN pays p        ON p.idPays = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille='0' and ha.idPays!='0' ,ha.idPays ,v.idPays )

				where ha.idAdresse = '".$idAdresse."'
						and hab.idAdresse = ha.idAdresse
						group by ha.idAdresse, ha.idHistoriqueAdresse
						having ha.idHistoriqueAdresse = max(hab.idHistoriqueAdresse)
						";
        $res=$this->connexionBdd->requete($req);
        return mysql_fetch_assoc($res);
    }
public function getArrayAdresseFromIdAdresse($idAdresse = 0)
    {
        $req = "
				select ha.idAdresse as idAdresse,
				ha.date as date,
				ha.description as description,
				ha.nom as nom,
				ha.idHistoriqueAdresse as idHistoriqueAdresse,
				ha.numero as numero,
				IF(ha.idIndicatif='0','',i.nom) as nomIndicatif,
				ha.idRue,
				IF (ha.idSousQuartier != 0, ha.idSousQuartier, r.idSousQuartier) AS idSousQuartier,
				IF (ha.idQuartier != 0, ha.idQuartier, sq.idQuartier) AS idQuartier,
				IF (ha.idVille != 0, ha.idVille, q.idVille) AS idVille,
				IF (ha.idPays != 0, ha.idPays, v.idPays) AS idPays,

				r.prefixe as prefixeRue,
				r.nom as nomRue,
				sq.nom as nomSousQuartier,
				q.nom as nomQuartier,
				v.nom as nomVille,
				p.nom as nomPays

				from historiqueAdresse hab, historiqueAdresse ha

				LEFT JOIN rue r         ON r.idRue = ha.idRue
				LEFT JOIN sousQuartier sq   ON sq.idSousQuartier = IF(ha.idRue='0' and ha.idSousQuartier!='0' ,ha.idSousQuartier ,r.idSousQuartier )
				LEFT JOIN quartier q        ON q.idQuartier = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier!='0' ,ha.idQuartier ,sq.idQuartier )
				LEFT JOIN ville v       ON v.idVille = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille!='0' ,ha.idVille ,q.idVille )
				LEFT JOIN indicatif i ON i.idIndicatif = ha.idIndicatif
				LEFT JOIN pays p        ON p.idPays = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille='0' and ha.idPays!='0' ,ha.idPays ,v.idPays )

				where ha.idAdresse = '".$idAdresse."'
						and hab.idAdresse = ha.idAdresse
						group by ha.idAdresse, ha.idHistoriqueAdresse
						having ha.idHistoriqueAdresse = max(hab.idHistoriqueAdresse)
						";
        $res=$this->connexionBdd->requete($req);
        return mysql_fetch_assoc($res);
    }
public function getArrayAdresseFromIdAdresse ( $ idAdresse = 0 ) { $ req = "
				select ha.idAdresse as idAdresse,
				ha.date as date,
				ha.description as description,
				ha.nom as nom,
				ha.idHistoriqueAdresse as idHistoriqueAdresse,
				ha.numero as numero,
				IF(ha.idIndicatif='0','',i.nom) as nomIndicatif,
				ha.idRue,
				IF (ha.idSousQuartier != 0, ha.idSousQuartier, r.idSousQuartier) AS idSousQuartier,
				IF (ha.idQuartier != 0, ha.idQuartier, sq.idQuartier) AS idQuartier,
				IF (ha.idVille != 0, ha.idVille, q.idVille) AS idVille,
				IF (ha.idPays != 0, ha.idPays, v.idPays) AS idPays,

				r.prefixe as prefixeRue,
				r.nom as nomRue,
				sq.nom as nomSousQuartier,
				q.nom as nomQuartier,
				v.nom as nomVille,
				p.nom as nomPays

				from historiqueAdresse hab, historiqueAdresse ha

				LEFT JOIN rue r         ON r.idRue = ha.idRue
				LEFT JOIN sousQuartier sq   ON sq.idSousQuartier = IF(ha.idRue='0' and ha.idSousQuartier!='0' ,ha.idSousQuartier ,r.idSousQuartier )
				LEFT JOIN quartier q        ON q.idQuartier = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier!='0' ,ha.idQuartier ,sq.idQuartier )
				LEFT JOIN ville v       ON v.idVille = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille!='0' ,ha.idVille ,q.idVille )
				LEFT JOIN indicatif i ON i.idIndicatif = ha.idIndicatif
				LEFT JOIN pays p        ON p.idPays = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille='0' and ha.idPays!='0' ,ha.idPays ,v.idPays )

				where ha.idAdresse = '" . $ idAdresse . "'
						and hab.idAdresse = ha.idAdresse
						group by ha.idAdresse, ha.idHistoriqueAdresse
						having ha.idHistoriqueAdresse = max(hab.idHistoriqueAdresse)
						" ; $ res = $ this -> connexionBdd -> requete ( $ req ) ; return mysql_fetch_assoc ( $ res ) ; }
retourne un tableau contenant les infos de l'adresse
retourne un tableau contenant les infos de l adresse