var Q1Client = { RESOURCES_URL : "http://localhost:8080/Q1Customer/resources", DISCOUNTS_URL : "http://localhost:8080/Q1Customer/resources/discountCodes", printHTML : function () { var htmlOut = "";// '

Resources for Q1Customer:


Customers:
'; var app = new Q1Customer(this.RESOURCES_URL); var resources = app.getResources(); var resource = resources[0]; htmlOut += this.getCustomersHTML(resource.getItems()); var div = document.getElementById('containerContent'); div.innerHTML = div.innerHTML + htmlOut + "
"; app = new DiscountCodes(this.DISCOUNTS_URL); var allCodesArr = app.getItems(); htmlOut = this.getDiscountCodesHTML(allCodesArr); div.innerHTML += htmlOut + "
"; }, getCustomersHTML : function (items) { var html = ''; html += ''; if (items != undefined && items.length > 0) { for(j=0;j'; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; } } else { html += ''; } html += '
CustIDdis-codenameaddresscitystatezipphonefaxemail
' + String.fromCharCode(dcode.getDiscountCode()) + '' + cust.getName() + '' + cust.getAddressline1() + "
" + cust.getAddressline2() + '
' + cust.getCity() + '' + cust.getState() + '' + cust.getZip() + '' + cust.getPhone() + '' + cust.getFax() + '' + cust.getEmail() + '
No items detected
'; return html; }, getDiscountCodesHTML : function(allCodeArr) { var html = ""; for (var i = 0; i < allCodeArr.length; i++) { var oneCode = new DiscountCode(allCodeArr[i].getUri()); html += ''; html += ''; var custArr = (new Customers(oneCode.getCustomers().getUri())).getItems(); var csvCust = ""; // Comma separated customer IDs for (var j=0; j'; } html += "
Dis-codeRateCustomer IDs
' + String.fromCharCode(oneCode.getDiscountCode()) + '' + oneCode.getRate() + '
" return html; } };