1// Oggetti JavaScript per Fantasquadre 2// Oggetto Fantasquadra 3function F(ID,Nome,Presidente,Telef1,Telef2,Telef3,Email,IDDivisione,CreditiResidui) { 4 this.ID = ID 5 this.Nome = Nome 6 this.Presidente = Presidente 7 this.Telef1 = Telef1 8 this.Telef2 = Telef2 9 this.Telef3 = Telef3 10 this.Email = Email 11 this.IDDivisione = IDDivisione 12 this.CreditiResidui = CreditiResidui 13} 14 15// Fantasquadra Extra lega 16function FE(ID,IDLega,Nome) { 17 this.ID = ID 18 this.IDLega = IDLega 19 this.Nome = Nome 20} 21// Rosa 22function R(IDSquadra,Ruolo,Nome,Squadra,Extracom,Stato,Contratto,Acq,Svinc,GioInf) { 23 this.IDSquadra = IDSquadra 24 this.Ruolo = Ruolo 25 this.Nome = Nome 26 this.Squadra = Squadra 27 this.Extracom = Extracom 28 this.Stato = Stato // vale 0 per rosa, 1 per svincolati, 2 per infortunati 29 this.Contratto = Contratto // vale -1 per i infortunati, -2 per prestito 30 this.Acq = Acq 31 this.Svinc = Svinc 32 this.GioInf = GioInf 33} 34// Bilancio 35function B(IDSquadra,Descrizione,Valore,Data) { 36 this.IDSquadra = IDSquadra 37 this.Descrizione = Descrizione 38 this.Valore = Valore 39 this.Data = Data 40} 41 42// Campi Personali 43function CP(IDSquadra,Tipo,Nome,Valore,IDDocumento) { 44 this.IDSquadra = IDSquadra 45 this.Tipo = Tipo 46 this.Nome = Nome 47 this.Valore = Valore 48 this.IDDocumento = IDDocumento 49} 50 51function GeneraIntestazioneFantasquadre(cFsq) { 52var arrF = new Object() 53arrF = arrFantasquadre 54document.write("<form name='frmFsq' id='frmFsq' action='rose.htm' method='get'>") 55document.write("<table width='100%' border='00' cellspacing='0' cellpadding='0'>") 56document.write("<tr><td width='5%' class='testo-10'><nobr> Fantasquadra: <select name='Fsq' class='testo-10' id='Fsq'>") 57for (i=1;i<arrF.length;i++) { 58 document.write("<option value='" + arrF[i].ID + "'") 59 if (arrF[i].ID == cFsq) document.write(" selected") 60 document.write(">" + arrF[i].Nome + "</option>") 61} 62document.write("</select></nobr></td>") 63document.write("<td width='95%' class='testo-10'> <input name='Invia' type='submit' class='testo-10' id='Invia' value=' Vai '></td>") 64document.write("</tr></table></form>") 65} 66 67function GeneraSquadra(IDSquadra) { 68var tabS = new Tabella(2,2) 69var i,iD,isDivisione=0,cnt,j,k 70 i=1 71 while (arrFantasquadre[i].ID != IDSquadra) { 72 i++ 73 } 74 if (arrFantasquadre[i].IDDivisione != 0) { 75 isDivisione=1 76 iD=1 77 while (arrDivisioni[iD].ID != arrFantasquadre[i].IDDivisione) { 78 iD++ 79 } 80 } 81 tabS.SetStileRiga(1,"riga-blu") 82 tabS.SetStile(1,1,"testo-dx") 83 tabS.SetValore(1,1,"Squadra: ") 84// tabS.SetStile(1,2,"riga-blu") 85 tabS.SetValore(1,2," "+arrFantasquadre[i].Nome) 86 if (isDivisione == 1) { 87 tabS.SetStileRiga(2,"riga-blu") 88 tabS.SetStile(2,1,"testo-dx") 89 tabS.SetValore(2,1,"Divisione: ") 90// tabS.SetStile(2,2,"Cella") 91 tabS.SetValore(2,2," "+arrDivisioni[iD].Nome) 92 } 93 tabS.SetStileRiga(isDivisione+2,"riga-dispari") 94 tabS.SetStile(isDivisione+2,1,"testo-bold-dx") 95 tabS.SetValore(isDivisione+2,1,"Presidente: ") 96// tabS.SetStile(isDivisione+2,2,"Cella") 97 tabS.SetValore(isDivisione+2,2," "+arrFantasquadre[i].Presidente) 98 tabS.SetStileRiga(isDivisione+3,"riga-pari") 99 tabS.SetStile(isDivisione+3,1,"testo-bold-dx") 100 tabS.SetValore(isDivisione+3,1,"Tel. casa: ") 101// tabS.SetStile(isDivisione+3,2,"Cella") 102 tabS.SetValore(isDivisione+3,2," "+arrFantasquadre[i].Telef1) 103 tabS.SetStileRiga(isDivisione+4,"riga-dispari") 104 tabS.SetStile(isDivisione+4,1,"testo-bold-dx") 105 tabS.SetValore(isDivisione+4,1,"Tel. lavoro: ") 106// tabS.SetStile(isDivisione+4,2,"Cella") 107 tabS.SetValore(isDivisione+4,2," "+arrFantasquadre[i].Telef2) 108 tabS.SetStileRiga(isDivisione+5,"riga-pari") 109 tabS.SetStile(isDivisione+5,1,"testo-bold-dx") 110 tabS.SetValore(isDivisione+5,1,"Cellulare: ") 111// tabS.SetStile(isDivisione+5,2,"Cella") 112 tabS.SetValore(isDivisione+5,2," "+arrFantasquadre[i].Telef3) 113 tabS.SetStileRiga(isDivisione+6,"riga-dispari") 114 tabS.SetStile(isDivisione+6,1,"testo-bold-dx") 115 tabS.SetValore(isDivisione+6,1,"eMail: ") 116// tabS.SetStile(isDivisione+6,2,"Cella") 117 tabS.SetValore(isDivisione+6,2," <a href='mailto:" + arrFantasquadre[i].Email+"'>"+arrFantasquadre[i].Email+"</a>") 118 tabS.SetStileRiga(isDivisione+7,"riga-pari") 119 tabS.SetStile(isDivisione+7,1,"testo-bold-dx") 120 tabS.SetValore(isDivisione+7,1,"Crediti Residui: ") 121// tabS.SetStile(isDivisione+7,2,"Cella") 122 tabS.SetValore(isDivisione+7,2," " + arrFantasquadre[i].CreditiResidui) 123 cnt=0 124 for (j=1;j<arrCampiPersonali.length;j++) { 125 if (arrCampiPersonali[j].IDSquadra == arrFantasquadre[i].ID) { 126 cnt++ 127 tabS.SetStileRiga(isDivisione+7+cnt,"riga-orange") 128 tabS.SetStile(isDivisione+7+cnt,1,"testo-dx") 129 tabS.SetValore(isDivisione+7+cnt,1,arrCampiPersonali[j].Nome + ": ") 130// tabS.SetStile(isDivisione+7+cnt,2,"Cella") 131 if (arrCampiPersonali[j].Tipo==0) { 132 tabS.SetValore(isDivisione+7+cnt,2," " + arrCampiPersonali[j].Valore) 133 } else { 134 k=1 135 while ((k<arrDocumenti.length) && (arrDocumenti[k].ID != arrCampiPersonali[j].IDDocumento)) { 136 k++ 137 } 138 if (arrDocumenti[k].ID == arrCampiPersonali[j].IDDocumento) { 139 tabS.SetValore(isDivisione+7+cnt,2," <a href='doc/" + arrDocumenti[k].Nomefile + "'>" + arrDocumenti[k].Descrizione + "</a>") 140 } else { 141 tabS.SetValore(isDivisione+7+cnt,2," Documento non trovato") 142 } 143 } 144 } 145 } 146 tabS.nome = "Squadra" 147 tabS.larghezza=50 148 tabS.border=1 149 tabS.cellpadding=3 150 tabS.cellspacing=0 151 tabS.stile="tab-8" 152 tabS.SetLarghezzaColonna(1,30) 153 tabS.SetLarghezzaColonna(2,70) 154 tabS.Stampa() 155} 156 157function GeneraRosa(IDSquadra) { 158var tabR = new Tabella(2,5) 159var i,cnt,sT,sR,fatto 160 fatto=false 161 tabR.nome="Rosa" 162 tabR.larghezza=95 163 tabR.border=1 164 tabR.cellpadding=3 165 tabR.cellspacing=0 166 tabR.stile="tab-8" 167 tabR.SetLarghezzaColonna(1,10) 168 tabR.SetLarghezzaColonna(2,60) 169 tabR.SetLarghezzaColonna(3,20) 170 tabR.SetLarghezzaColonna(4,4) 171 tabR.SetLarghezzaColonna(5,6) 172 tabR.SetStileRiga(1,"riga-blu") 173/* 174 tabR.SetStile(1,1,"Cella") 175 tabR.SetStile(1,2,"Cella") 176 tabR.SetStile(1,3,"Cella") 177*/ 178 tabR.SetStile(1,4,"testo-cx") 179 tabR.SetStile(1,5,"testo-cx") 180 tabR.SetValore(1,1,"Ruolo") 181 tabR.SetValore(1,2,"Nome") 182 tabR.SetValore(1,3,"Squadra") 183 tabR.SetValore(1,4,"Con") 184 tabR.SetValore(1,5,"$Acq") 185 cnt=2 186 for(i=1;i<arrRose.length;i++) { 187 if ((arrRose[i].IDSquadra==IDSquadra)&&(arrRose[i].Stato==0)) { 188 fatto=true 189 if ((cnt % 2) == 0) { 190 tabR.SetStileRiga(cnt,"riga-dispari") 191 } else { 192 tabR.SetStileRiga(cnt,"riga-pari") 193 } 194/* 195 tabR.SetStile(cnt,1,"Cella") 196 tabR.SetStile(cnt,2,"Cella") 197 tabR.SetStile(cnt,3,"Cella") 198*/ 199 tabR.SetStile(cnt,4,"testo-cx") 200 tabR.SetStile(cnt,5,"testo-cx") 201 sT="<span class='testo-" 202 if (arrRose[i].Ruolo==1) { 203 sR="oliva" 204 sT+="oliva'>Portiere</span>" 205 } else if (arrRose[i].Ruolo==2) { 206 sR="verde" 207 sT+="verde'>Difensore</span>" 208 } else if (arrRose[i].Ruolo==3) { 209 sR="rosso" 210 sT+="rosso'>Centrocampista</span>" 211 } else if (arrRose[i].Ruolo==4) { 212 sR="blu" 213 sT+="blu'>Attaccante</span>" 214 } 215 tabR.SetValore(cnt,1,sT) 216 tabR.SetValore(cnt,2,"<span class='testo-"+sR+"-bold'>"+arrRose[i].Nome+"</span>") 217 tabR.SetValore(cnt,3,"<span class='testo-"+sR+"'>"+arrRose[i].Squadra+"</span>") 218 tabR.SetValore(cnt,4,"<span class='testo-"+sR+"'>"+(arrRose[i].Contratto==-2?"Pres":arrRose[i].Contratto)+"</span>") 219 tabR.SetValore(cnt,5,"<span class='testo-"+sR+"-bold'>"+arrRose[i].Acq+"</span>") 220 cnt++ 221 } else { 222 if ((fatto) && (arrRose[i].IDSquadra!=IDSquadra)) i=arrRose.length 223 //esce dal ciclo senza proseguire per tutte le altre 224 } 225 } 226 tabR.Stampa() 227} 228 229function GeneraVendutiInfortunati(IDSquadra) { 230var tabV = new Tabella(2,5) 231var tabI = new Tabella(2,6) 232var i,cnt,sT,sR,fatto 233 fatto=false 234 tabV.Nome="Svincolati" 235 tabV.larghezza=95 236 tabV.border=1 237 tabV.cellpadding=3 238 tabV.cellspacing=0 239 tabV.stile="tab-8" 240 tabV.SetLarghezzaColonna(1,10) 241 tabV.SetLarghezzaColonna(2,60) 242 tabV.SetLarghezzaColonna(3,20) 243 tabV.SetLarghezzaColonna(4,4) 244 tabV.SetLarghezzaColonna(5,6) 245 tabV.SetStileRiga(1,"riga-blu") 246 tabV.SetSpan(1,1,5) 247 tabV.SetSpanned(1,2,true) 248 tabV.SetSpanned(1,3,true) 249 tabV.SetSpanned(1,4,true) 250 tabV.SetSpanned(1,5,true) 251 tabV.SetValore(1,1,"Svincolati") 252 tabV.SetStileRiga(2,"riga-blu") 253/* 254 tabV.SetStile(2,1,"Cella") 255 tabV.SetStile(2,2,"Cella") 256 tabV.SetStile(2,3,"Cella") 257*/ 258 tabV.SetStile(2,4,"testo-cx") 259 tabV.SetStile(2,5,"testo-cx") 260 tabV.SetValore(2,1,"Ruolo") 261 tabV.SetValore(2,2,"Nome") 262 tabV.SetValore(2,3,"Squadra") 263 tabV.SetValore(2,4,"Con") 264 tabV.SetValore(2,5,"$Acq") 265 cnt=3 266 for(i=1;i<arrRose.length;i++) { 267 if ((arrRose[i].IDSquadra==IDSquadra)&&(arrRose[i].Stato==1)) { 268 fatto=true 269 if ((cnt % 2) == 0) { 270 tabV.SetStileRiga(cnt,"riga-dispari") 271 } else { 272 tabV.SetStileRiga(cnt,"riga-pari") 273 } 274/* 275 tabV.SetStile(cnt,1,"Cella") 276 tabV.SetStile(cnt,2,"Cella") 277 tabV.SetStile(cnt,3,"Cella") 278*/ 279 tabV.SetStile(cnt,4,"testo-cx") 280 tabV.SetStile(cnt,5,"testo-cx") 281 sT="<span class='testo-" 282 if (arrRose[i].Ruolo==1) { 283 sR="oliva" 284 sT+="oliva'>Portiere</span>" 285 } else if (arrRose[i].Ruolo==2) { 286 sR="verde" 287 sT+="verde'>Difensore</span>" 288 } else if (arrRose[i].Ruolo==3) { 289 sR="rosso" 290 sT+="rosso'>Centrocampista</span>" 291 } else if (arrRose[i].Ruolo==4) { 292 sR="blu" 293 sT+="blu'>Attaccante</span>" 294 } 295 tabV.SetValore(cnt,1,sT) 296 tabV.SetValore(cnt,2,"<span class='testo-"+sR+"-bold'>"+arrRose[i].Nome+"</span>") 297 tabV.SetValore(cnt,3,"<span class='testo-"+sR+"'>"+arrRose[i].Squadra+"</span>") 298 tabV.SetValore(cnt,4,"<span class='testo-"+sR+"'>"+(arrRose[i].Contratto==-1?"Inf":(arrRose[i].Contratto==-2?"Pres":arrRose[i].Contratto))+"</span>") 299 tabV.SetValore(cnt,5,"<span class='testo-"+sR+"-bold'>"+arrRose[i].Acq+"</span>") 300 cnt++ 301 } else { 302 if ((fatto) && (arrRose[i].IDSquadra!=IDSquadra)) i=arrRose.length 303 //esce dal ciclo senza proseguire per tutte le altre 304 } 305 } 306 tabV.Stampa() 307 document.write("<br>") 308 tabI.Nome="Infortunati" 309 tabI.larghezza=95 310 tabI.border=1 311 tabI.cellpadding=3 312 tabI.cellspacing=0 313 tabI.stile="tab-8" 314 tabI.SetLarghezzaColonna(1,10) 315 tabI.SetLarghezzaColonna(2,52) 316 tabI.SetLarghezzaColonna(3,20) 317 tabI.SetLarghezzaColonna(4,4) 318 tabI.SetLarghezzaColonna(5,6) 319 tabI.SetLarghezzaColonna(6,8) 320 tabI.SetStileRiga(1,"riga-blu") 321 tabI.SetSpan(1,1,6) 322 tabI.SetSpanned(1,2,true) 323 tabI.SetSpanned(1,3,true) 324 tabI.SetSpanned(1,4,true) 325 tabI.SetSpanned(1,5,true) 326 tabI.SetSpanned(1,6,true) 327 tabI.SetValore(1,1,"Infortunati") 328 tabI.SetStileRiga(2,"riga-blu") 329/* 330 tabI.SetStile(2,1,"Cella") 331 tabI.SetStile(2,2,"Cella") 332 tabI.SetStile(2,3,"Cella") 333*/ 334 tabI.SetStile(2,4,"testo-cx") 335 tabI.SetStile(2,5,"testo-cx") 336 tabI.SetStile(2,6,"testo-cx") 337 tabI.SetValore(2,1,"Ruolo") 338 tabI.SetValore(2,2,"Nome") 339 tabI.SetValore(2,3,"Squadra") 340 tabI.SetValore(2,4,"Con") 341 tabI.SetValore(2,5,"$Acq") 342 tabI.SetValore(2,6,"Gio") 343 cnt=3 344 fatto=false 345 for(i=1;i<arrRose.length;i++) { 346 if ((arrRose[i].IDSquadra==IDSquadra)&&(arrRose[i].Stato==2)) { 347 fatto=true 348 if ((cnt % 2) == 0) { 349 tabI.SetStileRiga(cnt,"riga-dispari") 350 } else { 351 tabI.SetStileRiga(cnt,"riga-pari") 352 } 353/* 354 tabI.SetStile(cnt,1,"Cella") 355 tabI.SetStile(cnt,2,"Cella") 356 tabI.SetStile(cnt,3,"Cella") 357*/ 358 tabI.SetStile(cnt,4,"testo-cx") 359 tabI.SetStile(cnt,5,"testo-cx") 360 tabI.SetStile(cnt,6,"testo-cx") 361 sT="<span class='testo-" 362 if (arrRose[i].Ruolo==1) { 363 sR="oliva" 364 sT+="oliva'>Portiere</span>" 365 } else if (arrRose[i].Ruolo==2) { 366 sR="verde" 367 sT+="verde'>Difensore</span>" 368 } else if (arrRose[i].Ruolo==3) { 369 sR="rosso" 370 sT+="rosso'>Centrocampista</span>" 371 } else if (arrRose[i].Ruolo==4) { 372 sR="blu" 373 sT+="blu'>Attaccante</span>" 374 } 375 tabI.SetValore(cnt,1,sT) 376 tabI.SetValore(cnt,2,"<span class='testo-"+sR+"-bold'>"+arrRose[i].Nome+"</span>") 377 tabI.SetValore(cnt,3,"<span class='testo-"+sR+"'>"+arrRose[i].Squadra+"</span>") 378 tabI.SetValore(cnt,4,"<span class='testo-"+sR+"'>"+(arrRose[i].Contratto==-1?"Inf":(arrRose[i].Contratto==-2?"Pres":arrRose[i].Contratto))+"</span>") 379 tabI.SetValore(cnt,5,"<span class='testo-"+sR+"-bold'>"+arrRose[i].Acq+"</span>") 380 tabI.SetValore(cnt,6,"<span class='testo-"+sR+"'>"+arrRose[i].GioInf+"</span>") 381 cnt++ 382 } else { 383 if ((fatto) && (arrRose[i].IDSquadra!=IDSquadra)) i=arrRose.length 384 //esce dal ciclo senza proseguire per tutte le altre 385 } 386 } 387 tabI.Stampa() 388 389} 390 391function GeneraBilancio(IDSquadra) { 392var tabB = new Tabella(2,4) 393var i,cnt,sT,sR,fatto 394 fatto=false 395 tabB.nome="Bilancio" 396 tabB.larghezza=95 397 tabB.border=1 398 tabB.cellpadding=3 399 tabB.cellspacing=0 400 tabB.stile="tab-8" 401 tabB.SetLarghezzaColonna(1,60) 402 tabB.SetLarghezzaColonna(2,10) 403 tabB.SetLarghezzaColonna(3,10) 404 tabB.SetLarghezzaColonna(4,20) 405 tabB.SetStileRiga(1,"riga-blu") 406// tabB.SetStile(1,1,"Cella") 407 tabB.SetStile(1,2,"testo-cx") 408 tabB.SetStile(1,3,"testo-cx") 409 tabB.SetStile(1,4,"testo-cx") 410 tabB.SetValore(1,1,"Descrizione") 411 tabB.SetValore(1,2,"Entrata") 412 tabB.SetValore(1,3,"Uscita") 413 tabB.SetValore(1,4,"Data") 414 cnt=2 415 for(i=1;i<arrBilanci.length;i++) { 416 if (arrBilanci[i].IDSquadra==IDSquadra) { 417 fatto=true 418 if ((cnt % 2) == 0) { 419 tabB.SetStileRiga(cnt,"riga-dispari") 420 } else { 421 tabB.SetStileRiga(cnt,"riga-pari") 422 } 423// tabB.SetStile(cnt,1,"Cella") 424 tabB.SetStile(cnt,2,"testo-cx") 425 tabB.SetStile(cnt,3,"testo-cx") 426 tabB.SetStile(cnt,4,"testo-cx") 427 tabB.SetValore(cnt,1,arrBilanci[i].Descrizione) 428 tabB.SetValore(cnt,2,arrBilanci[i].Valore>=0?"<span class='testo-verde-bold'>"+arrBilanci[i].Valore+"</span>":"") 429 tabB.SetValore(cnt,3,arrBilanci[i].Valore<0?"<span class='testo-rosso-bold'>"+(-arrBilanci[i].Valore)+"</span>":"") 430 tabB.SetValore(cnt,4,arrBilanci[i].Data) 431 cnt++ 432 } else { 433 if ((fatto) && (arrBilanci[i].IDSquadra!=IDSquadra)) i=arrBilanci.length 434 //esce dal ciclo senza proseguire per tutte le altre 435 } 436 } 437 i=1 438 while (arrFantasquadre[i].ID != IDSquadra) { 439 i++ 440 } 441 tabB.SetStileRiga(cnt,"riga-blu-dx") 442 tabB.SetValore(cnt,1,"Crediti Residui: " + arrFantasquadre[i].CreditiResidui) 443 tabB.Stampa() 444}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.