Vorlage:BV-BgPreisIndex
Aus BogenWiki
(Unterschied zwischen Versionen)
Nugman (Diskussion | Beiträge) |
Nugman (Diskussion | Beiträge) |
||
Zeile 18: | Zeile 18: | ||
BVBgList = Bogen; | BVBgList = Bogen; | ||
BVBgPreise = []; | BVBgPreise = []; | ||
+ | var aOptions = Param.Options.split(';'); | ||
+ | var aGroupBy = []; | ||
+ | for (o = 0; o < aOptions.length; o++) { | ||
+ | if (aOptions[o].split(':')[0] == 'GroupBy') | ||
+ | aGroupBy = aOptions[o].split(':')[1].split('+'); | ||
+ | } | ||
var sCellPadding = 'padding:0px; padding-left:4px; padding-right:4px;'; | var sCellPadding = 'padding:0px; padding-left:4px; padding-right:4px;'; | ||
var eBgList = document.getElementById('BVBgList.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr); | var eBgList = document.getElementById('BVBgList.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr); | ||
Zeile 54: | Zeile 60: | ||
if (BVBgList[b].Eingang.Preis == '?,??') bPreis = false; | if (BVBgList[b].Eingang.Preis == '?,??') bPreis = false; | ||
if (bPreis) { | if (bPreis) { | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
var sGroupByValue = ''; | var sGroupByValue = ''; | ||
for (g = 0; g < aGroupBy.length; g++) { | for (g = 0; g < aGroupBy.length; g++) { | ||
Zeile 100: | Zeile 100: | ||
if (eBgList) eBgList.innerHTML = sTabHTML; | if (eBgList) eBgList.innerHTML = sTabHTML; | ||
var eBgPreise = document.getElementById('BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr); | var eBgPreise = document.getElementById('BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
sTabHTML = '<table id="BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr+'.Tab" style="background:silver" cellpadding=1 cellspacing=1>'+ | sTabHTML = '<table id="BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr+'.Tab" style="background:silver" cellpadding=1 cellspacing=1>'+ | ||
' <tr style="background:#E0E0E0" valign=top>'; | ' <tr style="background:#E0E0E0" valign=top>'; | ||
Zeile 123: | Zeile 117: | ||
' <td align=center><div style="'+sCellPadding+'"><b>Anz.</b></div></td>'+ | ' <td align=center><div style="'+sCellPadding+'"><b>Anz.</b></div></td>'+ | ||
' </tr>'; | ' </tr>'; | ||
- | BVBgPreise.sort((a, b) => a.GroupValue > b.GroupValue ? 1 : -1); | + | if (BVBgPreise.length > 0) |
- | + | BVBgPreise.sort((a, b) => a.GroupValue > b.GroupValue ? 1 : -1); | |
- | + | for (var p = 0; p < BVBgPreise.length; p++) { | |
- | + | var aGroupValues = BVBgPreise[p].GroupValue.split('::'); | |
- | + | sTabHTML += ' <tr style="background:#FCFCFC" valign=top>'; | |
- | + | for (v = 0; v < aGroupValues.length-1; v++) | |
- | + | sTabHTML += ' <td><div style="'+sCellPadding+'">'+aGroupValues[v]+'</div></td>'; | |
- | + | sTabHTML += ' <td align=right><div style="'+sCellPadding+'">'+(BVBgPreise[p].Sum/BVBgPreise[p].Count).toFixed(2).replace(/\./,',')+'€</div></td>'+ | |
- | + | ' <td align=right><div style="'+sCellPadding+'">'+median(BVBgPreise[p].Preise).toFixed(2).replace(/\./,',')+'€</div></td>'+ | |
- | + | ' <td align=center><div style="'+sCellPadding+'">'+BVBgPreise[p].Min.toFixed(2).replace(/\./,',')+'€ - '+BVBgPreise[p].Max.toFixed(2).replace(/\./,',')+'€</div></td>'+ | |
- | + | ' <td align=center><div style="'+sCellPadding+'">'+BVBgPreise[p].Count+'</div></td>'+ | |
+ | ' </tr>'; | ||
+ | } | ||
+ | } else { | ||
+ | nColSpan = aGroupBy.length + 4; | ||
+ | sTabHTML += '<td align=left colspan='+nColSpan+'><div style="'+sCellPadding+'">Keine Auktionsergebnisse vorhanden</div></td>'; | ||
} | } | ||
sTabHTML += '</table>'; | sTabHTML += '</table>'; |
Version vom 18:51, 25. Sep. 2023
Template BV_BgPreisIndex: Invalid value for parameter Cmd ("empty")!!!