%
set maconnexion = server.CreateObject("ADODB.Connection")
maconnexion.Open(Application("bd_ConnectionString"))
'--- recup villes France du departement Lombardia --------------------------------------------
'--------------------------------------------------------------------------------------
'---------- RECUP DES villes Où IL Y A DES BIENS (ET AFFICHE LEURS NOMBRE) ------------
sql = " SELECT Count(Articles_neufs.idArticle) AS CompteDeidArticle, theVilles.nomEn, theDepartements.nomEn AS TheDept, theVilles.idVille, regions.idPays as regionIdPays "
sql = sql&" FROM regions INNER JOIN (theDepartements INNER JOIN (theVilles INNER JOIN Articles_neufs ON theVilles.idVille = Articles_neufs.idVille) ON theDepartements.idDepartement = theVilles.idDepartement) ON regions.idRegion = theDepartements.idregion "
sql = sql&" GROUP BY theVilles.nomEn, theDepartements.nomEn, theVilles.idVille, regions.idPays "
sql = sql&" HAVING (((regionIdPays)=92)) "
sql = sql&" ORDER BY theVilles.nomEn DESC; "
set rsI = maconnexion.Execute(sql)
'-------------------------- FIN -------------------------------------------------------
'------------ POUR LA FRANCE ------------------------------
idDepartement = 6
idPays=request("idPays")
dep = "select * from theDepartements where idDepartement="&idDepartement
set rsDep = maconnexion.Execute(dep)
include_Map = 0
if not rsDep.eof then
nom_dep = rsDep("nomEn")
abbrev = rsDep("deno")
if rsDep("isPhotoDept")=1 then
include_Map = 1
nom_map = "dept_fr_"&idDepartement&"_neuf.asp"
end if
rsDep.close
set rsDep = nothing
end if
'-------- Je rajoute les programmes neufs
selTot = "SELECT count(idVille) as nb_ville FROM theVilles WHERE isActive=1 and idDepartement="&idDepartement
set theTot = maconnexion.Execute(selTot)
if not theTot.eof then
nbVille = formatnumber(theTot("nb_Ville"),0)+0
theTot.close
set theTot = nothing
else
nbVille = 100
end if
ReDim tabn(nbVille,4) 'nb de villes ds le département
sqlF = " SELECT Count(Articles_neufs.idArticle) AS CompteDeidArticle, theVilles.nomFr as nom_ville, theDepartements.nomFr AS TheDept, theVilles.idVille, theDepartements.idDepartement as deptId, articles_neufs.isTemporaire as isArticleTemp "
sqlF = sqlF&" FROM (theDepartements INNER JOIN theVilles ON theDepartements.idDepartement = theVilles.idDepartement) INNER JOIN Articles_neufs ON theVilles.idVille = Articles_neufs.idVille "
sqlF = sqlF&" GROUP BY theVilles.nomFr, theDepartements.nomFr, theVilles.idVille, theDepartements.idDepartement, Articles_neufs.isTemporaire=0 "
sqlF = sqlF&" HAVING (((deptId) = "&idDepartement&")) and isArticleTemp=0 "
sqlF = sqlF&" ORDER BY theVilles.nomFr ASC; "
set rsF = maconnexion.Execute(sqlF)
if not rsF.eof then
ind = 1
rsF.movefirst
do while not rsF.eof
tabn(ind,1) = rsF("idVille")
tabn(ind,2) = rsF("nom_Ville")
tabn(ind,3) = formatnumber(rsF("CompteDeidArticle"),0)+0
'response.write " "& tabn(ind,1) &" "& tabn(ind,2) &" "& tabn(ind,3) &" "& tabn(ind,4)
ind = ind + 1
rsF.movenext
loop
nbElementn = ind - 1
rsF.close
set rsF = nothing
end if
'--------
sql = " SELECT Count(Articles_neufs.idArticle) AS CompteDeidArticle, Articles_neufs.isTemporaire, theVilles.nomEn, theDepartements.nomEn AS TheDept,theDepartements.deno, theVilles.idVille, theDepartements.idDepartement as deptId, articles_neufs.isTemporaire as isArticleTemp "
sql = sql&" FROM (theDepartements INNER JOIN theVilles ON theDepartements.idDepartement = theVilles.idDepartement) INNER JOIN Articles_neufs ON theVilles.idVille = Articles_neufs.idVille "
sql = sql&" GROUP BY Articles_neufs.isTemporaire, theVilles.nomEn, theDepartements.nomEn, theDepartements.deno, theVilles.idVille, Articles_neufs.isTemporaire=0 "
sql = sql&" HAVING (((deptId) = "&idDepartement&")) and isArticleTemp=0 "
sql = sql&" ORDER BY theVilles.nomEn ASC; "
set rsF = maconnexion.Execute(sql)
'-------------------------- FIN -------------------------------------------------------
%>