var frissitesStart = Math.round(new Date().getTime()/1000); var frissitesAlertVisible = false; function checkFrissites() { var timeout = 90; var now = Math.round(new Date().getTime()/1000); if ((now - timeout) > frissitesStart) { if (!frissitesAlertVisible) { $('#frissites_alert').fadeOut(200); $('#frissites_alert').fadeIn(200); $('#frissites_alert').fadeOut(200); $('#frissites_alert').fadeIn(200); $('#frissites_alert').fadeOut(200); $('#frissites_alert').fadeIn(200); $.get('ar_frissit_timeout.php'); frissitesAlertVisible = true; } } else { $('#frissites_alert').hide(); frissitesAlertVisible = false; } } var lpOnComplete = function(response) { var xml = $(response).find("response"); if (xml.size()>0) { xml.find("record").each(function(index, element){ var aukcio_id = $(this).find('aukcio_id').text(); var now = $(this).find('now').text(); var lejarat = $(this).find('lejarat').text(); var aktualis_licit = $(this).find('aktualis_licit').text(); var uj_ajanlat = $(this).find('uj_ajanlat').text(); var sajat_aktualis = $(this).find('sajat_aktualis').text(); var tullicitalva = $(this).find('tullicitalva').text(); var negyzetmeter_ar = $(this).find('negyzetmeter_ar').text(); //adatlap form $('#min_netto_licit_ar').val(aktualis_licit); $('#legnagyobb_licit').val(aktualis_licit); $('#sajat_legnagyobb_licit').val(sajat_aktualis); $("#timer").attr("data-endtime", lejarat); $("#timer").attr("data-starttime", now); $("#timer").attr("data-firstrun", "1"); if (sajat_aktualis > 0) { if (tullicitalva == 1) { $('a[id=licit_' + aukcio_id + ']').css('background', '#F2DEDE'); $('[id=licit_' + aukcio_id + '] .tullicitalva').css('display', ''); $('[id=licit_' + aukcio_id + '] .legmagasabban_licitalo').css('display', 'none'); } else { $('a[id=licit_' + aukcio_id + ']').css('background', '#DFF0D8'); $('[id=licit_' + aukcio_id + '] .tullicitalva').css('display', 'none'); $('[id=licit_' + aukcio_id + '] .legmagasabban_licitalo').css('display', ''); } } aktualis_licit = number_format(aktualis_licit, 0, '.', ' '); uj_ajanlat = number_format(uj_ajanlat, 0, '.', ' '); sajat_aktualis = number_format(sajat_aktualis, 0, '.', ' '); negyzetmeter_ar = number_format(negyzetmeter_ar, 0, '.', ' '); $('span[id=aktualis_licit_' + aukcio_id + ']').text(aktualis_licit); $('[id=licit_' + aukcio_id + '] .min_netto_licit_ar').html(aktualis_licit); $('[id=licit_' + aukcio_id + '] .aktualis_licit').html(aktualis_licit); $('[id=licit_' + aukcio_id + '] .negyzetmeter_ar').html(negyzetmeter_ar); $('[id=licit_' + aukcio_id + '] .sajat_legnagyobb_licit').html(sajat_aktualis); $('div[id=arvaltozas_' + aukcio_id + ']').fadeOut(200); $('div[id=arvaltozas_' + aukcio_id + ']').fadeIn(200); $('div[id=arvaltozas_' + aukcio_id + ']').fadeOut(200); $('div[id=arvaltozas_' + aukcio_id + ']').fadeIn(200); $('div[id=arvaltozas_' + aukcio_id + ']').fadeOut(200); $('div[id=arvaltozas_' + aukcio_id + ']').fadeIn(200); }); } frissitesStart = Math.round(new Date().getTime()/1000); setTimeout('lpStart()',1000); }; var lpStart = function() { var p_xml = ''; var thisVal = new String(); var thisID = new String(); var counter = 0; $.each($('[data-licit=1]'), function(){ if ($(this).attr('id').match(/licit_[0-9]+/)) { counter++; thisVal = $(this).find('.min_netto_licit_ar').html(); thisVal = thisVal.replace(',',''); thisVal = thisVal.replace('.',''); thisID = $(this).attr('id').substring(6); p_xml += ''; p_xml += '' + thisID + ''; p_xml += '' + thisVal.replace(/\s+/g, '') + ''; p_xml += ''; } }); p_xml += ''; if (counter > 0) { if ($('#frissites_alert').length>0) { setInterval('checkFrissites()',1000); } var ts = (new Date).getTime(); $.post('https://www.cibingatlanaukcio.hu/ar_frissit_mq.php?ts='+ts, {p_user_id: '', p_xml:p_xml, token:'47a2e1182c002796804aa342763a3048'}, lpOnComplete, 'xml'); } };