1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
| <%option explicit%>
<!--#include virtual = "/isy/formulaires/xxflboul/enquete/function.asp"-->
<%
'/////////// Déclaration de variable///////////////
dim DSN_BASE,conn,RS,RS2,RS3,RS4,RS5
dim mysql
dim i '////pour les boucle "for"///
dim som '////total des note des question///
dim nomb '////nb de note des question///
dim tab_split '////pout la fonction "split"///
dim inti_rad '////résultat à afficher pour les "radio" ou les "select" sans note///
'//////////connexion base de données///////////////
connexion_bd_access("enquete.mdb")
'////RS est créer dans ma fonction connexion_bd_access/////
set RS2 = server.createobject("adodb.recordset")
set RS3 = server.createobject("adodb.recordset")
set RS4 = server.createobject("adodb.recordset")
mysql="select service as se, numero_service as ns from T_service"
if(RS2.state = 1) then RS2.close
RS2.open mysql, conn
while not RS2.eof '////////////////pour tous les service//////////////////
mysql="select count(num_quest) as nb from T_question where numero_service="&RS2("ns")
if (RS.state = 1) then RS.close
RS.open mysql, conn
if RS("nb")>0 then '////////si il existe dans la table des questions pour le service "RS2("se")" alors...////////////
mysql="select num_quest as nq, intituler_quest as iq, type_quest as tq from T_question where numero_service="&RS2("ns")
if (RS.state = 1) then RS.close
RS.open mysql, conn
while not RS.eof '///////////////////pour toutes les question du service RS2("ns")
mysql="select DISTINCT date_rep as dr from T_reponse"
if (RS3.state = 1) then RS3.close
RS3.open mysql, conn
if RS("tq")<>"textarea" then
if RS("tq")="titre" then '///////////////type TITRE///////////
else
end if
if RS("tq")="text" then '/////////////type TEXT//////////////
while not RS3.eof '///////////pour toutes les dates////////
RS3.movenext
if not RS3.eof then
else
end if
wend
else '//////////////Sinon si du type RADIO alors.../////////////
if RS("tq")="radio" then
while not RS3.eof '///////////pour toutes les dates////////
mysql="select nom_chbox_radio as nom from T_question where num_quest="&RS("nq")
if (RS4.state = 1) then RS4.close
RS4.open mysql, conn
tab_split=split(RS4("nom"),";")
som=0
inti_rad=""
for i=0 to ubound(tab_split)
mysql="select count(num_rep) as nr from T_reponse where num_quest="&RS("nq")&" and date_rep='"&RS3("dr")&"' and reponse='"&tab_split(i)&"'"
if (RS4.state = 1) then RS4.close
RS4.open mysql, conn
nomb=RS4("nr")
if nomb>som then
som=nomb
inti_rad="- "&tab_split(i)
else
if nomb<>0 then
if nomb=som then inti_rad=inti_rad&"<br/>- "&tab_split(i)
end if
end if
next
if som>0 then
else
end if
RS3.movenext
if not RS3.eof then
else
end if
wend
else
while not RS3.eof '///////////pour toutes les dates////////
mysql="SELECT Count(num_rep) AS nbs FROM T_reponse WHERE (((T_reponse.reponse)='1' Or (T_reponse.reponse)='2' Or (T_reponse.reponse)='3' Or (T_reponse.reponse)='4' Or (T_reponse.reponse)='5' Or (T_reponse.reponse)='6' Or (T_reponse.reponse)='7' Or (T_reponse.reponse)='8' Or (T_reponse.reponse)='9' Or (T_reponse.reponse)='10' Or (T_reponse.reponse)='0') AND ((T_reponse.num_quest)="&RS("nq")&") AND ((T_reponse.date_rep)='"&RS3("dr")&"'))"
if (RS4.state = 1) then RS4.close
RS4.open mysql, conn
nomb=RS4("nbs")
if RS4("nbs")>0 then
mysql="SELECT num_rep AS nbs, reponse as repo FROM T_reponse WHERE (((T_reponse.reponse)='1' Or (T_reponse.reponse)='2' Or (T_reponse.reponse)='3' Or (T_reponse.reponse)='4' Or (T_reponse.reponse)='5' Or (T_reponse.reponse)='6' Or (T_reponse.reponse)='7' Or (T_reponse.reponse)='8' Or (T_reponse.reponse)='9' Or (T_reponse.reponse)='10' Or (T_reponse.reponse)='0') AND ((T_reponse.num_quest)="&RS("nq")&") AND ((T_reponse.date_rep)='"&RS3("dr")&"'))"
if (RS4.state = 1) then RS4.close
RS4.open mysql, conn
som=0
while not RS4.eof
som=som+RS4("repo")
RS4.movenext
wend
else
end if
RS3.movenext
if not RS3.eof then
else
end if
wend
end if
end if
if RS("tq")="titre" then
end if
RS.movenext
else
while not RS3.eof '///////////pour toutes les dates////////
RS3.movenext
if not RS3.eof then
else
end if
wend
RS.movenext
end if
wend
end if
RS2.movenext
wend
response.write "</form>"
if (RS2.state = 1) then RS2.close
set RS2 = nothing
if (RS3.state = 1) then RS3.close
set RS3 = nothing
if (RS4.state = 1) then RS4.close
set RS4 = nothing
deconnection
%> |
Partager