Subversion Repositories SmartDukaan

Rev

Rev 6260 | Rev 6292 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6260 Rev 6289
Line 8... Line 8...
8
		trackEventWithGA('Recharge', 'Recharge Type', 'Mobile');
8
		trackEventWithGA('Recharge', 'Recharge Type', 'Mobile');
9
		$('#serviceType').val('1');
9
		$('#serviceType').val('1');
10
		$('#serviceSelectForm').submit();
10
		$('#serviceSelectForm').submit();
11
	});
11
	});
12
	
12
	
13
	/*$('#confirm-button').click(function(){
13
	jQuery('#planDropDown').change(function() {
-
 
14
		jQuery('#planDescription').html(jQuery('#planDropDown option:selected').attr('desc'));
-
 
15
	});
-
 
16
	
-
 
17
	jQuery('.showDenomination').live("click", function() {
-
 
18
		var denominationType = jQuery(this).attr('denominationType');
-
 
19
		var operatorId = jQuery('#operatorSelector option:selected').val();
14
		trackEventWithGA('Recharge', 'Confirm', '');
20
		var circleName = jQuery('#circleName').val();
15
		$('#rechargeDetailsForm').submit();
21
		jQuery('#popularPlansDiv').show();
-
 
22
		jQuery.ajax({
-
 
23
        	type : "GET",
-
 
24
        	url : "/recharge!getAllDenominations?operatorId=" + operatorId + "&circleName=" + circleName + "&denominationType=" + denominationType,
-
 
25
        	success : function(response) {
-
 
26
            	jQuery('#popularPlansInner').html(response);
-
 
27
        	},
-
 
28
			failure : function() {
-
 
29
				jQuery('#popularPlansInner').html("<div style='padding:15px;'>This information is unavailable for now.<br>You can recharge with the amount you normally use or you can try later.</div>");
-
 
30
			}
-
 
31
		});				
-
 
32
	});
-
 
33
	
-
 
34
	jQuery('.populateAmount').live("click", function() {
-
 
35
		jQuery('#amountInput').val(jQuery(this).text());
-
 
36
		jQuery('#popularPlansDiv').hide();
16
	});
37
	});
-
 
38
	
17
	$('#pay-now-button').click(function() {
39
	jQuery('#closePlans').click(function() {
18
		$('#create-recharge-form').submit();
40
		jQuery('#popularPlansDiv').hide();
19
	});*/
41
	});
20
	
42
	
21
	$.validator.addMethod("rangeamount", function(value,element){	
43
	$.validator.addMethod("rangeamount", function(value,element){	
22
		return value >= 10 && value <= 1000;
44
		return value >= 10 && value <= 1000;
23
	}, "Recharge amount should be between Rs. 10-1000");
45
	}, "Recharge amount should be between Rs. 10-1000");
24
	
46
	
Line 244... Line 266...
244
	function getRechargeProvider(deviceNumber, rechargeType){
266
	function getRechargeProvider(deviceNumber, rechargeType){
245
		return $.ajax({
267
		return $.ajax({
246
			type: "POST",
268
			type: "POST",
247
			url: "/recharge!getServiceProvider?deviceNumber=" + deviceNumber + "&serviceType=" + rechargeType,
269
			url: "/recharge!getServiceProvider?deviceNumber=" + deviceNumber + "&serviceType=" + rechargeType,
248
			success:function(msg){
270
			success:function(msg){
249
				if(msg>0){
271
				if(msg != ""){
-
 
272
					var deviceNumberInfo = msg.split(":");
250
					$('#rechargeDetailsForm select[name="operator"]').val(msg);
273
					$('#rechargeDetailsForm select[name="operator"]').val($.trim(deviceNumberInfo[0]));
-
 
274
					$('#circleName').val($.trim(deviceNumberInfo[1]));
251
					$('#operatorSelector').trigger('change');
275
					$('#operatorSelector').trigger('change');
252
				}
276
				}
253
			}
277
			}
254
		});
278
		});
255
	}
279
	}