Subversion Repositories SmartDukaan

Rev

Rev 2749 | Rev 3096 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

var orderTable;
var cartTable;
var userCommunicationTable;
function loadUserPane(domId, userId)    {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-info?userId=" + userId,
                 success: function(response){
                         $('#' + domId).html(response);
                 }
         });
}

function loadOrderPane(domId, userId, orderId)  {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-orders?userId=" + userId,
                 success: function(response){
                         $('#' + domId).html(response);
                         loadOrderInfo("bottom-infopane", userId, orderId);
                         orderTable = $('#user-orders').dataTable({
                                "aaSorting": [[1,'desc']],
                                "iDisplayLength" : 5,
                                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
                         });
                 }
         });
}

function loadCartPane(domId, userId, cartId)    {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-cart?userId=" + userId + "&cartId=" + cartId,
                 success: function(response){
                         $('#' + domId).html(response);
                         cartTable = $('#user-cart').dataTable({
                                "aaSorting": [[1,'desc']],
                                "iDisplayLength" : 10,
                                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
                         });
                 }
         });
}

function loadUserCommunicationPane(domId, userId)       {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-communications?userId=" + userId,
                 success: function(response){
                         $('#' + domId).html(response);
                         userCommunicationTable = $('#user-communications').dataTable({
                                "aaSorting": [[0,'desc']],
                                "iDisplayLength" : 5,
                                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
                         });
                 }
         });
}

function loadOrderInfo(domId, userId, orderId)  {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-order-info?userId=" + userId + "&orderId=" + orderId,
                 success: function(response){
                         $('#' + domId).html(response);
                         $('#user-orders tr').removeClass('selected');
                         $('#order-row-' + orderId).addClass('selected');
                 }
         });
}

function loadLineInfo(domId, userId, itemId)    {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-line-info?userId=" + userId + "&itemId=" + itemId,
                 success: function(response){
                         $('#' + domId).html(response);
                         $('#user-cart tr').removeClass('selected');
                         $('#cart-row-' + itemId).addClass('selected');
                 }
         });
}

function loadCommunicationInfo(domId, userId, commId) {
        $.ajax({
                 type: "GET",
                 url: "/crm/user-communication-info?userId=" + userId + "&commId=" + commId,
                 success: function(response){
                         $('#' + domId).html(response);
                         $('#user-cart tr').removeClass('selected');
                         $('#cart-row-' + commId).addClass('selected');
                 }
         });
}