<%
p1 = request("p1")
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
Conn.Open "aca2009"
select case p1
case "1"
order = "CongNom"
case "2"
order = "CongPrenom"
case "3"
order = "CongPays"
case "4"
order = "DateInsc"
case "5"
order = "NbAcc"
case "6"
order = "Cocktail"
case "7"
order = "Banquet"
case "8"
order = "Choix1"
case "9"
order = "Choix2"
case "10"
order = "Choix3"
case "11"
order = "ModePaiement"
case "12"
order = "accepte"
case else
order = "noinsc"
end select
sql = "select * from register order by "+order
set rs = Conn.Execute(sql)
cpt = 1
cptAcc = 0
cptCocktail = 0
cptBanquet = 0
choix1a = 0
choix2a = 0
choix3a = 0
allerg = 0
cptpaieTr = 0
cptpaieCh = 0
cptpaieVisa = 0
cptpaieMast = 0
do
CongNom=rs("CongNom")
CongPrenom=rs("CongPrenom")
CongPays=rs("CongPays")
NoInsc=rs("NoInsc")
Banquet=rs("Banquet")
Cocktail=rs("Cocktail")
DateInsc=rs("DateInsc")
Choix1=rs("Choix1")
Choix2=rs("Choix2")
Choix3=rs("Choix3")
Accepte=rs("Accepte")
nbAcc=rs("nbAcc")
DemandeSpeciale=rs("DemandeSpeciale")
ModePaiement=rs("ModePaiement")
ConfAccepte=rs("ConfAccepte")
if ModePaiement = "Transfer" then
paiepar="transf"
cptpaieTr = cptpaieTr + 1
else
if ModePaiement = "Cheque" then
paiepar="cheq"
cptpaieCh = cptpaieCh + 1
else
if ModePaiement = "Visa" then
paiepar="Visa"
cptpaieVisa = cptpaieVisa + 1
else
paiepar = "Mast."
cptpaieMast = cptpaieMast + 1
end if
end if
end if
nbtotal=nbAcc+1
if len(DemandeSpeciale) > 2 then
allergies="Oui"
allerg = allerg + nbtotal
else
allergies="Non"
end if
if (isNull(rs("ConfAccepte"))) then
texte2 = ""
else
texte2=rs("ConfAccepte")
end if
Response.Write("
")
cpt = cpt +1
if Cocktail = "OUI" then
cptCocktail = cptCocktail + nbtotal
end if
if Banquet = "OUI" then
cptBanquet = cptBanquet + nbtotal
end if
cptAcc = cptAcc + nbtotal
if Choix1 > 0 then
choix1a = choix1a + Choix1
end if
if Choix2 > 0 then
choix2a = choix2a + Choix2
end if
if Choix3 > 0 then
choix3a = choix3a + Choix3
end if
rs.MoveNext
loop until rs.eof
Conn.Close
set rs = nothing
set Conn = nothing
Response.Write("