var aph = new Array(); aph[1] = ["Venture Industries", "Mokra 27, Łomianki-Kiełpin", "http://www.venture.pl", "venture@venture.pl"]; aph[10677] = ["Ampar Silesia", "ul. Przemysłowa 55, 43-100 Tychy", "http://www.ampar-silesia.pl", "biuro@ampar-silesia.pl"]; aph[11663] = ["AMSTER GLOBAL SP. Z O.O.", "Obrońców Modlina 9, 30-733 Kraków", "http://www.amster.pl", "biuro@amster.pl"]; aph[38039] = ["4MM", "Skośna 12, 12-345 Kraków", "", "biuro@4multimedia.pl"]; aph[38053] = ["MK-WENT SP. Z O.O. SPÓŁKA KOMANDYTOWA", "Trakt Lubelski 195, 04-667 Warszawa", "", "wentylatory@mkwent.com.pl"]; aph[38071] = ["", "BORECKA 4B, 03-034 WARSZAWA", "", "hubert.cwil@hts.com.PL"]; aph[39271] = ["Ampar-Silesia", "Przemysłowa 55, 43-100 Tychy", "", "rp@ampar-silesia.pl"]; aph[39314] = ["DEKA IZOLACJE I WENTYLACJE SP.J", "Słoneczny Sad 29B, 72-002 Dołuje", "", "a.janicka@deka.com.pl"]; aph[39357] = ["", "Świerczewska 5, 71-066 Szczecin", "", "sklep@veco.com.pl"]; aph[39524] = ["DABROWENT WENTYLACJA KLIMATYZACJA KATARZYNA DĄBROWSKA", "KRZYWCA 9, 85-862 Bydgoszcz", "", "monika.kopta@dabrowent.pl"]; aph[39625] = ["", "Bohaterów Getta 52, 41-219 Sosnowiec", "", "magda.magiera@klimasystem.info.pl"]; aph[39813] = ["Klimazbyt Toruń Sp. z o.o.", "Chrobrego 145, 87-100 toruń", "", "torun@klimazbyt.pl"]; aph[40069] = ["> MAXIMA Północ -GDYNIA", "|| tel. 58-667-00-07 || , 81-061 ul.Hutnicza 18A", "", "julian@maxima-polnoc.pl"]; aph[40086] = ["", "Graniczna 15, 62-007 Biskupice", "", "jakub@bud-went.com.pl"]; aph[40157] = ["Klimazbyt Łódź", "Piłsudskiego 092, 92-202 Łódź", "", "lodz@klimazbyt.pl"]; aph[40185] = ["", "Przemysłowa 11, 35-105 Rzeszów", "", "biuro@klimasystem.pl"]; aph[40356] = ["INWEST-KLIMA", " 0, 15-688 ", "", "ewa.hankowska@inwestklima.com.pl"]; aph[40439] = ["", "Produkcyjna 105 0, 15-680 Białystok", "", "termitech@termitech.com.pl"]; aph[40509] = ["PW Politerm-Izol Sp. z o.o.", "Przemysłowa 5B, 75-216 Koszalin", "", "lukasz.kaczynski@politerm-izol.com.pl"]; aph[40521] = ["", "Kunickiego 11 0, 95-200 Pabianice", "", "biuro@tramontana.net.pl"]; aph[40558] = ["IZOLA", "F. Ossendowskiego 4 0, 93-228 Łódź", "", "wentylacja@izola.pl"]; aph[40606] = ["DABROwent", "A. Krzywca 9, 85-862 BYDGOSZCZ", "", "kasia.dabrowska@dabrowent.pl"]; aph[40751] = ["", " 0, 15-688 ", "", "biuro@inwestklima.com.pl"]; aph[40784] = ["ANG", "Modlnica 315 0, 32-085 Modlnica", "", "biuro@ang.com.pl"]; aph[40790] = ["Dystrybucja Artykułów Technicznych Krzysztof Kubaiński", "ul. Tarnogajska 11-13, 50-512 Wrocław", "", "dat@dat.wroc.pl"]; aph[40844] = ["LEMAR S.J", "Bytomska 18 0, 42-672 Wieszowa", "", "joanna@lemar.pl"]; aph[40863] = ["", "LUBELSKA 36, 10-409 OLSZTYN", "", "olsztyn@klimazbyt.pl"]; aph[40905] = ["Luft-System", "ul. Mieszka I 82, 71-011 Szczecin", "", "biuro@luft-system.pl"]; aph[40912] = ["LEMAR Sp. J.", "Bytomska 18 18, 42-672 Wieszowa", "", "damian@lemar.pl"]; aph[40944] = ["Went-Dom Centrum Profesjonalnej Wentylacji", "Bartycka 26, 00-716 Warszawa", "", "went@went-dom.pl"]; aph[40999] = ["Venture", "Mokra 27 0, 05-092 Kiełpin", "", "mariusz.bialobrzewski@venture.pl"]; aph[41002] = ["MK-WENT Sp. Z o.o. Sp. K.", "Trakt Lubelski 195, 04-667 Warszawa", "", "piotr.kobosko@mkwent.com.pl"]; aph[41036] = ["", "Porfirowa 35, 32-067 Zalas", "", "michalkulpinski@wp.pl"]; aph[41078] = ["Dabrowent", "Krzywca 9, 85-862 Bydgoszcz", "", "magda.olszewska@dabrowent.pl"]; aph[41216] = ["PUH VECO", "Świerczewska 5 5, 71-066 Szczecin", "", "zakupy@veco.com.pl"]; aph[41305] = ["ANG Wentylacja Sp. z o.o.", "Częstochowska 26, 32-085 Modlnica", "", "patrycja.zieba@ang.com.pl"]; aph[93524] = ["BIMs Plus FHH Sp. Z o.o. Dolny Śląsk Sp.K.", "Klonowa 1, 55-200 Stanowice-Oława", "", "pawel.majdak@bimsplus.com.pl"]; aph[93540] = ["Venture Industries sp.z o.o.", "MOKRA 27, 05-092 Kiełpin", "", "izabela.morawska@venture.pl"]; aph[93751] = ["Venture Industries", "aaa 1, 11-111 aaaa", "", "karolina.kubesova@ventur.cz"]; aph[93784] = ["", "Karpia 21, 61-619 Poznań", "", "Roman.filipiak@venture.pl"]; aph[93894] = ["Amster Global", "Obrońców Modlina 9, 30-733 Kraków", "", "mostrowski@amster.pl"]; aph[94259] = ["CALDO-WENTYLACJA SP. Z O.O.", "BISKUPIŃSKA 14, 30-732 Kraków", "", "mariusz.biadun@caldo-wentylacja.pl"]; aph[94356] = ["Caldo-Wentylacja", "Hurtowa 2, 15-399 Białystok", "", "mariusz.bialystok@caldo.pl"]; aph[94357] = ["Caldo-Wentylacja", "Torowa 11, 08-110 Siedlce", "", "mariusz.siedlce@caldo.pl"]; aph[94358] = ["Caldo-Wentylacja", "Rapackiego 15, 20-150 Lublin", "", "mariusz.lublin@caldo.pl"]; aph[94359] = ["Caldo-Wentylacja", "Tartaczna 3, 26-600 Radom", "", "mariusz.radom@caldo.pl"]; aph[94360] = ["Caldo-Wentylacja", "Brandla 1, 30-732 Kraków", "", "mariusz.krakow@caldo.pl"]; aph[94361] = ["Caldo-Wentylacja", "Skrajna 78, 25-650 Kielce", "", "mariusz.kielce@caldo.pl"]; aph[94362] = ["Caldo-Wentylacja", "Szeligowska 42, 01-320 Warszawa", "", "mariusz.warszawa@caldo.pl"]; aph[94363] = ["Caldo-Wentylacja", "Magnacka 27, 08-180 Kowale", "", "mariusz.gdansk@caldo.pl"]; aph[94364] = ["Caldo-Wentylacja", "Orląt Lwowskich 145, 41-208 Sosnowiec", "", "mariusz.sosnowiec@caldo.pl"]; aph[94365] = ["Caldo-Wentylacja", "Św. Teresy 178, 91-222 Łódź", "", "mariusz.lodz@caldo.pl"]; aph[94366] = ["Caldo-Wentylacja", "Wapienna 6/8, 87-100 Toruń", "", "mariusz.torun@caldo.pl"]; aph[94367] = ["Caldo-Wentylacja", "Jerzmanowska 19, 54-530 Wrocław", "", "mariusz.wroclaw@caldo.pl"]; aph[94368] = ["Caldo-Wentylacja", "Kamiennogórska 22, 60-179 Poznań", "", "mariusz.poznan@caldo.pl"]; aph[94369] = ["Caldo-Wentylacja", "Struga 62-64, 70-784 Szczecin", "", "mariusz.szczecin@caldo.pl"]; function scale_round(value, step) { step || (step = 1.0); var inv = 1.0 / step; return Math.round(value * inv) / inv; } function scale_max(value) { value = parseInt(value); var v = value.toString(); var l = v.length; if (l <= 2) { if (value < 50) { return 50; } else { return 100; } } var p = l - 2; var s1 = ''; var s2 = ''; for (var i = 0; i < l; i++) { if (i >= p) { s2 += v[i]; } else { s1 += v[i]; } } s2 = parseInt(s2); if (s2 > 50) { s1 = parseInt(s1) + 1; s2 = '00'; } else { s2 = '50'; } s1 = s1.toString(); s = s1+''+s2; s = parseInt(s); return s; } function createChart(id, charts) { var div = "product_"+id; charts = charts.split(";"); var data_x = 0; var data_y = 0; for (var g = 0; g < charts.length; g++) { var data = data_chart[charts[g]]; console.log(data); Object.keys(data).forEach(function (item) { if (data[item].x > data_x) { data_x = data[item].x } if (data[item].y > data_y) { data_y = data[item].y } }); } data_x = scale_max(data_x); data_y = scale_max(data_y); var x1min = 0; var x1max = data_x; var x2min = 0; var x2max = data_x/3600; var y1min = 0; var y1max = data_y; var y2min = 0; var y2max = data_y; var width = 759; var height = 505; var svg = d3.select("#"+div).append("svg").attr("width", width).attr("height", height); function handleMouseOver(d, i) { d3.select(this).attr({ fill: "orange", r: radius * 2 }); } function make_x_gridlines() { return d3.axisBottom(x).ticks(5) } function make_y_gridlines() { return d3.axisLeft(y).ticks(5) } var x = d3.scaleTime().range([70, width]); var y = d3.scaleLinear().rangeRound([height, 0]); var scale = d3.scaleLinear().domain([x1min, x1max]).range([22, width - 80]); var x_axis = d3.axisTop().scale(scale); var xAxisTranslate = height - 50; // przesuniecie scali x na dol svg.append("g").attr("class", "gray").attr("transform", "translate(48, " + xAxisTranslate +")").call(x_axis) var xscale = d3.scaleLinear().domain([x2min, x2max]).range([22, width - 80]); var x_axis = d3.axisBottom().scale(xscale); var xAxisTranslate = height - 50; // przesuniecie scali x na dol svg.append("g").attr("class", "gray graytext").attr("transform", "translate(48, " + xAxisTranslate +")").call(x_axis) var yscale = d3.scaleLinear().domain([y1min, y1max]).range([height - 100, 0]); var y_axis = d3.axisLeft().scale(yscale); svg.append("g").attr("transform", "translate(70, 20)").call(y_axis); //var yscale_right = d3.scaleLinear().domain([y2min, y2max]).range([height - 100, 0]); //var yr_axis = d3.axisRight().scale(yscale_right); //var yAxisTranslate = width - 31; // przesuniecie scali x na dol //svg.append("g").attr("class", "red").attr("transform", "translate(" + yAxisTranslate +", 20)").call(yr_axis); var yscale = d3.scaleLinear().domain([y1min, y1max]).range([height - 100, 0]); var grid = d3.axisLeft().scale(yscale).ticks(60) svg.append("g").attr("class", "grid2").attr("transform", "translate(70,20)").call(grid.tickSize(-(width-101)).tickFormat("")) var yscale = d3.scaleLinear().domain([y1min, y1max]).range([height - 100, 0]); var grid = d3.axisLeft().scale(yscale); svg.append("g").attr("class", "grid").attr("transform", "translate(70,20)").call(grid.tickSize(-(width-101)).tickFormat("")) var scale = d3.scaleLinear().domain([x1min, x1max]).range([22, width - 80]); var grid = d3.axisTop().scale(scale); svg.append("g").attr("class", "grid").attr("transform", "translate(48, 20)").call(grid.tickSize(-(height-100)).tickFormat("")) var n = 21; var xScale = d3.scaleLinear().domain([x1min, x1max]).range([70, width-30]); var yScale = d3.scaleLinear().domain([y1min, y1max]).range([height-100, 0]); var line = d3.area().x(function(d, i) { return xScale(d.x); }).y(function(d) { return yScale(d.y); }) .curve(d3.curveCardinal) var area = d3.area().x(function(d, i) { return xScale(d.x); }).y0(height-100).y1(function(d) { return yScale(d.y); }).curve(d3.curveCardinal); svg.append("text").style("fill", "#555").style("font-size", "10px") .attr("font-family", "Rubik") .text("m3/s") .attr("x", function (d) { return 730; }) .attr("y", function (d) { return 480; }); svg.append("text").data([{ x: x1max - 50, y: -83 }]).style("fill", "#555").style("font-size", "10px") .attr("font-family", "Rubik") .text("m3/h") .attr("x", function (d) { return 730; }) .attr("y", function (d) { return 455; }); svg.append("text").data([{ x: -150, y: y1max - 25 }]).style("fill", "#555").style("font-size", "10px") .attr("font-family", "Rubik") .text("Pa") .attr("x", function (d) { return 50; }) .attr("y", function (d) { return 15; }); for (var g = 0; g < charts.length; g++) { svg.append("path") .attr("transform", "translate(0, 20)") .datum(data_chart_area[charts[g]]) .attr("id", "area_"+charts[g]) .style('fill-opacity', .2) .attr("fill", "#00427a") .attr("d", area); svg.append("path") .attr("transform", "translate(0, 20)") .attr("id", "path_"+charts[g]) .datum(data_chart[charts[g]]) .attr("stroke", "#00427a") .attr("stroke-width", 1.5) .attr("d", line); } for (var g = 0; g < charts.length; g++) { svg.append("text").data([{ x: data_chart[charts[g]][0].x, y: data_chart[charts[g]][0].y }]).style("fill", "#555").style("font-size", "11px") .attr("font-family", "Rubik") .attr("font-weight", "800") .text(data_chart_name[charts[g]]) .attr("x", function (d) { return xScale(d.x) + 5; }) .attr("y", function (d) { return yScale(d.y) + 18; }) } } $(document).ready(function() { if ($('[data-tech]').length > 0) { var url = "/products/ajax/tech?id="+$('[data-tech]').attr("data-tech"); $.get(url, function(data) { $('[data-tech]').html(data); setTimeout(function(){ create_table_header(); $(".product__tech .tab li[tab-id='data']").trigger("click"); }, 100); }) } else { create_table_header(); } $(document).on("click", "table.data tr", function() { var isModel = $(this).hasClass("row-model"); if (isModel == false) { var id = $(this).next().find(".product_chart").attr("id"); if (id != undefined) { id = id.replace("product_", ""); var charts = $(this).next().find(".product_chart").attr("data-charts"); var _id = "product_"+id; $("tr.row-model td").hide(); $(this).next().find("td").slideDown(); var hasSvg = $("#"+_id).find("svg").length; if (hasSvg == 0) { createChart(id, charts); } } } }); $(document).on("click", ".product .data-tech tr.row-model td h3", function() { $(this).closest("td").slideUp(); }); /*$(document).on("click", "table.data tr", function() { var link = $(this).find("a").attr("href"); if (link != undefined) { document.location.href = link; } });*/ $(document).on("click", ".product__tech .tab li", function(){ $(".product__tech .tab li.active").removeClass("active"); $(this).addClass("active"); var _id = $(this).attr("tab-id"); $("#tab_data, #tab_shop").hide(); $("#tab_"+_id).show(); create_table_header(); }); $(".data-tech").tablesorter({ headers: { 1: { sorter: "digit" }, 2: { sorter: "digit" }, 3: { sorter: "digit" }, 4: { sorter: "digit" }, 5: { sorter: "digit" }, 6: { sorter: "digit" }, 7: { sorter: "digit" }, 8: { sorter: "digit" }, 9: { sorter: "digit" }, 10: { sorter: "digit" }, 11: { sorter: "digit" }, '.state' : { sorter: false } } }); $("#product_gallery img").click(function() { $(".product-gallery__item.active").removeClass("active"); $(this).closest(".product-gallery__item").addClass("active"); var is360 = $(this).closest(".product-gallery__item").hasClass("isShow360"); if (is360 == false) { $(".product-gallery__item a").attr({"data-lightbox" : "cert-set"}); $("#box360").hide(); var medium = $(this).closest(".product-gallery__item").attr("data-medium"); var zoom = $(this).closest(".product-gallery__item").find("a").attr("href"); $(this).closest(".product-gallery__item").find("a").removeAttr("data-lightbox") $(".product__img-360-box").find("img").show().attr({"src" : medium}); $(".product__img-360-box").find("a").attr({"href" : zoom}); } else { $("#box360").show(); $(".product__img-360-box").find("img").hide(); $(".spin360").show(); } }); $("#graph_list li").mouseenter(function() { $(".product__graph-area ul li.active").removeClass("active"); $(this).addClass("active"); selectGraph(); }); $(".form-count-cart input").keypress(function(e) { if (isNaN(parseInt(e.key, 10)) === true && e.key.length == 1) { return e.preventDefault() } }); $(".form-count-cart input").blur(function() { var v = $(this).val(); if (v == 0) { v = 1; } else if (v > parseInt($(this).attr("data-max"))) { v = $(this).attr("data-max"); } $(this).val(v); }); $(".form-count-cart a.minus").click(function() { var $a = $(this).closest(".form-count-cart"); var $v = $a.find("input").val(); var $v = parseInt($v) - 1; if ($v < 1) { $v = 1; } $a.find("input").val($v); }); $(".form-count-cart a.plus").click(function() { var $a = $(this).closest(".form-count-cart"); var $v = $a.find("input").val(); var $m = parseInt($a.find("input").attr("data-max")); var $v = parseInt($v) + 1; if ($v > $m) { $v = $m; } $a.find("input").val($v); }); $(document).on("mouseenter", "[data-state-popup]", function() { //$(".avalModal").remove(); var data = $(this).attr("data-state-popup"); var _name = $(this).closest("tr").find(".product-name").text(); var _d = data.split("|"); var _c = _d.length; var html = '
Produkt dostępny u dostawców: stan na:
'; for(var a = 0; a < _c; a++) { var _p = _d[a].split(";"); html += `
${aph[_p[0]][2] ? '' : ''}
${aph[_p[0]][0]} ${aph[_p[0]][1]}
${_p[2].replace("00:00:00", "")}
`; } html += '
'; $(this).after(html); var _h = parseInt($(this).closest("td").find(".avalModalBody").height()) + 36; $(this).closest("td").find(".avalModal").css({"height" : _h+"px"}); }); $("#d_equipment").change(function() { var id = $(this).val(); equipment(id); }); }); function equipment(id) { $("#equipment").html('
'); $.get("/products/products/equipment?id="+id, function(data) { $("#equipment").html(data) }); } function selectGraph() { $(".area").css({"fill-opacity" : 0}); $(".line").css({"stoke" : "rgb(0, 52, 96)"}).attr('style', "stroke:#00427a"); var id = $("#graph_list").find("li.active").attr("data-char"); document.getElementById('frame-pdu-family').src=`https://www.programdoboru.pl/include/product.html?id_product=${id}`; $("#area_"+id).css({"fill-opacity" : 0.5}); $("#path_"+id).css({"stoke" : "#00427a"}).attr('style', "stroke:#00427a"); var $row = $("#dane-techniczne #data-tech tr#data_"+id); $(".product__graph-area .product__graph-info p").text($row.find("td:nth-child(1)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(1) span").text($row.find("td:nth-child(3)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(2) span").text($row.find("td:nth-child(2)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(3) span").text($row.find("td:nth-child(4)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(4) span").text($row.find("td:nth-child(5)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(5) span").text($row.find("td:nth-child(6)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(6) span").text($row.find("td:nth-child(7)").text()); $(".product__graph-area .product__graph-info ul li:nth-child(7) span").text($row.find("td:nth-child(8)").text()); } function selectItemGraph(id) { $(".product__graph-area ul li.active").removeClass("active"); $("#graph_list li[data-char='"+id+"']").addClass("active"); selectGraph(); }