« Dati sullo scrutinio  « Indice

<%if Request.form("submit") = "Invia" then dim lcfonogramma lcfonogramma = request.form("lcfono") 'response.write("submit" & request.form("lcfono"))%> <%dim lcTitolo if lcfonogramma = "1" then lcTitolo = "ORE 12" end if if lcfonogramma = "2" then lcTitolo = "ORE 19" end if if lcfonogramma = "3" then lcTitolo = "ORE 22" end if if lcfonogramma = "4" then lcTitolo = "FINALI" end if%>

VOTANTI <%response.write(lcTitolo)%> - DETTAGLIO PER COMUNE

<%else%>

VOTANTI - DETTAGLIO PER COMUNE

<%end if%>

<% Set Conn = Server.CreateObject("ADODB.Connection") Set RSElezioni = Server.CreateObject ("ADODB.RecordSet") Conn.Open "dsn=risult_refe2006" Set RSdataora = Server.CreateObject ("ADODB.RecordSet") RSdataora.ActiveConnection = Conn RSdataora.CursorType = adOpenStatic RSdataora.Source = "select * from dataoraagg" RSdataora.Open() data = RSdataora("dataagg") ora = RSdataora("oraagg") RSdataora.close() Set RSdataora = nothing %> (situazione alle ore <%=ora%> del <%=data%>)

  <% if Request.form("submit") <> "Invia" then Conn.Close Set Conn = nothing response.end end if lcSql = "select comuni.comune as comune,affluenze.elettori as elettori,"+_ "affluenze.votmref1,affluenze.votmref2,affluenze.votmref3,affluenze.votmref4,"+_ "affluenze.votfref1,affluenze.votfref2,affluenze.votfref3,affluenze.votfref4,"+_ "affluenze.votanti1ref1,affluenze.votanti1ref2,affluenze.votanti1ref3,affluenze.votanti1ref4,"+_ "affluenze.votanti2ref1,affluenze.votanti2ref2,affluenze.votanti2ref3,affluenze.votanti2ref4,"+_ "affluenze.votanti3ref1,affluenze.votanti3ref2,affluenze.votanti3ref3,affluenze.votanti3ref4,"+_ "affluenze.votanti4ref1,affluenze.votanti4ref2,affluenze.votanti4ref3,affluenze.votanti4ref4"+_ " from comuni inner join affluenze on comuni.codice = affluenze.ridcomune order by comune" Set RSelezioni = Server.CreateObject ("ADODB.RecordSet") RSelezioni.ActiveConnection = Conn RSelezioni.CursorType=adOpenStatic RSelezioni.Source = lcSql RSelezioni.Open() if RSelezioni.eof or RSelezioni.bof then response.write("NON CI SONO DATI DA VISUALIZZARE") RSelezioni.Close() Conn.Close Set Conn = nothing Set RSElezioni = nothing response.end end if RSelezioni.MoveFirst %>

<% dim lntotele,lntotvot1,lntotvot2,lntotvot3,lntotvot4 dim lntotvotm1,lntotvotm2,lntotvotm3,lntotvotm4 dim lntotvotf1,lntotvotf2,lntotvotf3,lntotvotf4 lntotele=0 lntotvot1=0 lntotvot2=0 lntotvot3=0 lntotvot4=0 lntotvotm1=0 lntotvotm2=0 lntotvotm3=0 lntotvotm4=0 lntotvotf1=0 lntotvotf2=0 lntotvotf3=0 lntotvotf4=0 Do Until RSelezioni.EOF %> <% if lcfonogramma = "1" then lnvot1 = Rselezioni("votanti1ref1") lnvot2 = Rselezioni("votanti1ref2") lnvot3 = Rselezioni("votanti1ref3") lnvot4 = Rselezioni("votanti1ref4") lntotvot1=lntotvot1+lnvot1 lntotvot2=lntotvot2+lnvot2 lntotvot3=lntotvot3+lnvot3 lntotvot4=lntotvot4+lnvot4 end if if lcfonogramma = "2" then lnvot1 = Rselezioni("votanti2ref1") lnvot2 = Rselezioni("votanti2ref2") lnvot3 = Rselezioni("votanti2ref3") lnvot4 = Rselezioni("votanti2ref4") lntotvot1=lntotvot1+lnvot1 lntotvot2=lntotvot2+lnvot2 lntotvot3=lntotvot3+lnvot3 lntotvot4=lntotvot4+lnvot4 end if if lcfonogramma = "3" then lnvot1 = Rselezioni("votanti3ref1") lnvot2 = Rselezioni("votanti3ref2") lnvot3 = Rselezioni("votanti3ref3") lnvot4 = Rselezioni("votanti3ref4") lntotvot1=lntotvot1+lnvot1 lntotvot2=lntotvot2+lnvot2 lntotvot3=lntotvot3+lnvot3 lntotvot4=lntotvot4+lnvot4 end if if lcfonogramma = "4" then lnvotm1=Rselezioni("votmref1") lnvotm2=Rselezioni("votmref2") lnvotm3=Rselezioni("votmref3") lnvotm4=Rselezioni("votmref4") lnvotf1=Rselezioni("votfref1") lnvotf2=Rselezioni("votfref2") lnvotf3=Rselezioni("votfref3") lnvotf4=Rselezioni("votfref4") lnvot1 = Rselezioni("votanti4ref1") lnvot2 = Rselezioni("votanti4ref2") lnvot3 = Rselezioni("votanti4ref3") lnvot4 = Rselezioni("votanti4ref4") lntotvot1=lntotvot1+lnvot1 lntotvot2=lntotvot2+lnvot2 lntotvot3=lntotvot3+lnvot3 lntotvot4=lntotvot4+lnvot4 lntotvotm1=lntotvotm1+lnvotm1 lntotvotm2=lntotvotm2+lnvotm2 lntotvotm3=lntotvotm3+lnvotm3 lntotvotm4=lntotvotm4+lnvotm4 lntotvotf1=lntotvotf1+lnvotf1 lntotvotf2=lntotvotf2+lnvotf2 lntotvotf3=lntotvotf3+lnvotf3 lntotvotf4=lntotvotf4+lnvotf4 end if lntotele = lntotele+Rselezioni("elettori") %> <%RSelezioni.MoveNext loop%>
   

Votanti

 
Comune N. elettori M F Tot %
<%=Rselezioni("comune")%> <%=Rselezioni("elettori")%> <%=lnvotm1%> <%=lnvotf1%> <%=lnvot1%> <%=FormatPercent(lnvot1/Rselezioni("elettori"),2)%>
TOTALI <%=lntotele%> <%=lntotvotm1%> <%=lntotvotf1%> <%=lntotvot1%> <%=FormatPercent(lntotvot1/lntotele,2)%>
<%RSelezioni.Close() Conn.Close Set Conn = nothing Set RSElezioni = nothing%>