Subversion Repositories SmartDukaan

Rev

Rev 18625 | Rev 18884 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2749 vikas 1
var orderTable;
2
var cartTable;
3096 mandeep.dh 3
 
3090 mandeep.dh 4
function loadUserPane(domId, userId) {
3228 mandeep.dh 5
    $.ajax({
6
        type : "GET",
7
        url : "/crm/user-info?userId=" + userId,
8
        success : function(response) {
9
            $('#' + domId).html(response);
10
        }
11
    });
2674 vikas 12
}
13
 
3228 mandeep.dh 14
function loadOrderPane(domId, userId, orderId) {
15
    $.ajax({
16
        type : "GET",
17
        url : "/crm/user-orders?userId=" + userId,
18
        success : function(response) {
19
            $('#' + domId).html(response);
3499 mandeep.dh 20
            loadOrderInfo("bottom-infopane", orderId);
3228 mandeep.dh 21
            orderTable = $('#user-orders').dataTable({
22
                "aaSorting" : [ [ 1, 'desc' ] ],
4241 anupam.sin 23
              "bAutoWidth": false,
18583 amit.gupta 24
              "aoColumns" : [{ "sWidth": "8%" },//transaction id
25
                             { "sWidth": "7%" },//item desc
4241 anupam.sin 26
                             { "sWidth": "30%" },//item desc
18583 amit.gupta 27
                             { "sWidth": "4%" },//item desc
18308 amit.gupta 28
                             { "sWidth": "14%" },//created
4241 anupam.sin 29
                             { "sWidth": "8%" },//amount
30
                             { "sWidth": "17%" },//status
18308 amit.gupta 31
                             { "sWidth": "11%" }],//mobile no.
3996 mandeep.dh 32
                "fnDrawCallback": function() { truncateText(125); },
4605 anupam.sin 33
                "iDisplayLength" : 10,
3339 mandeep.dh 34
                "sDom" : 'T<"clear">lfrtip',
35
                "oTableTools" : {
36
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
37
                },
3228 mandeep.dh 38
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
39
            });
40
        }
41
    });
2674 vikas 42
}
43
 
6111 anupam.sin 44
function loadRechargeOrderPane(domId, userId, rechargeOrderId) {
45
    $.ajax({
46
        type : "GET",
47
        url : "/crm/recharge-orders?userId=" + userId,
48
        success : function(response) {
49
            $('#' + domId).html(response);
50
            loadRechargeOrderInfo("bottom-infopane", rechargeOrderId);
51
            orderTable = $('#recharge-orders').dataTable({
52
                "aaSorting" : [ [ 1, 'desc' ] ],
53
              "bAutoWidth": false,
54
              "aoColumns" : [{ "sWidth": "16%" },//recharge order id
55
                             { "sWidth": "30%" },//desc
56
                             { "sWidth": "16%" },//created
57
                             { "sWidth": "8%" },//amount
58
                             { "sWidth": "17%" },//status
6982 anupam.sin 59
                             { "sWidth": "13%" }],//mobile no.
60
                "fnDrawCallback": function() { truncateText(180); },
6111 anupam.sin 61
                "iDisplayLength" : 10,
62
                "sDom" : 'T<"clear">lfrtip',
63
                "oTableTools" : {
64
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
65
                },
66
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
67
            });
68
        }
69
    });
70
}
71
 
72
function loadRechargeOrderInfo(domId, rechargeOrderId) {
73
    $.ajax({
74
        type : "GET",
75
        url : "/crm/recharge-order-info?rechargeOrderId=" + rechargeOrderId,
76
        success : function(response) {
77
            $('#' + domId).html(response);
78
 
79
            var trId = 'order-row-' + rechargeOrderId;
80
            if (orderTable != null) {
81
                for ( var index in orderTable.fnGetNodes()) {
82
                    var item = orderTable.fnGetNodes()[index];
83
                    if ($(item).attr('id') == trId) {
84
                        orderTable.fnDisplayRow(item);
85
                        break;
86
                    }
87
                }
88
            }
89
 
90
            $('#recharge-orders tr').removeClass('selected');
6153 anupam.sin 91
            $('#order-row-' + rechargeOrderId).addClass('selected');
6111 anupam.sin 92
        }
93
    });
94
}
95
 
3228 mandeep.dh 96
function loadCartPane(domId, userId, cartId) {
97
    $.ajax({
98
        type : "GET",
99
        url : "/crm/user-cart?userId=" + userId + "&cartId=" + cartId,
100
        success : function(response) {
101
            $('#' + domId).html(response);
102
            cartTable = $('#user-cart').dataTable({
103
                "aaSorting" : [ [ 1, 'desc' ] ],
4241 anupam.sin 104
              "bAutoWidth": false,
105
              "aoColumns" : [{ "sWidth": "32%" },//name
106
                             { "sWidth": "9%" },//quantity
107
                             { "sWidth": "16%" },//actual price
108
                             { "sWidth": "16%" },//discounted price
109
                             { "sWidth": "9%" },//estimate
110
                             { "sWidth": "18%" }],//created on
3228 mandeep.dh 111
                "iDisplayLength" : 10,
3339 mandeep.dh 112
                "sDom" : 'T<"clear">lfrtip',
113
                "oTableTools" : {
114
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
115
                },
3228 mandeep.dh 116
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
117
            });
118
        }
119
    });
2714 vikas 120
}
121
 
3499 mandeep.dh 122
function loadOrderInfo(domId, orderId) {
3228 mandeep.dh 123
    $.ajax({
124
        type : "GET",
3499 mandeep.dh 125
        url : "/crm/user-order-info?orderId=" + orderId,
3228 mandeep.dh 126
        success : function(response) {
127
            $('#' + domId).html(response);
3220 mandeep.dh 128
 
3228 mandeep.dh 129
            var trId = 'order-row-' + orderId;
130
            if (orderTable != null) {
131
                for ( var index in orderTable.fnGetNodes()) {
132
                    var item = orderTable.fnGetNodes()[index];
133
                    if ($(item).attr('id') == trId) {
134
                        orderTable.fnDisplayRow(item);
135
                        break;
136
                    }
137
                }
138
            }
3220 mandeep.dh 139
 
7572 anupam.sin 140
            $('#user-orders tr, #orders-without-user tr').removeClass('selected');
3228 mandeep.dh 141
            $('#order-row-' + orderId).addClass('selected');
142
        }
143
    });
2714 vikas 144
}
145
 
3228 mandeep.dh 146
function loadLineInfo(domId, userId, itemId) {
147
    $.ajax({
148
        type : "GET",
149
        url : "/crm/user-line-info?userId=" + userId + "&itemId=" + itemId,
150
        success : function(response) {
151
            $('#' + domId).html(response);
152
            $('#user-cart tr').removeClass('selected');
153
            $('#cart-row-' + itemId).addClass('selected');
154
        }
155
    });
2830 vikas 156
}
157
 
3228 mandeep.dh 158
function loadTicketInfo(domId, ticketId, ticketTable, activityId) {
159
    $.ajax({
160
        type : "GET",
3405 mandeep.dh 161
        url : "/crm/tickets/" + ticketId + "/edit",
3228 mandeep.dh 162
        success : function(response) {
163
            $('#' + domId).html(response);
3206 mandeep.dh 164
 
3228 mandeep.dh 165
            var trId = 'ticket-row-' + ticketId;
166
            if (ticketTable != null) {
167
                for ( var index in ticketTable.fnGetNodes()) {
168
                    var item = ticketTable.fnGetNodes()[index];
169
                    if ($(item).attr('id') == trId) {
170
                        ticketTable.fnDisplayRow(item);
171
                        break;
172
                    }
173
                }
174
            }
3206 mandeep.dh 175
 
3228 mandeep.dh 176
            $('#tickets tr').removeClass('selected');
177
            $('#' + trId).addClass('selected');
178
 
179
            // For tickets accessed from activity page
180
            if (activityId != null) {
3339 mandeep.dh 181
                $('#activity tr').removeClass('selected');
3228 mandeep.dh 182
                $('#activity-row-' + activityId).addClass('selected');
183
            }
18348 amit.gupta 184
            $('#tr-table').dataTable({
185
            	"bAutoWidth": false,
186
          		"bLengthChange": false,
187
	            "bFilter": false,
188
            	"aoColumns" : [{ "sWidth": "8%" },
189
                	           { "sWidth": "8%" },
190
                    	       { "sWidth": "8%" },
191
                        	   { "sWidth": "50%" },
18354 amit.gupta 192
                        	   { "sWidth": "13%" },
18349 amit.gupta 193
                        	   { "sWidth": "13%" }],
18348 amit.gupta 194
 
195
                "iDisplayLength" : 10,
196
                //"fnDrawCallback": function() {truncateText(100);},
18855 amit.gupta 197
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
18348 amit.gupta 198
            });
3546 mandeep.dh 199
 
200
            $('#order-table').dataTable({
18348 amit.gupta 201
                //"aaSorting" : [ [ 2, 'desc' ] ],
18345 amit.gupta 202
	            "bAutoWidth": false,
18354 amit.gupta 203
	            "aoColumns" : [{ "sWidth": "8%" },
18625 amit.gupta 204
	                           { "sWidth": "40%" },
205
	                           { "sWidth": "5%" },
18345 amit.gupta 206
	                           { "sWidth": "10%" },
18348 amit.gupta 207
	                           { "sWidth": "17%" },
208
	                           { "sWidth": "10%" },
18354 amit.gupta 209
	                 		   { "sWidth": "10%" },
210
	                 		   {"bVisible": false}],
18345 amit.gupta 211
                //"iDisplayLength" : 10,
18348 amit.gupta 212
                "fnDrawCallback": function() {
213
	                $('.mk_transaction').click(function(){
214
 
215
	                });
216
                },
18855 amit.gupta 217
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
18345 amit.gupta 218
            });
3228 mandeep.dh 219
        }
220
    });
3090 mandeep.dh 221
}
222
 
3405 mandeep.dh 223
function createTicketDataTable(domId) {
3499 mandeep.dh 224
    var ticketsTable = $('#' + domId).dataTable({
4142 mandeep.dh 225
         "aaSorting" : [ [ 3, 'asc' ] ],
4241 anupam.sin 226
         "bAutoWidth": false,
227
         "aoColumns" : [{ "sWidth": "9%" },//ticket id
228
                        { "sWidth": "16%" },//customer id or Description when orderId is set
229
                        { "sWidth": "21%" },//category id
230
                        { "sWidth": "13%" },//date created
231
                        { "sWidth": "13%" },//date closed
232
                        { "sWidth": "12%" },//assignee
233
                        { "sWidth": "8%" },//status
234
                        { "sWidth": "8%" }],//priority
3546 mandeep.dh 235
        "fnDrawCallback": function() {truncateText(85);},
4605 anupam.sin 236
        "iDisplayLength" : 10,
3339 mandeep.dh 237
        "sDom" : 'T<"clear">lfrtip',
238
        "oTableTools" : {
5203 amar.kumar 239
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf",
240
            "sExtends": "csv",
241
            "sFieldSeperator": "`"
3339 mandeep.dh 242
        },
243
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
244
    });
3499 mandeep.dh 245
 
246
    return ticketsTable;
3339 mandeep.dh 247
}
248
 
4241 anupam.sin 249
function loadActivityDescription(domId, aActivityId) {
5521 amar.kumar 250
	if($(aActivityId).attr('isRead')=="true") {
251
		$('#' + domId).html("<h4>Activity Description :</h4><pre>" + $(aActivityId).parent().siblings('td[id="activity-description"]').attr('title') + '</pre>');
252
	} else {
253
		$('#' + domId).html("<h4>Activity Description :</h4><pre>" + $(aActivityId).parent().siblings('td[id="activity-description"]').attr('title') + 
254
				'</pre><br/><input type="button" value="Mark as read" activityid="'+ $(aActivityId).attr('activityid') +'" id="mark-as-read">');
255
	}
4241 anupam.sin 256
    $('#activity-table tr').removeClass('selected');
257
    $(aActivityId).parent().parent().addClass('selected');
258
}
259
 
3422 mandeep.dh 260
function loadActivityInfo(domId, activityId) {
3228 mandeep.dh 261
    $.ajax({
262
        type : "GET",
3422 mandeep.dh 263
        url : "/crm/activity-info?activityId=" + activityId,
3228 mandeep.dh 264
        success : function(response) {
265
            $('#' + domId).html(response);
3339 mandeep.dh 266
            $('#activity tr').removeClass('selected');
3228 mandeep.dh 267
            $('#activity-row-' + activityId).addClass('selected');
3390 mandeep.dh 268
            $('#activity').css('table-layout', 'fixed');
3228 mandeep.dh 269
        }
270
    });
3090 mandeep.dh 271
}
272
 
3405 mandeep.dh 273
function createActivityDataTable(domId) {
3499 mandeep.dh 274
    var activityTable = $('#' + domId).dataTable({
3339 mandeep.dh 275
        "aaSorting" : [ [ 4, 'desc' ] ],
4241 anupam.sin 276
     "bAutoWidth": false,
5203 amar.kumar 277
      "aoColumns" : [{ "sWidth": "7%" },//id
278
                     { "sWidth": "18%" },//activity type
279
                     { "sWidth": "11%" },//description
280
                     { "sWidth": "11%" },//timestamp
4241 anupam.sin 281
                     { "sWidth": "12%" },//creator
5203 amar.kumar 282
                     { "sWidth": "6%" },//customer id
283
                     { "sWidth": "7%" },//ticket id
284
                     { "sWidth": "7%" },//ticket status
285
                     { "sWidth": "12%" },//category
286
                     { "sWidth": "9%" }],//contact number
4605 anupam.sin 287
        "iDisplayLength" : 10,
3339 mandeep.dh 288
        "sDom" : 'T<"clear">lfrtip',
3546 mandeep.dh 289
        "fnDrawCallback": function() {truncateText(95);},
3339 mandeep.dh 290
        "oTableTools" : {
5203 amar.kumar 291
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf",
292
            "sExtends": "csv",
293
            "sFieldSeperator": "`"
3339 mandeep.dh 294
        },
295
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
296
    });
3499 mandeep.dh 297
 
298
    return activityTable;
3339 mandeep.dh 299
}
300
 
4793 amar.kumar 301
function loadAgentsInfo(domId) {
302
	$.ajax({
303
		type    : "GET",
304
		url	    : "/crm/agent",
305
		success : function(response) {
306
			$('#' + domId).html(response);
307
 
308
			var agentTable = $('#agents').dataTable({
309
                "aaSorting" : [ [ 1, 'asc' ] ],
310
                "bAutoWidth": false,
311
                "aoColumns" : [{ "sWidth": "12%", "sSortDataType": "dom-text", "sType": "numeric" },//AgentID
7162 kshitij.so 312
                               { "sWidth": "25%" },//Agent Name
313
                               { "sWidth": "30%" },//Email ID
314
                               { "sWidth": "20%" },//Role
4793 amar.kumar 315
                               { "sWidth": "13%", "sSortDataType": "dom-text", "sType": "numeric"}],//Manager ID
316
                "iDisplayLength" : 10,
317
                "sDom" : 'T<"clear">lfrtip',
318
                "oTableTools" : {
319
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
320
                },
321
            });
322
		}
323
	});
324
}
325
 
5909 amar.kumar 326
function loadAllOpenTickets(domId) {
327
	$.ajax({
328
		type    : "GET",
329
		url	    : "/crm/tickets!getAllOpenTickets",
330
		success : function(response) {
331
			$('#' + domId).html(response);
332
 
333
			var agentTable = $('#open-tickets').dataTable({
334
                "aaSorting" : [ [ 1, 'asc' ] ],
335
                "bAutoWidth": true,
336
                "iDisplayLength" : 25,
337
                "sDom" : 'T<"clear">lfrtip',
338
                "oTableTools" : {
339
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
340
                },
341
            });
342
		}
343
	});
344
}
345
 
3405 mandeep.dh 346
function loadTicketCreationForm(domId, params) {
3228 mandeep.dh 347
    $.ajax({
348
        type : "GET",
3339 mandeep.dh 349
        url : "/crm/tickets/new",
3405 mandeep.dh 350
        data : params,
3339 mandeep.dh 351
        success : function(response) {
352
            $('#' + domId).html(response);
353
        }
354
    });
355
}
356
 
3405 mandeep.dh 357
function loadActivityCreationForm(domId, params) {
3339 mandeep.dh 358
    $.ajax({
359
        type : "GET",
360
        url : "/crm/activity/new",
3405 mandeep.dh 361
        data : params,
3339 mandeep.dh 362
        success : function(response) {
363
            $('#' + domId).html(response);
364
        }
365
    });
366
}
367
 
3090 mandeep.dh 368
function updateTicket(domId, ticketId, params) {
3228 mandeep.dh 369
    $.ajax({
4782 mandeep.dh 370
        type : "POST",
371
        url : "/crm/tickets!update?id=" + ticketId,
372
        data : params,
3228 mandeep.dh 373
        success : function(response) {
3339 mandeep.dh 374
            var ticketTable = $('table[id$="tickets"]');
375
            if (ticketTable.length == 1) {
376
                var rowIndex = ticketTable.dataTable().fnGetPosition($('tr#ticket-row-' + ticketId)[0]);
377
                var responseObj = jQuery(response);
3546 mandeep.dh 378
                var actionMessages = responseObj.find('#action-messages').html();
3339 mandeep.dh 379
                responseObj.find('#ticket-row-' + ticketId).children().each(
380
                        function(i, item) {
381
                            var th = responseObj.find('th').eq(i);
382
                            if (th.text() == "Ticket Id") {
383
                                return;
384
                            }
385
 
386
                            var thOld = ticketTable.find('th').filter(
387
                                    function(index) {
388
                                        if ($(this).text() == th.text()) {
389
                                            return true;
390
                                        }
391
 
392
                                        return false;
393
                                    });
394
 
4249 anupam.sin 395
                            if ($(thOld).length != 0) {
3339 mandeep.dh 396
                                ticketTable.dataTable().fnUpdate($(item).text(), rowIndex, $(thOld).index(), true, false);
397
                            }
398
                        });
399
 
3546 mandeep.dh 400
                loadTicketInfo("bottom-infopane", ticketId, ticketTable.dataTable(), null);
3339 mandeep.dh 401
                ticketTable.css('table-layout', 'fixed');
3546 mandeep.dh 402
 
403
                var alertString = jQuery.trim(actionMessages);
404
                if (alertString != '') {
405
                    alert(alertString);
406
                }
3339 mandeep.dh 407
            }
408
            else {
409
                loadTicketInfo("bottom-infopane", ticketId, null, null);
410
            }
411
 
3499 mandeep.dh 412
            truncateText(85);
3339 mandeep.dh 413
        }
414
    });
415
}
416
 
3090 mandeep.dh 417
function createTicket(domId, params) {
3228 mandeep.dh 418
    $.ajax({
419
        type : "POST",
3339 mandeep.dh 420
        url : "/crm/tickets",
3228 mandeep.dh 421
        data : params,
422
        success : function(response) {
423
            $('#' + domId).html(response);
3405 mandeep.dh 424
            var ticketTable = createTicketDataTable('tickets');
3228 mandeep.dh 425
        }
426
    });
3090 mandeep.dh 427
}
428
 
4793 amar.kumar 429
function createAgent(params, managerId){
430
	$.ajax({
431
		type : "POST",
432
		url : "/crm/agent!createAgent?managerId="+managerId,
433
		data : params,
434
		success : function(response) {
435
			alert("Agent created with the specified information");
436
			$.colorbox.close();
437
			$('#infopane').html(response);
438
			var agentTable = $('#agents').dataTable({
439
                "aaSorting" : [ [ 1, 'asc' ] ],
440
                "bAutoWidth": false,
441
                "aoColumns" : [{ "sWidth": "12%", "sSortDataType": "dom-text", "sType": "numeric" },//AgentID
7162 kshitij.so 442
                               { "sWidth": "25%" },//Agent Name
443
                               { "sWidth": "30%" },//Email ID
444
                               { "sWidth": "20%" },//Role
4793 amar.kumar 445
                               { "sWidth": "13%", "sSortDataType": "dom-text", "sType": "numeric"}],//Manager ID
446
                "iDisplayLength" : 10,
447
                "sDom" : 'T<"clear">lfrtip',
448
                "oTableTools" : {
449
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
450
                },
451
            });
452
		}
453
	});
454
}
455
 
5168 amar.kumar 456
function changeAgentRole(params){
457
	$.ajax({
458
		type : "POST",
459
		url : "/crm/agent!changeAgentRole",
460
		data : params,
461
		success : function(response) {
462
			alert("Agent role changed");
463
			$.colorbox.close();
464
			$('#infopane').html(response);
465
			var agentTable = $('#agents').dataTable({
466
                "aaSorting" : [ [ 1, 'asc' ] ],
467
                "bAutoWidth": false,
468
                "aoColumns" : [{ "sWidth": "12%", "sSortDataType": "dom-text", "sType": "numeric" },//AgentID
7162 kshitij.so 469
                               { "sWidth": "25%" },//Agent Name
470
                               { "sWidth": "30%" },//Email ID
471
                               { "sWidth": "20%" },//Role
5168 amar.kumar 472
                               { "sWidth": "13%", "sSortDataType": "dom-text", "sType": "numeric"}],//Manager ID
473
                "iDisplayLength" : 10,
474
                "sDom" : 'T<"clear">lfrtip',
475
                "oTableTools" : {
476
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
477
                },
478
            });
479
		}
480
	});
481
}
482
 
3090 mandeep.dh 483
function createActivity(domId, params) {
3228 mandeep.dh 484
    $.ajax({
485
        type : "POST",
3339 mandeep.dh 486
        url : "/crm/activity",
3228 mandeep.dh 487
        data : params,
488
        success : function(response) {
489
            $('#' + domId).html(response);
3405 mandeep.dh 490
            var activityTable = createActivityDataTable('activity');
3228 mandeep.dh 491
        }
492
    });
3106 mandeep.dh 493
}
494
 
495
function goToHomePage() {
3228 mandeep.dh 496
    document.location.href = "/crm";
3106 mandeep.dh 497
}
498
 
3422 mandeep.dh 499
function loadTickets(domId, getURL, ticketId) {
3228 mandeep.dh 500
    $.ajax({
501
        type : "GET",
3234 mandeep.dh 502
        url : getURL,
3228 mandeep.dh 503
        success : function(response) {
504
            $('#' + domId).html(response);
3405 mandeep.dh 505
            var ticketTable = createTicketDataTable('tickets');
3422 mandeep.dh 506
            if (ticketId != null) {
507
                loadTicketInfo("bottom-infopane", ticketId, ticketTable.dataTable(), null);
508
                ticketTable.css('table-layout', 'fixed');
509
            }
3228 mandeep.dh 510
        }
511
    });
3106 mandeep.dh 512
}
5225 amar.kumar 513
function changeActivityFormValidCriteria(commonDescription) {
514
	if(commonDescription == "") {
515
		$('#description').addClass('required');
516
	} else {
517
		$('#description').removeClass('required');
518
	}
519
}
3137 mandeep.dh 520
 
3422 mandeep.dh 521
function processActivityTypeChange(activityType) {
5203 amar.kumar 522
	if(activityType != "RECEIVED_CALL_FROM_CUSTOMER") {
523
		$('select#common-activity-desc').hide();
5224 amar.kumar 524
		$('#description').addClass('required');
5203 amar.kumar 525
	} else {
526
		$('select#common-activity-desc').show();
527
	}
3269 mandeep.dh 528
    if (activityType == "SEND_EMAIL_TO_CUSTOMER") {
3228 mandeep.dh 529
        $.colorbox({
530
            inline : true,
3519 mandeep.dh 531
            width : "775px",
532
            height : "445px",
3228 mandeep.dh 533
            href : "div#mail-div",
534
            onClosed : function() {
3519 mandeep.dh 535
				CKEDITOR.instances['mail-body'].destroy(false);
3228 mandeep.dh 536
                $("div#mail-div").hide();
537
                $('select#activity-type').val('OTHER');
538
            }
539
        });
3206 mandeep.dh 540
 
3228 mandeep.dh 541
        $("div#mail-div").show();
3701 mandeep.dh 542
        $('#mail-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
3228 mandeep.dh 543
    }
4020 mandeep.dh 544
    else if (activityType == "ESCALATE_TICKET") {
545
        $.colorbox({
546
            inline : true,
547
            width : "675px",
18308 amit.gupta 548
            height : "560px",
4020 mandeep.dh 549
            href : "div#escalation-div",
550
            onClosed : function() {
551
                CKEDITOR.instances['escalation-mail-body'].destroy(false);
552
                $("div#escalation-div").hide();
553
                $('select#activity-type').val('OTHER');
554
            }
555
        });
556
 
557
        $("div#escalation-div").show();
558
        $('#escalation-mail-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
559
    }
3206 mandeep.dh 560
}
561
 
562
function processInputFormSubmit() {
3228 mandeep.dh 563
    $.ajax({
564
        type : "POST",
565
        url : "/crm/",
566
        success : function(response) {
567
            $.html(response);
3405 mandeep.dh 568
            var ticketTable = createTicketDataTable('tickets');
3228 mandeep.dh 569
        }
570
    });
3339 mandeep.dh 571
}
572
 
573
function listActivities(domId, params) {
574
    $.ajax({
575
        type : "GET",
576
        url : "/crm/activity",
577
        data : params,
578
        success : function(response) {
579
            $('#' + domId).html(response);
3405 mandeep.dh 580
            var activityTable = createActivityDataTable('activity');
3339 mandeep.dh 581
        }
582
    });
583
}
584
 
18345 amit.gupta 585
function truncateText(widthSize, jqueryContainer) {
586
	if(typeof jqueryContainer!="undefined"){
587
	    jqueryContainer.find(".truncated-text").each(function() {
588
	    	$(this).truncate({
589
	            width : $(this).attr('truncatedTextWidth'),
590
	            addtitle : true
591
	        });
592
		})
593
	}else {
594
	    $(".truncated-text").each(function() {
595
	    	$(this).truncate({
596
	            width : $(this).attr('truncatedTextWidth'),
597
	            addtitle : true
598
	        });
599
		})
600
	}
3339 mandeep.dh 601
}
3390 mandeep.dh 602
 
603
function markAsRead(activityId) {
604
    $.ajax({
605
        type : "POST",
606
        url : "/crm/activity!markAsRead?activityId=" + activityId,
607
        success: function(response) {
608
            listActivities('infopane', "creatorId=1");
609
        }
610
    });
611
}
3397 mandeep.dh 612
 
613
function loadAdvancedSearchBox() {
614
    $.colorbox({
615
        inline : true,
616
        width : "535px",
617
        height : "465px",
618
        href : "form#search",
619
        onClosed : function() {
620
            $("form#search").hide();
621
        }
622
    });
623
 
624
    $("form#search").show();
625
}
626
 
627
function processSearchEntityChange(searchEntity) {
628
    if (searchEntity == "Tickets") {
629
        $("#assignee").show();
630
        $("#creator").hide();
4142 mandeep.dh 631
        $("tr#activityTypes").hide();
3397 mandeep.dh 632
    }
633
    else if (searchEntity == "Activities") {
634
        $("#assignee").hide();
635
        $("#creator").show();
4142 mandeep.dh 636
        $("tr#activityTypes").show();
3397 mandeep.dh 637
    }
638
}
3499 mandeep.dh 639
 
640
function increaseTrustLevel(domId, userId, trustLevelDelta) {
641
    $.ajax({
642
        type : "PUT",
643
        url : "/crm/user-info/" + userId + "?trustLevelDelta=" + trustLevelDelta,
644
        success : function(response) {
645
            $('#' + domId).html(response);
646
        }
647
    });
648
}
649
 
11890 kshitij.so 650
function addPrivateDealUser(domId, userId) {
651
    $.ajax({
652
        type : "PUT",
653
        url : "/crm/user-info!addPrivateDealUser?userId=" + userId,
654
        success : function(response) {
655
            $('#' + domId).html(response);
656
        }
657
    });
658
}
659
 
660
function changePrivateDealUserStatus(domId, userId, state) {
661
    $.ajax({
662
        type : "PUT",
663
        url : "/crm/user-info!changeStatusOfPrivateDealUser?userId=" + userId+ "&isPrivateDealUserActive=" + state,
664
        success : function(response) {
665
            $('#' + domId).html(response);
666
        }
667
    });
668
}
669
 
670
function resetPasswordForPrivateDealUser(domId, userId) {
671
    $.ajax({
672
        type : "PUT",
673
        url : "/crm/user-info!resetPrivateDealUserPassword?userId=" + userId,
674
        success : function(response) {
675
            $('#' + domId).html(response);
676
        },
677
    	error : function() {
678
    		alert("Unable to reset password.");
679
    	}
680
    });
681
}
682
 
4241 anupam.sin 683
function displayCancelOrderPopUp() {
684
    	$.colorbox({
685
            inline : true,
686
            width : "650px",
4314 anupam.sin 687
            height : "550px",
4689 anupam.sin 688
            href : "div#cancel-div",
4241 anupam.sin 689
            onClosed : function() {
4689 anupam.sin 690
                CKEDITOR.instances['cancel-body'].destroy(false);
691
                $("div#cancel-div").hide();
4241 anupam.sin 692
            }
693
        });
694
 
4689 anupam.sin 695
        $("div#cancel-div").show();
696
        $('#cancel-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
4241 anupam.sin 697
}
698
 
7393 anupam.sin 699
function displayCancelStoreOrderPopUp() {
700
	$.colorbox({
701
        inline : true,
702
        width : "650px",
703
        height : "550px",
704
        href : "#cancel-store-order-div",
705
        onClosed : function() {
706
            CKEDITOR.instances['cancel-store-order-body'].destroy(false);
707
            $("#cancel-store-order-div").hide();
708
        }
709
    });
710
 
711
    $("#cancel-store-order-div").show();
712
    $('#cancel-store-order-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
713
}
714
 
4241 anupam.sin 715
function cancelOrder(domId, ticketId, orderId, orderStatus, formData) {
4704 anupam.sin 716
	if ($('#cancellationInitiator').val()) {
4689 anupam.sin 717
		var cancellationInitiator = $('#cancellationInitiator').val();
718
		var uri = "/crm/user-order-info!markOrderForCancellation?orderId=" + orderId
719
						+ "&cancellationInitiator=" + cancellationInitiator + "&" + formData;
720
		var cancellationResult = function() {
721
			document.location.href = "/crm?email=&orderId=" + orderId;
722
		}
723
	} else {
724
		var uri = "/crm/tickets!updateOrderStatus?id=" + ticketId + "&orderId=" + orderId
725
						+ "&orderStatus=" + orderStatus + "&" + formData;
726
		var cancellationResult = function(response) {
727
            $('#' + domId).html(response);
728
        }
729
	}
4241 anupam.sin 730
    $.ajax({
731
        type : "POST",
4689 anupam.sin 732
        url : uri,
733
        success : cancellationResult
4241 anupam.sin 734
    });
4681 amar.kumar 735
 
736
    if(formData.indexOf("LOWER_PRICE_AVAILABLE_ELSEWHERE")!=-1){
737
    	var desc = formData.split("&");
738
    	var description = "Order cancelled because of Lower Price Available elsewhere";
739
    	$.ajax({
740
    		type : "POST",
741
    		url : "/crm/tickets?orderId="+orderId+"&priority=MEDIUM&category=PRODUCT_PROCUREMENT"
742
    				+ "&assigneeEmailId=chaitnaya.vats@shop2020.in&description="+description+"&"+desc[1],
743
    		success : function(response){
744
    			alert("Ticket created for Lower Price Available elsewhere");
745
    		}
746
    	});
747
 
748
    }
4241 anupam.sin 749
}
4065 mandeep.dh 750
 
7393 anupam.sin 751
function cancelStoreOrder(domId, ticketId, orderId, orderStatus, formData) {
752
	if ($('#cancellationInitiator').val() != "CUSTOMER" && $('#cancellationInitiator').val() != "INTERNAL") {
753
		alert("Cannot refund");
754
		return false;
755
	} 
756
	var cancellationInitiator = $('#cancellationInitiator').val();
757
	var uri = "/crm/user-order-info!markOrderForCancellation?orderId=" + orderId
758
					+ "&cancellationInitiator=" + cancellationInitiator + "&" + formData;
759
	var cancellationResult = function() {
760
		document.location.href = "/crm?email=&orderId=" + orderId;
761
	}
762
 
763
    $.ajax({
764
        type : "POST",
765
        url : uri,
766
        success : cancellationResult
767
    });
768
}
769
 
4241 anupam.sin 770
function updateOrderStatus(domId, ticketId, orderId, orderStatus) {
3499 mandeep.dh 771
    $.ajax({
3546 mandeep.dh 772
        type : "POST",
4241 anupam.sin 773
        url : "/crm/tickets!updateOrderStatus?id=" + ticketId + "&orderId=" + orderId
774
        					+ "&orderStatus=" + orderStatus,
3499 mandeep.dh 775
        success : function(response) {
3546 mandeep.dh 776
            $('#' + domId).html(response);
3499 mandeep.dh 777
        }
778
    });
3711 mandeep.dh 779
}
780
 
781
function loadUnreadActivities(domId) {
782
    $.ajax({
783
        type : "GET",
784
        url : "/crm/activity!getUnreadActivities",
785
        success : function(response) {
786
            $('#' + domId).html(response);
787
            var activityTable = createActivityDataTable('activity');
788
        }
789
    });
790
}
4065 mandeep.dh 791
 
792
function refreshSidebar() {
793
    $.ajax({
4142 mandeep.dh 794
        type : "PUT",
795
        url : "/crm",
796
        success : function(response) {
797
            $('#sidebar').html($(response).find('#sidebar').html());
798
        }
799
    });
800
}
801
 
802
function changeAddress(urlParams) {
803
    $.ajax({
4065 mandeep.dh 804
        type : "GET",
805
        url : "/crm",
806
        success : function(response) {
807
            $('#sidebar').html($(response).find('#sidebar').html());
808
        }
809
    });
4267 anupam.sin 810
}
811
 
4681 amar.kumar 812
function showHidecancelReasonDiv(cancelReason){
4793 amar.kumar 813
	var reasonsToShowDiv = ['LOWER_PRICE_AVAILABLE_ELSEWHERE','OTHER','OUT_OF_STOCK','COLOR_OUT_OF_STOCK'];
814
	if(($.inArray(cancelReason, reasonsToShowDiv))!=-1){
4681 amar.kumar 815
		$('#cancelReasonBox').show();
816
	} else {
817
		$('#cancelReasonBox').hide();
818
	}
819
}
820
 
4438 anupam.sin 821
function blockPayment(transactionId, ticketId, paymentId) {
4267 anupam.sin 822
	$.ajax({
823
		type : "GET",
4451 anupam.sin 824
		url : "/crm/tickets!blockPayment?transactionId=" + transactionId + "&id=" + ticketId + "&paymentId=" + paymentId,
4267 anupam.sin 825
		success : function(response) {
826
            $('#bottom-infopane').html(response);
827
        }
828
	});
829
}
830
 
4438 anupam.sin 831
function allowPayment(transactionId, ticketId, paymentId) {
4267 anupam.sin 832
	$.ajax({
833
		type : "GET",
4451 anupam.sin 834
		url : "/crm/tickets!allowPayment?transactionId=" + transactionId + "&id=" + ticketId + "&paymentId=" + paymentId,
4267 anupam.sin 835
		success : function(response) {
836
            $('#bottom-infopane').html(response);
837
        }
838
	});
4490 anupam.sin 839
}
840
 
841
function denyDOA(orderId, ticketId) {
842
	$.ajax({
843
		type : "GET",
844
		url : "/crm/tickets!denyDOA?orderId=" + orderId + "&id=" + ticketId,
845
		success : function(response) {
846
            $('#bottom-infopane').html(response);
847
        }
848
	});
849
}
850
 
851
 
852
function authorizeDOA(orderId, ticketId) {
853
	$.ajax({
854
		type : "GET",
855
		url : "/crm/tickets!authorizeDOA?orderId=" + orderId + "&id=" + ticketId,
856
		success : function(response) {
857
            $('#bottom-infopane').html(response);
858
        }
859
	});
860
}
861
 
862
function denyReturn(orderId, ticketId) {
863
	$.ajax({
864
		type : "GET",
865
		url : "/crm/tickets!denyReturn?orderId=" + orderId + "&id=" + ticketId,
866
		success : function(response) {
867
            $('#bottom-infopane').html(response);
868
        }
869
	});
870
}
871
 
872
 
873
function authorizeReturn(orderId, ticketId) {
874
	$.ajax({
875
		type : "GET",
876
		url : "/crm/tickets!authorizeReturn?orderId=" + orderId + "&id=" + ticketId,
877
		success : function(response) {
878
            $('#bottom-infopane').html(response);
879
        }
880
	});
4689 anupam.sin 881
}
882
 
883
function markOrderForCancellation(orderId, formData) {
884
	console.log(typeof(orderId), typeof(formData), orderId, formData);
885
 
886
	$.ajax({
887
		type : "GET",
888
		url : "/crm/user-order-info!markOrderForCancellation?orderId=" + orderId + "&cancellationInitiator=" + formData,
889
		success : function(response) {
890
			document.location.href = "/crm?email=&orderId=" + orderId;
891
        }
892
	});
4793 amar.kumar 893
}
894
 
895
function loadAgentCreationForm() {
896
	$.colorbox({
897
        inline : true,
898
        width : "550px",
899
        height : "400px",
900
        href : "div#create-agent-div",
901
        onClosed : function() {
902
            $("div#create-agent-div").hide();
903
        }
904
    });
905
 
906
    $("div#create-agent-div").show();
907
 
908
}
909
 
910
function deactivateAgentPopup() {
911
	$.colorbox({
912
        inline : true,
913
        width : "400px",
914
        height : "150px",
915
        href : "div#deactivate-agent-div",
916
        onClosed : function() {
917
            $("div#deactivate-agent-div").hide();
918
        }
919
    });
920
 
921
    $("div#deactivate-agent-div").show();
922
 
923
}
924
 
925
function changeAgentPasswordPopup(){
926
	$.colorbox({
927
        inline : true,
928
        width  : "350px",
929
        height : "350px",
930
        href   : "div#change-password-div",
931
        onClosed : function() {
932
            $("div#change-password-div").hide();
933
        }
934
    });
935
 
936
    $("div#change-password-div").show();
937
}
938
 
5168 amar.kumar 939
function changeAgentRolePopup(){
940
	$.colorbox({
941
        inline : true,
942
        width  : "375px",
943
        height : "350px",
944
        href   : "div#change-agent-role-div",
945
        onClosed : function() {
946
            $("div#change-agent-role-div").hide();
947
        }
948
    });
4793 amar.kumar 949
 
5168 amar.kumar 950
    $("div#change-agent-role-div").show();
951
}
952
 
4793 amar.kumar 953
function updateAgentPassword(){
954
	if(($('#change-password1').val().trim())==($('#change-password2').val().trim())){
955
		$.ajax({
956
			type : "POST",
957
			url : "/crm/agent!changePassword?emailId=" + $('#agentEmail').val() + "&newPassword=" + $('#change-password1').val().trim(),
958
			success : function(response) {
959
				alert("Password updated successfully");
960
				$.colorbox.close();
961
			}
962
		});
963
	}
964
	else { 
965
		alert("Passwords not matching");
966
		return false;
967
	}
968
}
969
 
970
function validateAgentCreationForm(){
971
	var formError = false;
972
	if($('#new-agent-name').val().length == 0) {
973
		$('#agent-name-error').html("Please enter the name");
974
		$('#new-agent-name').addClass('agent-form-error');
975
		formError = true;
976
	}
977
	if(($('#new-agent-id').val().length == 0)) {
978
		$('#agent-email-error').html("Please enter the Email-ID");
979
		$('#new-agent-id').addClass('agent-form-error');
980
		formError = true;
981
	}
982
	if($('#create-password1').val().length == 0) {
983
		$('#agent-password1-error').html("Please enter password");
984
		$('#create-password1').addClass('agent-form-error');
985
		formError = true;
986
	} else if($('#create-password2').val().length == 0){
987
		$('#agent-password2-error').html("Please re enter password");
988
		$('#create-password2').addClass('agent-form-error');
989
		formError = true;
990
	} else if($('#create-password1').val()!=$('#create-password2').val()) {
991
		$('#agent-password1-error').html("Please make sure you entered same passwords");
992
		$('#create-password1').addClass('agent-form-error');
993
		$('#create-password2').addClass('agent-form-error');
994
		formError = true;
995
	}
996
 
997
	if(formError){
998
		return false;
999
	}
1000
	return true;
1001
}
1002
 
1003
function clearAgentCreationForm() {
1004
		$('#agent-name-error').html("");
1005
		$('#new-agent-name').removeClass('agent-form-error');
1006
		$('#agent-email-error').html("");
1007
		$('#new-agent-id').removeClass('agent-form-error');
1008
		$('#agent-password1-error').html("");
1009
		$('#create-password1').removeClass('agent-form-error');
1010
		$('#agent-password2-error').html("");
1011
		$('#create-password2').removeClass('agent-form-error');
1012
		$('#agent-password1-error').html("");
1013
		$('#create-password1').removeClass('agent-form-error');
1014
		$('#create-password2').removeClass('agent-form-error');
1015
}
1016
 
1017
function deactivateAgent(emailId, id) {
1018
	$.ajax({
1019
		type : "POST",
1020
		url : "/crm/agent!deActivateAgent?emailId=" + emailId+ "&id=" + id,
7162 kshitij.so 1021
		success : function(response) { 
1022
			alert("Agent deactivated successfully");
4793 amar.kumar 1023
			$.colorbox.close();
1024
			$('#infopane').html(response);
1025
			var agentTable = $('#agents').dataTable({
1026
                "aaSorting" : [ [ 1, 'asc' ] ],
1027
                "bAutoWidth": false,
1028
                "aoColumns" : [{ "sWidth": "12%", "sSortDataType": "dom-text", "sType": "numeric" },//AgentID
7162 kshitij.so 1029
                               { "sWidth": "25%" },//Agent Name
1030
                               { "sWidth": "30%" },//Email ID
1031
                               { "sWidth": "20%" },//Role
4793 amar.kumar 1032
                               { "sWidth": "13%", "sSortDataType": "dom-text", "sType": "numeric"}],//Manager ID
1033
                "iDisplayLength" : 10,
1034
                "sDom" : 'T<"clear">lfrtip',
1035
                "oTableTools" : {
1036
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
1037
                },
1038
            });
1039
		}
1040
	});
5791 anupam.sin 1041
}
1042
 
5917 anupam.sin 1043
function extendExpiryDate(domId, ticketId, orderId, pickupExtension) {
5791 anupam.sin 1044
    $.ajax({
1045
        type : "POST",
5917 anupam.sin 1046
        url : "/crm/tickets!extendExpiry?id=" + ticketId + "&orderId=" + orderId + "&pickupExtension=" + pickupExtension,
5791 anupam.sin 1047
        success : function(response) {
1048
            $('#' + domId).html(response);
1049
        }
1050
    });
6507 anupam.sin 1051
}
1052
 
1053
function refundRechargeOrder(rechargeOrderId, domId) {
1054
	$.ajax({
1055
        type : "POST",
1056
        url : "/crm/recharge-order-info!refundRechargeOrder?rechargeOrderId=" + rechargeOrderId,
1057
        success : function(response) {
6516 anupam.sin 1058
        	location.reload();
6507 anupam.sin 1059
        },
1060
        error : function() {
1061
        	$('#' + domId).html("<div style='padding:15px 5px 15px 5px;color:red;'><b>Error in refunding. " +
1062
        			"<a href='/crm/?email=&mobileNumber=&orderId=&ticketId=&rechargeOrderId=" + rechargeOrderId + "&deviceNumber=&submit=Search'>Try again</a> or contact Engineering team.</b></div>");
1063
        }
1064
    });
6985 anupam.sin 1065
}
1066
 
7730 anupam.sin 1067
function convertStoreToNormal(orderId) {
1068
	$.ajax({
1069
        type : "POST",
7732 anupam.sin 1070
        url : "/crm/user-order-info!convertStoreToNormal?orderId=" + orderId,
7730 anupam.sin 1071
        success : function() {
1072
        	location.reload();
1073
        },
1074
        error: function() {
1075
        	location.reload();
1076
        }
1077
    });
1078
}
1079
 
6985 anupam.sin 1080
function changeShippingAddress(orderId) {
1081
	$.ajax({
1082
        type : "POST",
1083
        url : "/crm/user-order-info!changeShippingAddress?orderId=" + orderId,
1084
        data : $('#shippingAddressFrm').serialize(),
1085
        success : function(response) {
1086
        	location.reload();
1087
        },
1088
        error : function() {
1089
        	location.reload();
1090
        }
1091
    });
7372 kshitij.so 1092
}
7572 anupam.sin 1093
 
8821 manish.sha 1094
function refundOrderPayment(params) {
1095
	$.ajax({
1096
        type : "POST",
1097
        url : "/crm/user-order-info!refundOrderPayment",
1098
        data : params,
1099
        success : function(response) {
1100
			alert(response);
1101
			location.reload();
1102
        },
1103
        error : function() {
1104
        	alert("Error in refund");
1105
        	location.reload();
1106
        }
1107
    });
1108
}
1109
 
7572 anupam.sin 1110
function loadOrdersByMobile(domId) {
1111
    orderTable = $('#orders-without-user').dataTable({
1112
      "aaSorting" : [ [ 1, 'desc' ] ],
1113
      "bAutoWidth": false,
11890 kshitij.so 1114
      "aoColumns" : [{ "sWidth": "5%" },//order id
1115
                     { "sWidth": "7%" },//Source
1116
                     { "sWidth": "20%" },//item desc
7572 anupam.sin 1117
                     { "sWidth": "16%" },//created
1118
                     { "sWidth": "7%" },//amount
1119
                     { "sWidth": "15%" },//status
11890 kshitij.so 1120
                     { "sWidth": "10%" },//mobile no.
1121
                     { "sWidth": "20%" }],//email
18345 amit.gupta 1122
        "fnDrawCallback": function() { truncateText(125, $(this)); },
7572 anupam.sin 1123
        "iDisplayLength" : 10,
1124
        "sDom" : 'T<"clear">lfrtip',
1125
        "oTableTools" : {
1126
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
1127
        },
1128
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
1129
    });
9166 manish.sha 1130
}
1131
 
1132
function loadRechargeOrdersByDeviceNo(domId){
1133
	orderTable = $('#recharge-orders').dataTable({
1134
	      "aaSorting" : [ [ 1, 'desc' ] ],
1135
	      "bAutoWidth": false,
9174 manish.sha 1136
	      "aoColumns" : [{ "sWidth": "13%" },//recharge order id
1137
                         { "sWidth": "22%" },//desc
9166 manish.sha 1138
                         { "sWidth": "16%" },//created
1139
                         { "sWidth": "8%" },//amount
1140
                         { "sWidth": "17%" },//status
9174 manish.sha 1141
                         { "sWidth": "10%" },//mobile no.
1142
                         { "sWidth": "14% "}],//email Id
9166 manish.sha 1143
	        "fnDrawCallback": function() { truncateText(125); },
1144
	        "iDisplayLength" : 10,
1145
	        "sDom" : 'T<"clear">lfrtip',
1146
	        "oTableTools" : {
1147
	            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
1148
	        },
1149
	        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
1150
	    });
7572 anupam.sin 1151
}