function eghCallHookUrl(items) { if (items.length == 0) { alert('In Ihrer Stückliste befinden sich noch keine Artikel. Bitte fügen Sie zunächst die gewünschten Produkte der Stückliste hinzu.'); } else { $.ajax({ url: 'php/eghApiGenerateXML.php', type: 'POST', data: { }, beforeSend: function(xhr) { disableButton('btnPlaningTop'); disableButton('btnChecklistTop'); disableButton('btnAddToCartTop'); disableButton('btnPlaningBottom'); disableButton('btnChecklistBottom'); disableButton('btnAddToCartBottom'); } }) .error(function(xhr) { }) .success(function(data) { $.ajax({ url: 'php/sessionDestroy.php', type: 'POST', data: { }, beforeSend: function(xhr) { disableButton('btnPlaningTop'); disableButton('btnChecklistTop'); disableButton('btnAddToCartTop'); disableButton('btnPlaningBottom'); disableButton('btnChecklistBottom'); disableButton('btnAddToCartBottom'); } }) .error(function(xhr) { }) .success(function(sessionDestroyData) { //console.log(data); $('#responseXML').val(data); if ($('#responseXML').val() != '') { $('#responseXMLForm').submit(); } }); }); } } function callHookUrl(url, items) { if (items.length == 0) { alert('In Ihrer Stückliste befinden sich noch keine Artikel. Bitte fügen Sie zunächst die gewünschten Produkte der Stückliste hinzu.'); } else { var itemsQuantities = ''; for (var i = 0; i < items.length; i++) { var artikelnummer = items[i].sonepar_artikelnummer; var quantity = parseInt(items[i].anzahl * 100); itemsQuantities += artikelnummer + ',' + quantity + ';'; } $.ajax({ url: 'php/sessionDestroy.php', type: 'POST', data: { }, beforeSend: function(xhr) { disableButton('btnPlaningTop'); disableButton('btnChecklistTop'); disableButton('btnAddToCartTop'); disableButton('btnPlaningBottom'); disableButton('btnChecklistBottom'); disableButton('btnAddToCartBottom'); } }) .error(function(xhr) { }) .success(function(data) { $('#itemsQuantities').val(itemsQuantities); //console.log(itemsQuantities); $('#itemsQuantitiesForm').submit(); }); /* $.ajax({ url: url, type: 'POST', data: { itemsQuantities: itemsQuantities }, beforeSend: function(xhr) { } }) .error(function(xhr) { console.log(url); console.log(xhr); alert(xhr.status + ' (' + xhr.statusText + '): Die Daten konnten nicht übernommen werden. Bitte versuchen Sie es zu einem späteren Zeitpunkt erneut.'); }) .success(function(data) { $.ajax({ url: 'php/sessionDestroy.php', type: 'POST', data: { }, beforeSend: function(xhr) { } }) .error(function(xhr) { }) .success(function(data) { self.location.href=url; }); }); */ } } function buttonNormal(obj) { if (!$(obj).hasClass('isDisabled')) { $(obj).find('div').eq(0).css('background', 'url(img/bg_button_normal_left.png)'); $(obj).find('div').eq(1).css('background', 'url(img/bg_button_normal_middle.png)').css('height', '30px').css('padding', '0'); $(obj).find('div').eq(2).css('background', 'url(img/bg_button_normal_right.png)'); $(obj).css('opacity', '1.0'); } } function buttonHover(obj) { if (!$(obj).hasClass('isDisabled')) { $(obj).find('div').eq(0).css('background', 'url(img/bg_button_hover_left.png)'); $(obj).find('div').eq(1).css('background', 'url(img/bg_button_hover_middle.png)'); $(obj).find('div').eq(2).css('background', 'url(img/bg_button_hover_right.png)'); } } function buttonDown(obj) { if (!$(obj).hasClass('isDisabled')) { $(obj).find('div').eq(0).css('background', 'url(img/bg_button_down_left.png)'); $(obj).find('div').eq(1).css('background', 'url(img/bg_button_down_middle.png)').css('height', '29px').css('padding', '1px 0 0 0px'); $(obj).find('div').eq(2).css('background', 'url(img/bg_button_down_right.png)'); } } function disableButton(strId) { var $obj = $('#'+strId); $obj.attr('disabled', 'disabled'); /* $obj.find('div').eq(0).css('background', 'url(img/bg_button_disabled_left.png)'); $obj.find('div').eq(1).css('background', 'url(img/bg_button_disabled_middle.png)').css('height', '30px').css('padding', '0'); $obj.find('div').eq(2).css('background', 'url(img/bg_button_disabled_right.png)'); */ $obj.addClass('isDisabled'); $obj.css('opacity', '0.42'); } function enableButton(strId) { $('#'+strId).removeAttr('disabled'); $('#'+strId).removeClass('isDisabled'); buttonNormal($('#'+strId)); } function makeDecimalPoint(object) { object.value = object.value.replace(',', '.'); } function str_replace(search, replace, subject) { return subject.split(search).join(replace); } function round(value) { return Math.round(value * 100) / 100; } function showSuccessMessage() { $(document).ready(function() { $('#successMessageWrapper').animate({opacity: 0.0, height: 'toggle'}, 0, function () { $('#successMessageWrapper').css('visibility', 'visible'); $('#successMessageWrapper').animate({opacity: 1.0, height: 'toggle'}, 2000, function () { $('#successMessageWrapper').delay(5000).animate({opacity: 0.0, height: 'toggle'}, 1000); }); }); }); } function merklisteExport() { $('#hiddenIframeForFileOutput').attr('src', 'php/merklisteExport.php?language='+LANGUAGE_LINK); } function kabelfuehrungOnClick($kabelfuehrung, kabelfuehrungId, kabelfuehrungName) { $('#kabelfuehrungSelect').val(kabelfuehrungName); $('#kabelfuehrung').val(kabelfuehrungName); $kabelfuehrung.find('input').eq(0).attr('checked', !$kabelfuehrung.find('input').eq(0).attr('checked')); $('#hiddenKabelfuehrungen').find('input[value="' + kabelfuehrungId + '"]').remove(); if ($kabelfuehrung.find('input').eq(0).attr('checked')) { $('#hiddenKabelfuehrungen').append(''); }; if ($('#hiddenKabelfuehrungen input').length > 1) { $('#kabelfuehrungSelect').val(text[127]); $('#kabelfuehrung').val(text[127]); } else if ($('#hiddenKabelfuehrungen input').length == 1) { var einzigeAusgewaehlteKabelfuehrung = $.trim( $('#kabelfuehrungSelectionBox td input[checked=checked]').parent('td').find('.kabelfuehrungNameSpan').html() ); $('#kabelfuehrungSelect').val(einzigeAusgewaehlteKabelfuehrung); $('#kabelfuehrung').val(einzigeAusgewaehlteKabelfuehrung); } else if ($('#hiddenKabelfuehrungen input').length == 0) { $('#kabelfuehrungSelect').val(text[19]); $('#kabelfuehrung').val(text[19]); } } function changeOpening() { var value = $('#oeffnungsart').val(); $('#oeffnungsart_eckig').css('display', 'none'); $('#oeffnungsart_rund').css('display', 'none'); $('#oeffnungsart_flaeche').css('display', 'none'); if (value == 'eckig') { $('#oeffnungsart_eckig').css('display', 'table-row'); } else if (value == 'rund') { $('#oeffnungsart_rund').css('display', 'table-row'); } else if (value == 'vorgegebene_flaeche') { $('#oeffnungsart_flaeche').css('display', 'table-row'); } } function addRohrdurchmesserFuerManschettenTr(durchmesser) { $('#rohrdurchmesserFuerManschettenTr').after('