%
id_giornata = ZeroV(request("idg"))
id_evento = ZeroV(request("idac"))
id_partita = ZeroV(request("id"))
cronaca = request("c")
FLabel="Partita"
SQL="SELECT giornate.data, giornate.giornata, campionato.campionato, anno.anno FROM giornate "&_
"INNER JOIN ac ON (giornate.idAC="&id_evento&" AND giornate.idAC=ac.id ) "&_
"INNER JOIN campionato ON (campionato.id=ac.idCampionato AND campionato.eliminato='N' ) "&_
"INNER JOIN anno ON (anno.id=ac.idAnno AND anno.eliminato='N' ) "&_
"WHERE giornate.eliminato='N' AND giornate.id="&id_giornata
set rstmp = Conn.Execute(SQL)
if not rstmp.EOF then
giornata=rstmp("giornata")
data=rstmp("data")
campionato = rstmp("campionato")
anno = rstmp("anno")
titleAction=campionato&" Stagione "&anno&" - "&giornata&"° Giornata "&data
end if
set rstmp = Nothing
''PARTITA
SQL="SELECT partite.id, GolCasa, GolTrasferta, sc.id as idCASA, sc.nome as nomeCasa, "&_
"st.id as idTRASFERTA, st.nome as nomeTrasferta, idCSCasa, idCSTrasferta, descrizione "&_
"FROM partite "&_
"INNER JOIN cs as csc ON (partite.idCSCasa=csc.id) "&_
"INNER JOIN squadra as sc ON (sc.id=csc.idsquadra) "&_
"INNER JOIN cs as cst ON (partite.idCSTrasferta=cst.id) "&_
"INNER JOIN squadra as st ON (st.id=cst.idsquadra) "&_
"WHERE partite.idGiornata="&id_giornata&" AND partite.eliminato='N' AND partite.id="&id_partita&" ORDER BY partite.id asc"
set rs = Conn.Execute(SQL)
if not rs.EOF then
idCSCasa=rs("idCSCasa")
idCASA=rs("idCASA")
idCSTrasferta=rs("idCSTrasferta")
idTRASFERTA=rs("idTRASFERTA")
golTrasferta=rs("golTrasferta")
golCasa=rs("golCasa")
nomeCasa=rs("nomeCasa")
nomeTrasferta=rs("nomeTrasferta")
descrizione=replace(rs("descrizione"),""","'")
descrizione=replace(descrizione,"""","'")
CASA=""&rs("nomecasa")&" "&rs("golCasa")&""
TRASFERTA=" "&rs("golTrasferta")&" "&rs("nomeTrasferta")&""
end if
set rs = Nothing
'CONTATORE RIGHE DA CREARE
if golCasa>=golTrasferta then
nrighe = golCasa
else
nrighe = golTrasferta
end if
%>
Palla al Centro "Il Calcio a 5 in Toscana" - <%=titleAction%>
<%=titleAction%>
<%
'STEMMA CASA
imgCASA=""
strPh = "public/team/"&IDCASA&"/mid/"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Server.MapPath(strPh)) Then
Set objFolder = objFso.GetFolder(Server.MapPath(strPh))
Set objFiles = objFolder.Files
For each strFile in objFiles
if imgCASA="" and (lcase(strFile.name)="logo.jpg" or lcase(strFile.name)="logo.png") then
imgCASA=strPh&strFile.name
end if
Next
end if
Set objFolder = Nothing
Set objFiles = Nothing
Set objFSO = Nothing
if imgCASA="" then
imgCASA="public/team/nologo_small.png"
end if
'STEMMA TRASFERTA
imgTRASFERTA=""
strPh = "public/team/"&IDTRASFERTA&"/mid/"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Server.MapPath(strPh)) Then
Set objFolder = objFso.GetFolder(Server.MapPath(strPh))
Set objFiles = objFolder.Files
For each strFile in objFiles
if imgTRASFERTA="" and (lcase(strFile.name)="logo.jpg" or lcase(strFile.name)="logo.png") then
imgTRASFERTA=strPh&strFile.name
end if
Next
end if
Set objFolder = Nothing
Set objFiles = Nothing
Set objFSO = Nothing
if imgTRASFERTA="" then
imgTRASFERTA="public/team/nologo_small.png"
end if
'PRESENZE CASA
SQLpc="SELECT CONCAT(cognome,'#',LEFT(nome,1),'#',soprannome) as nomeGiocatore, soprannome, giocatori.id FROM presenze as Pr "&_
" INNER JOIN sg ON (Pr.idSG=sg.id AND idCS="&idCSCasa&" AND eliminato='N') "&_
" INNER JOIN giocatori ON (sg.idGiocatore=giocatori.id AND giocatori.eliminato='N' AND giocatori.cognome not like'%.MISTER%' ) "&_
" INNER JOIN ruolo ON (giocatori.ruolo=ruolo.ruolo ) "&_
" WHERE Pr.eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSCasa&"' ORDER BY ruolo.ordinamento ASC, ordine DESC "
set rsPC = Conn.Execute(SQLpc)
'ALLENATORE CASA
SQLpc="SELECT CONCAT(cognome,'#',LEFT(nome,1),'#',soprannome) as nomeGiocatore, soprannome FROM presenze as Pr "&_
" INNER JOIN sg ON (Pr.idSG=sg.id AND idCS="&idCSCasa&" AND eliminato='N') "&_
" INNER JOIN giocatori ON (sg.idGiocatore=giocatori.id AND giocatori.eliminato='N' AND giocatori.cognome like'%.MISTER%' ) "&_
" WHERE Pr.eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSCasa&"' ORDER BY ordine DESC "
set rsAC = Conn.Execute(SQLpc)
AllenatoreCasa=""
if not rsAC.EOF then
NGS = Split(rsAC("nomeGiocatore"), "#")
if NGS(2)<>"" then
AllenatoreCasa=NGS(2)
else
if NGS(1)<>"" then
AllenatoreCasa=NGS(1)&". "&replace(NGS(0),".MISTER","")
else
AllenatoreCasa=NGS(0)
end if
end if
end if
set rsAC = Nothing
SQLc="SELECT COUNT(marcatori.idSG) AS numGol, "&_
"CASE marcatori.idSG "&_
"WHEN -1 THEN "&_
" 'Autogol' "&_
"ELSE "&_
" (SELECT CONCAT(cognome,'#',LEFT(nome,1),'#',soprannome) as nomeGiocatore FROM marcatori as Marc "&_
" INNER JOIN sg ON (Marc.idSG=sg.id AND idCS="&idCSCasa&" AND eliminato='N') "&_
" INNER JOIN giocatori ON (sg.idGiocatore=giocatori.id AND giocatori.eliminato='N') "&_
" WHERE Marc.eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSCasa&"' AND Marc.id=marcatori.id "&_
") END AS nomeGiocatore "&_
"FROM marcatori "&_
"WHERE eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSCasa&"' GROUP BY marcatori.idSG ORDER BY numGol DESC"
set rsC = Conn.Execute(SQLc)
SQLcc="SELECT COUNT(marcatori.id) AS conta FROM marcatori "&_
"WHERE eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra="&idCSCasa
set rsCC = Conn.Execute(SQLcc)
contaCasa = rsCC("conta")
set rsCC = Nothing
'PRESENZE TRASFERTA
SQLpt="SELECT CONCAT(cognome,'#',LEFT(nome,1),'#',soprannome) as nomeGiocatore, giocatori.id FROM presenze as Pr "&_
" INNER JOIN sg ON (Pr.idSG=sg.id AND idCS="&idCSTrasferta&" AND eliminato='N') "&_
" INNER JOIN giocatori ON (sg.idGiocatore=giocatori.id AND giocatori.eliminato='N' AND giocatori.cognome not like'%.MISTER%') "&_
" INNER JOIN ruolo ON (giocatori.ruolo=ruolo.ruolo ) "&_
" WHERE Pr.eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSTrasferta&"' ORDER BY ruolo.ordinamento ASC, ordine DESC "
set rsPT = Conn.Execute(SQLpt)
'ALLENATORE CASA
SQLat="SELECT CONCAT(cognome,'#',LEFT(nome,1),'#',soprannome) as nomeGiocatore, soprannome FROM presenze as Pr "&_
" INNER JOIN sg ON (Pr.idSG=sg.id AND idCS="&idCSTrasferta&" AND eliminato='N') "&_
" INNER JOIN giocatori ON (sg.idGiocatore=giocatori.id AND giocatori.eliminato='N' AND giocatori.cognome like'%.MISTER%' ) "&_
" WHERE Pr.eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSTrasferta&"' ORDER BY ordine DESC "
set rsAT = Conn.Execute(SQLat)
AllenatoreTrasferta=""
if not rsAT.EOF then
NGS = Split(rsAT("nomeGiocatore"), "#")
if NGS(2)<>"" then
AllenatoreTrasferta=NGS(2)
else
if NGS(1)<>"" then
AllenatoreTrasferta=NGS(1)&". "&replace(NGS(0),".MISTER","")
else
AllenatoreTrasferta=NGS(0)
end if
end if
end if
set rsAT = Nothing
'MARCATORI TRASFERTA
SQLt="SELECT COUNT(marcatori.idSG) AS numGol, "&_
"CASE marcatori.idSG "&_
"WHEN -1 THEN "&_
" 'Autogol' "&_
"ELSE "&_
" (SELECT CONCAT(cognome,'#',LEFT(nome,1),'#',soprannome) as nomeGiocatore FROM marcatori as Marc "&_
" INNER JOIN sg ON (Marc.idSG=sg.id AND idCS="&idCSTrasferta&" AND eliminato='N') "&_
" INNER JOIN giocatori ON (sg.idGiocatore=giocatori.id AND giocatori.eliminato='N') "&_
" WHERE Marc.eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSTrasferta&"' AND Marc.id=marcatori.id "&_
") END AS nomeGiocatore "&_
"FROM marcatori "&_
"WHERE eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra='"&idCSTrasferta&"' "&_
"GROUP BY marcatori.idSG ORDER BY numGol DESC"
set rsT = Conn.Execute(SQLt)
SQLtc="SELECT COUNT(marcatori.id) AS conta FROM marcatori "&_
"WHERE eliminato='N' AND idPartita='"&id_partita&"' AND idCSSquadra="&idCSTrasferta
set rsTC = Conn.Execute(SQLtc)
contaTrasferta = rsTC("conta")
set rsTC = Nothing
%>
<%=CASA%>
<%if not rsPC.EOF then%>
Formazione:
<%do while not rsPC.EOF
nomeGiocatore=""
NGS = Split(rsPC("nomeGiocatore"), "#")
if NGS(2)<>"" then
nomeGiocatore=NGS(2)
else
if NGS(1)<>"" then
nomeGiocatore=NGS(1)&". "&NGS(0)
else
nomeGiocatore=NGS(0)
end if
end if
%>
'"><%=nomeGiocatore%>
<%rsPC.movenext
if not rsPC.EOF then%>, <%end if
Loop
end if
if allenatoreCasa<>"" then%>
Allenatore: <%=allenatoreCasa%>
<%end if%>
<%do while not rsC.EOF
nomeGiocatore=""
if rsC("nomeGiocatore")="Autogol" then
nomeGiocatore=rsC("nomeGiocatore")
else
NGS = Split(rsC("nomeGiocatore"), "#")
if NGS(2)<>"" then
nomeGiocatore=NGS(2)
else
if NGS(1)<>"" then
nomeGiocatore=NGS(1)&". "&NGS(0)
else
nomeGiocatore=NGS(0)
end if
end if
end if
%>
<%=nomeGiocatore&" "&rsC("numGol")%>
<%rsC.movenext
Loop
if contaCasa
<%=(GolCasa-contaCasa)%> Non Pervenuti
<%end if%>
<%=TRASFERTA%>
<%if not rsPT.EOF then%>
Formazione:
<%do while not rsPT.EOF
nomeGiocatore=""
NGS = Split(rsPT("nomeGiocatore"), "#")
if NGS(2)<>"" then
nomeGiocatore=NGS(2)
else
if NGS(1)<>"" then
nomeGiocatore=NGS(1)&". "&NGS(0)
else
nomeGiocatore=NGS(0)
end if
end if
%>
''"><%=nomeGiocatore%>
<%rsPT.movenext
if not rsPT.EOF then%>, <%end if
Loop
end if
if allenatoreTrasferta<>"" then%>
Allenatore: <%=allenatoreTrasferta%>
<%end if%>
<%do while not rsT.EOF
nomeGiocatore=""
if rsT("nomeGiocatore")="Autogol" then
nomeGiocatore=rsT("nomeGiocatore")
else
NGS = Split(rsT("nomeGiocatore"), "#")
if NGS(2)<>"" then
nomeGiocatore=NGS(2)
else
if NGS(1)<>"" then
nomeGiocatore=NGS(1)&". "&NGS(0)
else
nomeGiocatore=NGS(0)
end if
end if
end if
%>
<%=rsT("numGol")&" "&nomeGiocatore%>
<%rsT.movenext
Loop
if contaTrasferta
<%=(GolTrasferta-contaTrasferta)%> Non Pervenuti
<%end if%>