Subversion Repositories SmartDukaan

Rev

Rev 23884 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
23819 govind 1
$(function() {
2
	$(".price_drop").live('click', function() {
3
		loadPriceDrop("main-content");
4
	});
5
	$('#download').live('click', function (){
6
		if (confirm("Are you sure you want to Download!") == true) {
7
			priceDropId=$(this).data('download');
8
		console.log(priceDropId);
9
		doAjaxGetDownload(context+"/downloadPriceDropIMEI/"+priceDropId,
10
		"priceDrop"+priceDropId+".xlsx");
11
		}
12
	});
13
	$('#downloadtotalIMEI').live('click', function (){
14
		if (confirm("Are you sure you want to Download!") == true) {
15
		priceDropId=$(this).data('pricedropidfortotalimei');
16
		console.log(priceDropId);
17
		doAjaxGetDownload(context+"/downloadtotalPriceDropIMEI/"+priceDropId,
18
		"totalPriceDropIMEI"+priceDropId+".xlsx");
19
		}
20
	});
21
 
22
 
23
	$('#cashTopartner').live('click', function (){
24
		if (confirm("Are you sure you want to ProcessAmount!") == true) {
25
			priceDropId=$(this).data('cashback');
26
		var processedamount=$("#" +priceDropId).val();
27
		console.log("#" + priceDropId);
28
		//alert(processedamount);
29
		if(processedamount)
30
			{
31
		console.log(priceDropId);
32
		console.log(processedamount);
33
		loadProcessedamount(priceDropId,processedamount);
34
		}
35
		else
36
			{
37
			console.log(priceDropId);
38
			console.log(processedamount);
39
			alert("ProcessedAmount can't be empty");
40
			}
41
		}
42
	});
43
 
44
});
45
function loadPriceDrop(domId){
46
	doGetAjaxRequestHandler(context+"/getItemDescription", function(response){
47
		$('#' + domId).html(response);
48
	});
49
}
50
function loadProcessedamount(priceDropId,amount){
51
	doPostAjaxRequestHandler(context+"/paymentAgainstPriceDrop/"+priceDropId+"/"+amount,
52
		function(response) {
53
			if (response == 'true') {
54
				alert("PriceDrop sends successfully");
55
				loadPriceDrop("main-content");
56
			}
57
			else
58
				{
59
				alert("No IMEI is Eligible for PriceDrop");
60
				loadPriceDrop("main-content");
61
				}
62
	});
63
 
64
}