diff --git a/html/_layouts/default.php b/html/_layouts/default.php index e5501bb4b568cb2497dbaac4ec609820a322f3db..1482352a5d7f3daff842bcbced54dc2ad7b136a2 100644 --- a/html/_layouts/default.php +++ b/html/_layouts/default.php @@ -198,6 +198,7 @@ if( !empty($csv) ){ <th>Hist.</th> <th>Tore</th> <th>Dif</th> + <th>Zwk</th> <th>Pkt.</th> </tr> </thead> diff --git a/html/assets/css/custom.scss b/html/assets/css/custom.scss index 5bce0e642e28bbe2bf41dc05b1a4b963e7280db8..024e1b2893f48d47f875aba436fa09d9d53cb68f 100644 --- a/html/assets/css/custom.scss +++ b/html/assets/css/custom.scss @@ -221,13 +221,14 @@ tr.stats { &:nth-child(3) { width: 220px; } &:nth-child(4), &:nth-child(5), - &:nth-child(5), - &:nth-child(6), + &:nth-child(6){ width: 15px; text-align: center; font-size: 0.9em; } &:nth-child(7), &:nth-child(8){ width: 15px; text-align: center; } &:nth-child(9), - &:nth-child(11), - &:nth-child(12){ width: 20px; } + &:nth-child(11){ width: 40px; } + &:nth-child(12){ width: 30px; } + &:nth-child(13){ width: 30px; font-size: 0.8em; } + &:nth-child(14){ width: 20px; } &:nth-child(6){ width: 20px; padding-right: 10px; } &:nth-child(10){ width: 40px; } } diff --git a/html/assets/js/script.js b/html/assets/js/script.js index 7b03983540c7597f6c9608b3c2f2ed7575d6f0b8..84c2ec780f757aa82fbbfbd5c19fc893b0734b80 100644 --- a/html/assets/js/script.js +++ b/html/assets/js/script.js @@ -357,7 +357,7 @@ function calculatePunktestand(saison,runde,show=true){ $.each( TEAMS, function( i,v ){ //if( v[saison] == undefined ) - TEAMS[i][saison] = { P: 0, Tp: 0, Tn: 0, Td: 0, Tr: ['X'], active: (( TEAMS[i].start <= saison )) } + TEAMS[i][saison] = { P: 0, Tp: 0, Tn: 0, Td: 0, Tr: ['X'], Zwk: 0, active: (( TEAMS[i].start <= saison )) } } ); @@ -394,6 +394,16 @@ function calculatePunktestand(saison,runde,show=true){ } H.Tp+=parseInt(v.TH); H.Tn+=parseInt(v.TA); H.Td=H.Tp-H.Tn; A.Tp+=parseInt(v.TA); A.Tn+=parseInt(v.TH); A.Td=A.Tp-A.Tn; + STAT_ALL.filter((b) => ( b.MID == v.MID && v.H == b.nt )).forEach( + function(c){ + H.Zwk+=c.Zwk*1; + } + ); + STAT_ALL.filter((b) => ( b.MID == v.MID && v.A == b.nt )).forEach( + function(c){ + A.Zwk+=c.Zwk*1; + } + ); } ); @@ -435,13 +445,17 @@ function calculatePunktestand(saison,runde,show=true){ if( t.length == 0 ) t.push(0); + var S=t.reduce( (a,b) => a+b ); + var pokal=ERGEBNISSE.filter((a) => ( a.runde=='F' && ( parseInt(a.TH) > parseInt(a.TA) && a.H.toLowerCase() == v.nt.toLowerCase() || parseInt(a.TH) < parseInt(a.TA) && a.A.toLowerCase() == v.nt.toLowerCase() ) ) ).length; + var meistertitel=calculateAllPunktestand().filter((a) => ( a[0].nt == v.nt.toLowerCase() ) ).length; + var finalist=( calculateAllPunktestand().filter((a) => ( a[1].nt == v.nt.toLowerCase() ) ).length + ERGEBNISSE.filter((a) => ( a.runde=='F' && ( a.H.toLowerCase() == v.nt.toLowerCase() && a.TH < a.TA || a.A.toLowerCase() == v.nt.toLowerCase() && a.TH > a.TA ) ) ).length ); - tmp+='<td class="'+border+'">'+t.reduce( (a,b) => a+b )+'</td>'; + tmp+='<td class="'+border+'">'+S+'</td>'; tmp+='<td class="'+border+'"><img class="flags" src="./images/flags/'+(( v.flag ) ? v.flag : v.nt.toLowerCase())+'.svg"> <a href="javascript:calculateTeam('+((saison == 0) ? SAISON_NOW : saison)+',\''+v.nt+'\')">'+v.name.replace(/\(NL\)/g,'<sup>'+v.nt.toUpperCase()+'</sup></a>')+' <a href="'+v.link+'" target="ultrasoccer"><i class="fas fa-link"></i></a>'+(( trophy.toLowerCase() == v.nt.toLowerCase() ) ? ' <i class="fas fa-trophy"></i>' : '') + ' '+(( master.toLowerCase() == v.nt.toLowerCase() ) ? ' <i class="fas fa-crown"></i>' : '') +'</td>'; - tmp+='<td class="'+border+'">'+ERGEBNISSE.filter((a) => ( a.runde=='F' && ( parseInt(a.TH) > parseInt(a.TA) && a.H.toLowerCase() == v.nt.toLowerCase() || parseInt(a.TH) < parseInt(a.TA) && a.A.toLowerCase() == v.nt.toLowerCase() ) ) ).length+'</td>'; - tmp+='<td class="'+border+'">'+calculateAllPunktestand().filter((a) => ( a[0].nt == v.nt.toLowerCase() ) ).length+'</td>'; - tmp+='<td class="'+border+'">'+( calculateAllPunktestand().filter((a) => ( a[1].nt == v.nt.toLowerCase() ) ).length + ERGEBNISSE.filter((a) => ( a.runde=='F' && ( a.H.toLowerCase() == v.nt.toLowerCase() && a.TH < a.TA || a.A.toLowerCase() == v.nt.toLowerCase() && a.TH > a.TA ) ) ).length )+'</td>'; + tmp+='<td class="'+border+'">'+((pokal>0) ? pokal : '')+'</td>'; + tmp+='<td class="'+border+'">'+((meistertitel>0) ? meistertitel : '')+'</td>'; + tmp+='<td class="'+border+'">'+((finalist>0) ? finalist : '')+'</td>'; tmp+='<td class="'+border+'">'+v[saison].Tr.map( (a) => ( ( a == 'S') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>'; tmp+='<td class="'+border+'">'+v[saison].Tr.map( (a) => ( ( a == 'U') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>'; tmp+='<td class="'+border+'">'+v[saison].Tr.map( (a) => ( ( a == 'N') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>'; @@ -449,6 +463,7 @@ function calculatePunktestand(saison,runde,show=true){ tmp+='<td class="'+border+'">'+hist+'</td>'; tmp+='<td class="'+border+'">'+v[saison].Tp+'/'+v[saison].Tn+'</td>'; tmp+='<td class="'+((v[saison].Td > 0 ) ? 'p' : (v[saison].Td == 0 ) ? 'u' : 'n')+' '+border+'">'+((v[saison].Td > 0 ) ? '+' : '') + v[saison].Td+'</td>'; + tmp+='<td class="'+((v[saison].Zwk > 0 ) ? 'p' : (v[saison].Zwk == 0 ) ? 'u' : 'n')+' '+border+'">'+(v[saison].Zwk > 0 ? '+' : '')+(v[saison].Zwk / S).toFixed(2) +'</td>'; tmp+='<td class="'+border+'">'+v[saison].P+'</td>'; $(tabelle).append('<tr>'+tmp+'</tr>'); }