$(document).ready(function () { all_invoice(); }); function all_invoice() { $('#invoicesList #new').click(function() { il = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(il.width()).height(il.height()); $('#invoiceDisabler').fadeIn('fast'); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=newinvoice', success: function(data) { $(data).appendTo('#invoicesList'); $('#newInvoice').css('top', 0).css('left', 0); $('#newInvoice').fadeIn('fast'); updateHeight(); $('#newInvoice a.cancelInvoice').click(function() { $('#newInvoice').fadeOut(function(){$('#newInvoice').remove(); $('#invoiceDisabler').fadeOut();}); $('#invoicesList').attr('style', ''); }); selectCustomer(); selectDealer(); selectConsignee(); selectType(); selectCargo(); $('#newInvoice a.saveInvoice').click(function() { nl = $('#newInvoice'); $('#invoiceDisabler2').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $('#newInvoiceF input').css('background-color', '#FFFFFF'); $('#newInvoiceF a').css('background-color', '#FFFFFF'); $('#newInvoice .feedback').slideUp(function() { $('#newInvoice .feedback').children().remove(); $.ajax({ type: 'POST', url: 'http://track.acshipping.com/updater.php', data: 'id=newinvoice&save=yes&'+$('#newInvoiceF').serialize(), success: function(data) { if (data.substring(0,6) == "EMPTY ") { $('
Some fields are left empty
').appendTo('#newInvoice .feedback'); a = data.split(" "); $.each(a, function() { if (this == 'customerId') { $('#newInvoiceF a.customer').css('background-color', '#FFAAAA'); } else if (this == 'dealerId') { $('#newInvoiceF a.dealer').css('background-color', '#FFAAAA'); } else if (this == 'consigneeId') { $('#newInvoiceF a.consignee').css('background-color', '#FFAAAA'); } else if (this == 'cargoId') { $('#newInvoiceF a.selectCargo').css('background-color', '#FFAAAA'); } else { $('#newInvoiceF input[name='+this+']').css('background-color', '#FFAAAA'); } }); } else if (data.substring(0, 3) == "OK ") { $('
Invoice successfully saved. To view the new invoice click "Filter"
').appendTo('#invoicesList .feedback'); $('#newInvoice').fadeOut('fast', function() { $('#newInvoice').remove(); $('#invoiceDisabler').fadeOut(); $('#invoicesList .feedback').slideDown(); $('#invoicesList').attr('style', ''); }); } $('#invoiceDisabler2').fadeOut('fast'); $('#newInvoice .feedback').slideDown(); } }); }); }); } }); }); $('#invoicesList #invoiceFilterF a#filter').click(function() { il = $('#invoicesList'); $('#invoicessList table thead td').attr('order', '').removeClass('desc').removeClass('asc'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(il.width()).height(il.height()); $('#invoiceDisabler').fadeIn('fast'); $('#invoiceFilterF #isFiltered').val('1'); $('#invoiceFilterF input[name=page]').val(0); $.get('http://track.acshipping.com/updater.php', { id: 'invoice', filter: $('#invoiceFilterF').serializeArray() } , function(data){ $('#invoicesList table.list tbody').replaceWith(data); $('#invoiceDisabler').fadeOut('fast'); reload_invoices(); }); }); $('#invoicesList #invoiceFilterF a#clear').click(function() { il = $('#invoicesList'); $('#invoicesList table thead td').attr('order', '').removeClass('desc').removeClass('asc'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(il.width()).height(il.height()); $('#invoiceDisabler').fadeIn('fast'); $('#invoiceFilterF').find(':input').val(''); $('#invoiceFilterF #isFiltered').val('0'); $.get('http://track.acshipping.com/updater.php', { id: 'invoice', filter: $('#invoiceFilterF').serializeArray() } , function(data){ $('#invoicesList table.list tbody').replaceWith(data); $('#invoiceDisabler').fadeOut('fast'); reload_invoices(); }); }); $('#invoicesList table.list thead td').click(function() { $('#invoiceFilterF .page').val(1); if ($(this).attr('id') == 'action') return; if ($(this).attr('id') == 'cargo') return; if ($(this).attr('id') == 'update') return; cl = $('#invoicesList'); order = $(this).attr('order'); if (order == 'asc') { $(this).parent().children().attr('order', '').removeClass('desc').removeClass('asc'); $(this).attr('order', 'desc').addClass('desc'); order = 'desc'; } else { $(this).parent().children().attr('order', '').removeClass('desc').removeClass('asc'); $(this).attr('order', 'asc').addClass('asc'); order = 'asc'; } $('#invoiceDisabler').css('top', 0).css('left', 0).width(cl.width()).height(cl.height()); $('#invoiceDisabler').fadeIn('fast'); $.get('http://track.acshipping.com/updater.php', { id: 'invoice', order: $(this).attr('id'), way: order, filter: $('#invoiceFilterF').serializeArray() }, function(data) { $('#invoicesList table.list tbody').replaceWith(data); $('#invoiceDisabler').fadeOut(); reload_invoices(); }); }); reload_invoices(); } var custType; function load_cust() { $('#customerList a.select').click(function() { nr = $(this).attr('nr'); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=viewcustomer&select=true&divid='+custType+'Information&inputId=customerId&nr='+nr, success: function(data) { $('#'+custType+'Information').replaceWith(data); $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut('fast');}); } }); }); } function selectCustomer() { $('#newInvoice a.customer').click(function() { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=customers&select=true', success: function(data) { nl = $('#main'); $('#invoiceDisabler2').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $(data).appendTo('#newInvoice'); $('#customerList').css('top', '-16px').css('left', '-16px'); updateHeight(); all_customers(); $('#customerList #cancelCustomer').click(function() { $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut();}); }); custType = 'customer'; load_cust(); } }); }); } function selectDealer() { $('#newInvoice a.dealer').click(function() { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=customers&select=true', success: function(data) { nl = $('#main'); $('#invoiceDisabler2').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $(data).appendTo('#newInvoice'); $('#customerList').css('top', '-16px').css('left', '-16px'); updateHeight(); all_customers(); $('#customerList #cancelCustomer').click(function() { $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut();}); }); custType = 'dealer'; load_cust(); } }); }); } function selectConsignee() { $('#newInvoice a.consignee').click(function() { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=customers&select=true', success: function(data) { nl = $('#main'); $('#invoiceDisabler2').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $(data).appendTo('#newInvoice'); $('#customerList').css('top', '-16px').css('left', '-16px'); updateHeight(); all_customers(); $('#customerList #cancelCustomer').click(function() { $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut();}); }); custType = 'consignee'; load_cust(); } }); }); } function selectType() { $('#newInvoice #selectType').change(function() { $('#cargoInformation').replaceWith('
'); }); } function selectCargo() { $('#newInvoice a.selectCargo').click(function() { nl = $('#main'); $('#invoiceDisabler2').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); id = $('#newInvoice #selectType').val(); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id='+id+'&select=true', success: function(data) { $(data).appendTo('#newInvoice'); $('#'+id+'List').css('top', '-16px').css('left', '-16px'); updateHeight(); all_cars(); all_boats(); all_motos(); all_other(); $('#'+id+'List #cancel').click(function() { $('#'+id+'List').fadeOut('fast', function() {$('#'+id+'List').remove(); $('#invoiceDisabler2').fadeOut();}); }); load_select(id); } }); }); } function load_select(id) { $('#'+id+'List a.select').click(function() { nr = $(this).attr('nr'); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=view'+id+'&select=true&divid=cargoInformation&inputId=cargoId&nr='+nr, success: function(data) { $('#cargoInformation').replaceWith(data); $('#'+id+'List').fadeOut('fast', function() {$('#'+id+'List').remove(); $('#invoiceDisabler2').fadeOut('fast');}); updateHeight(); } }); }); } function invoice_view_car() { $('#invoicesList a.viewCargo').click(function() { nl = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler').fadeIn('fast'); e = this; $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=view'+$(this).attr('nrt')+'&nr='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#invoicesList'); view = $('#view'+$(e).attr('nrt2')); view.css('top', 0).css('left', 0); updateHeight(); view.fadeIn('fast'); $('#view'+$(e).attr('nrt2')+' a.close').click(function() { view.fadeOut('fast', function() { view.remove(); $('#invoiceDisabler').fadeOut(); }); }); } }); }); } function invoice_view_invoice() { $('#invoicesList a.viewInvoice').click(function() { nl = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler').fadeIn('fast'); e = this; $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=viewinvoice&nr='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#invoicesList'); $('#viewInvoice').css('top', 0).css('left', 0); $('#viewInvoice').fadeIn('fast'); updateHeight(); $('#viewInvoice a.closeInvoice').click(function() { $('#viewInvoice').fadeOut('fast', function() { $('#viewInvoice').remove(); $('#invoiceDisabler').fadeOut(); $('#invoicesList').attr('style', ''); }); }); $('#viewInvoice a.upload').click(function() { addUpload(); }); } }); }); } function invoice_edit_invoice() { $('#invoicesList a.editInvoice').click(function() { nl = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler').fadeIn('fast'); e = this; $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=editinvoice&nr='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#invoicesList'); updateHeight(); $('#editInvoice').css('top', 0).css('left', 0); $('#editInvoice').fadeIn('fast'); if ($('#invoicesList').height() < $('#editInvoice').height()) { $('#invoicesList').height($('#editInvoice').height()); } $('#editInvoice a.cancelInvoice').click(function() { $('#editInvoice').fadeOut('fast', function() { $('#editInvoice').remove(); $('#invoiceDisabler').fadeOut(); $('#invoicesList').attr('style', ''); }); }); selectCustomerEdit(); selectDealerEdit(); selectConsigneeEdit(); selectTypeEdit(); selectCargoEdit(); $('#editInvoice a.saveInvoice').click(function() { $('#invoicesList .feedback').slideUp('fast', function() { $('#invoicesList .feedback').children().remove(); $.ajax({ type: 'POST', url: 'http://track.acshipping.com/updater.php', data: 'id=editinvoice&'+$('#editInvoiceF').serialize(), success: function(data) { if (data.substring(0,6) == "EMPTY ") { $('
Some fields are left empty
').appendTo('#newInvoice .feedback'); a = data.split(" "); $.each(a, function() { if (this == 'customerId') { $('#editInvoiceF a.customer').css('background-color', '#FFAAAA'); } else if (this == 'dealerId') { $('#editInvoiceF a.dealer').css('background-color', '#FFAAAA'); } else if (this == 'consigneeId') { $('#editInvoiceF a.consignee').css('background-color', '#FFAAAA'); } else if (this == 'cargoId') { $('#editInvoiceF a.selectCargo').css('background-color', '#FFAAAA'); } else { $('#editInvoiceF input[name='+this+']').css('background-color', '#FFAAAA'); } }); } else if (data.substring(0, 3) == "OK ") { $('
Invoice successfully saved. To view the new invoice click "Filter"
').appendTo('#invoicesList .feedback'); $('#editInvoice').fadeOut('fast', function() { $('#invoiceFilterF input.invoicenr').val($('#editInvoice input[name=invoicenr]').val()); $('#editInvoice').remove(); $('#invoiceDisabler').fadeOut(); $('#invoicesList .feedback').slideDown(); $('#invoicesList').attr('style', ''); }); } $('#invoiceDisabler2').fadeOut('fast'); $('#newInvoice .feedback').slideDown(); updateHeight(); } }); }); }); } }); }); } function reload_invoices() { invoice_view_car(); invoice_view_invoice(); invoice_edit_invoice(); updateLocation(); pageInvoice(); edit_payments(); } var loc = ''; function getCustomerInformation() { $('#customerList a.select').click(function() { nr = $(this).attr('nr'); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=viewcustomer&select=true&divid='+loc+'&inputId=customerId&nr='+nr, success: function(data) { $('#'+loc).replaceWith(data); $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut('fast');}); updateHeight(); } }); }); } function selectCustomerEdit() { $('#editInvoice a.customer').click(function() { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=customers&select=true', success: function(data) { nl = $('#editInvoice'); $('#invoiceDisabler2').css('top', '-5px').css('left', '-5px').width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $(data).appendTo('#editInvoice'); updateHeight(); $('#customerList').css('top', '-16px').css('left', '-16px'); all_customers(); $('#customerList #cancelCustomer').click(function() { $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut();}); }); loc = 'customerInformation'; getCustomerInformation(); } }); }); } function selectDealerEdit() { $('#editInvoice a.dealer').click(function() { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=customers&select=true', success: function(data) { nl = $('#editInvoice'); $('#invoiceDisabler2').css('top', '-5px').css('left', '-5px').width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $(data).appendTo('#editInvoice'); updateHeight(); $('#customerList').css('top', '-16px').css('left', '-16px'); all_customers(); $('#customerList #cancelCustomer').click(function() { $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut();}); }); loc = 'dealerInformation'; getCustomerInformation(); } }); }); } function selectConsigneeEdit() { $('#editInvoice a.consignee').click(function() { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=customers&select=true', success: function(data) { nl = $('#editInvoice'); $('#invoiceDisabler2').css('top', '-5px').css('left', '-5px').width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); $(data).appendTo('#editInvoice'); updateHeight(); $('#customerList').css('top', '-16px').css('left', '-16px'); all_customers(); $('#customerList #cancelCustomer').click(function() { $('#customerList').fadeOut('fast', function() {$('#customerList').remove(); $('#invoiceDisabler2').fadeOut();}); }); loc = 'consigneeInformation'; getCustomerInformation(); } }); }); } function selectTypeEdit() { $('#editInvoice #selectType').change(function() { $('#cargoInformation').replaceWith('
'); updateHeight(); }); } function selectCargoEdit() { $('#editInvoice a.selectCargo').click(function() { nl = $('#editInvoice'); $('#invoiceDisabler2').css('top', '-5px').css('left', '-5px').width(nl.width()).height(nl.height()); $('#invoiceDisabler2').fadeIn('fast'); id = $('#editInvoice #selectType').val(); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id='+id+'&select=true', success: function(data) { $(data).appendTo('#editInvoice'); updateHeight(); $('#'+id+'List').css('top', 0).css('left', 0); all_cars(); all_boats(); all_motos(); all_other(); $('#'+id+'List #cancel').click(function() { $('#'+id+'List').fadeOut('fast', function() {$('#'+id+'List').remove(); $('#invoiceDisabler2').fadeOut();}); }); load_select(id); } }); }); } function edit_payments() { $('#invoicesList .pay').click(function() { nl = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler').fadeIn('fast'); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=payment&nr='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#invoicesList'); updateHeight(); $('#paymentList').css('top', 0).css('left', 0); $('#paymentList').fadeIn('fast'); removePayment(); $('#paymentList a.cancel').click(function() { $('#paymentList').fadeOut('fast', function() { $('#paymentList').remove(); $('#invoiceDisabler').fadeOut(); }); }); $('#paymentList a.newPayment').click(function() { ll = $('#main'); $('#paymentDisabler').css('top', '-5px').css('left', '-5px').width(ll.width()).height(ll.height()); $('#paymentDisabler').fadeIn('fast'); $.ajax({ type:'POST', url: 'http://track.acshipping.com/updater.php', data: 'id=newpayment&invoice_id='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#paymentList'); updateHeight(); $('#newPayment').css('top', 0).css('left', 0); $('#newPayment').fadeIn('fast'); $('#newPayment a.cancel').click(function() { $('#newPayment').fadeOut('fast', function() { $('#newPayment').remove(); $('#paymentDisabler').fadeOut(); }); }); $('#newPayment a.save').click(function() { $('#newPayment .feedback').slideUp(function() { $('#newPayment .feedback').children().remove(); $.ajax({ type: 'POST', url: 'http://track.acshipping.com/updater.php', data: 'id=newpayment&'+$('#newPaymentF').serialize(), success: function(data) { if (data.substring(0, 3) == "OK ") { $('#newPayment').fadeOut('fast', function() { $('#newPayment').remove(); $('#paymentDisabler').fadeOut(); }); $(data.substring(3)).appendTo('#paymentList table tbody'); $('
Payment successfully saved.
').appendTo('#paymentList .feedback'); $('#paymentList .feedback').slideDown(); } else { $('
There was an error
').appendTo('#newLocation .feedback'); } $('#newPayment .feedback').slideDown(); updateHeight(); } }); }); }); } }); }); } }); }); } function updateLocation() { $('#invoicesList a.updateInformation').click(function() { nl = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(nl.width()).height(nl.height()); $('#invoiceDisabler').fadeIn('fast'); $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=location&nr='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#invoicesList'); updateHeight(); $('#updateLocation').css('top', 0).css('left', 0); $('#updateLocation').fadeIn('fast'); $('#updateLocation a.cancel').click(function() { $('#updateLocation').fadeOut('fast', function() { $('#updateLocation').remove(); $('#invoiceDisabler').fadeOut(); }); }); $('#updateLocation a.remove').click(function() { answer = confirm("Are you sure you want to remove this location?"); if (answer) { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=removelocation&locid='+$(this).attr('nr'), success: function(data) { if (data == "OK") { $('
Location successfully removed.
').appendTo('#updateLocation .feedback'); $('#updateLocation .feedback').slideDown(); } else { $('
There was some error. Please try again.
').appendTo('#updateLocation .feedback'); $('#updateLocation .feedback').slideDown(); } } }); } }); $('#updateLocation a.newLocation').click(function() { ll = $('#main'); $('#locationDisabler').css('top', '-5px').css('left', '-5px').width(ll.width()).height(ll.height()); $('#locationDisabler').fadeIn('fast'); $.ajax({ type:'POST', url: 'http://track.acshipping.com/updater.php', data: 'id=newlocation&invoice_id='+$(this).attr('nr'), success: function(data) { $(data).appendTo('#updateLocation'); updateHeight(); $('#newLocation').css('top', 0).css('left', 0); $('#newLocation').fadeIn('fast'); $('#newLocation a.cancel').click(function() { $('#newLocation').fadeOut('fast', function() { $('#newLocation').remove(); $('#locationDisabler').fadeOut(); }); }); $('#newLocation a.save').click(function() { $('#newLocation .feedback').slideUp(function() { $('#newLocation .feedback').children().remove(); $.ajax({ type: 'POST', url: 'http://track.acshipping.com/updater.php', data: 'id=newlocation&'+$('#newLocationF').serialize(), success: function(data) { if (data == "OK") { $('#newLocation').fadeOut('fast', function() { $('#newLocation').remove(); $('#locationDisabler').fadeOut(); }); $('
Location successfully updated. Please reload this view to see new location.
').appendTo('#updateLocation .feedback'); $('#updateLocation .feedback').slideDown(); } else { $('
There was an error
').appendTo('#newLocation .feedback'); } $('#newLocation .feedback').slideDown(); } }); }); }); } }); }); } }); }); } function pageInvoice() { $('#invoiceFilterF a.page').click(function () { $('#invoiceFilterF input.page').val($(this).attr('nr')); order = ''; orderby = $('#invoicesList table thead td[order="asc"]').attr('id'); if (orderby != null) order = 'asc'; else { orderby = $('#invoicesList table thead td[order="desc"]').attr('id'); if (orderby != null) order = 'desc'; } cl = $('#invoicesList'); $('#invoiceDisabler').css('top', 0).css('left', 0).width(cl.width()).height(cl.height()); $('#invoiceDisabler').fadeIn('fast'); $.get('http://track.acshipping.com/updater.php', { id: 'invoice', order: orderby, way: order, filter: $('#invoiceFilterF').serializeArray() }, function(data) { $('#invoicesList table.list tbody').replaceWith(data); $('#invoiceDisabler').fadeOut(); reload_invoices(); }); }); } function updateHeight() { var tallest = 0; group = $("*", $('#main')); group.each(function() { var thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); $('#main').height(tallest+45); } function updateFilter() { $('#headimg').each(function() { var el = $(this), offset = el.offset(), scrollTop = $(window).scrollTop(); if (scrollTop > 90) { el.css('position', 'fixed').css('top', 0); $('.filterMain').css('position', 'fixed').css('top', '36px'); } else { el.css('position', 'relative'); $('.filterMain').css('position', 'relative').css('top', 0); } }); } function removePayment() { $('#paymentList .remove').click(function () { nr = $(this).attr('nr'); answer = confirm("Are you sure you want to remove this location?"); if (answer) { $.ajax({ type: 'GET', url: 'http://track.acshipping.com/updater.php', data: 'id=removepayment&nr='+nr, success: function(data) { if (data == "OK") { $('
Payment successfully removed.
').appendTo('#paymentList .feedback'); $('#paym'+nr).fadeOut(); $('#paymentList .feedback').slideDown(); } else { $('
There was some error. Please try again.
').appendTo('#paymentList .feedback'); $('#paymentList .feedback').slideDown(); } } }); } }); }