codice:
function GeneraRosa(IDSquadra) {
var tabR = new Tabella(2,4)
var i,j,w,cnt,sT,sR,fatto
var arrCrediti=new Array()
var arrNomiGiocatori=new Array()
fatto=false
tabR.nome="Rosa"
tabR.larghezza=95
tabR.border=0
tabR.cellpadding=1
tabR.cellspacing=0
tabR.stile="ClassEl"
tabR.SetLarghezzaColonna(1,10)
tabR.SetLarghezzaColonna(2,60)
tabR.SetLarghezzaColonna(3,20)
tabR.SetLarghezzaColonna(4,4)
tabR.SetLarghezzaColonna(5,6)
tabR.SetStileRiga(1,"IntRossoBlu")
tabR.SetStile(1,1,"Cella")
tabR.SetStile(1,2,"Cella")
tabR.SetStile(1,3,"Cella")
tabR.SetStile(1,4,"Cella")
tabR.SetStile(1,5,"Cella")
tabR.SetValore(1,1,"Ruolo")
tabR.SetValore(1,2,"Nome")
tabR.SetValore(1,3,"Squadra")
tabR.SetValore(1,4,"Val")
tabR.SetValore(1,5,"$Acq")
cnt=2
for (w=1;w<arrGiocatoriA.length;w++) {
arrNomiGiocatori[w]='xg'+arrGiocatoriA[w].ID
}
for(i=1;i<arrRose.length;i++) {
if ((arrRose[i].IDSquadra==IDSquadra)&&(arrRose[i].Stato==0)) {
fatto=true
for (j=1;j<arrNomiGiocatori.length;j++) {
if (arrRose[i].Nome==arrNomiGiocatori[j]) {
arrCrediti[i]=arrGiocatoriA[j].Crediti
}
}
if ((cnt % 2) == 0) {
tabR.SetStileRiga(cnt,"RosaD")
} else {
tabR.SetStileRiga(cnt,"RosaP")
}
tabR.SetStile(cnt,1,"Cella")
tabR.SetStile(cnt,2,"Cella")
tabR.SetStile(cnt,3,"Cella")
tabR.SetStile(cnt,4,"CellaCentro")
tabR.SetStile(cnt,5,"CellaCentro")
sT="<span class='t-xxs"
if (arrRose[i].Ruolo==1) {
sR="G"
sT+="G'>Portiere</span>"
} else if (arrRose[i].Ruolo==2) {
sR="V"
sT+="V'>Difensore</span>"
} else if (arrRose[i].Ruolo==3) {
sR="R"
sT+="R'>Centrocampista</span>"
} else if (arrRose[i].Ruolo==4) {
sR="Blu"
sT+="Blu'>Attaccante</span>"
}
tabR.SetValore(cnt,1,sT)
tabR.SetValore(cnt,2,"<span class='t-xxs"+sR+"B'>"+arrRose[i].Nome+"</span>")
tabR.SetValore(cnt,3,"<span class='t-xxs"+sR+"'>"+arrRose[i].Squadra+"</span>")
tabR.SetValore(cnt,4,"<span class='t-xxs"+sR+"'>"+arrCrediti[i]+"</span>")
tabR.SetValore(cnt,5,"<span class='t-xxs"+sR+"B'>"+arrRose[i].Acq+"</span>")
cnt++
} else {
if ((fatto) && (arrRose[i].IDSquadra!=IDSquadra)) i=arrRose.length
//esce dal ciclo senza proseguire per tutte le altre
}
}
tabR.Stampa()
}