function listParticipantOnly(i) { let a= {}; a.index=String(i); let xhr = new XMLHttpRequest(); let url = "https://reg.rdu.ru/proam/jsonlistparticipant.php"; xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { let s=this.responseText; let listis = JSON.parse(s); let l=''; let ispro = ''; let isstud=''; let isclub=''; let iscity=''; let iscountry=''; let stateShow=false; let isPayed = false; listis.forEach(c=>{ if (ispro!=c.pro || isstud!=c.student) { if (stateShow && ispro!=="" && isstud!=="") { let bi = (!isPayed)?'':''; let ei = (!isPayed)?'':''; let be = (!isPayed)?'':''; let ee = ''; l=l+'
'; l=l+'
'+bi+ispro+ei+'
'+bi+isstud+ei+'
'; l=l+'
'+be+isclub+ee+'
'+be+iscity+', '+iscountry+ee+'
'; l=l+'
'; } ispro=c.pro; isstud=c.student; isclub=c.club; iscity=c.city; iscountry=c.country; stateShow = false; isPayed = false; } if (c.status==1 || c.status==2) { stateShow = true; if (c.status==2) { isPayed = true; } } }); if (stateShow) { // print last let bi = (!isPayed)?'':''; let ei = (!isPayed)?'':''; let be = (!isPayed)?'':''; let ee = ''; l=l+'
'; l=l+'
'+bi+ispro+ei+'
'+bi+isstud+ei+'
'; l=l+'
'+be+isclub+ee+'
'+be+iscity+', '+iscountry+ee+'
'; l=l+'
'; } document.getElementById("listPartisipant").innerHTML =l; } } }; xhr.send(JSON.stringify(a)); document.getElementById("trass").innerHTML = ' '; }