| 11289 |
lgm |
1 |
var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
|
2 |
if(document.getElementsByClassName('mobile-recharge')[0] != undefined){
|
|
|
3 |
document.getElementsByClassName('mobile-recharge')[0].style.minHeight = pheight - 195 +'px';
|
|
|
4 |
}
|
|
|
5 |
if(document.getElementsByClassName('dth-recharge')[0] != undefined){
|
|
|
6 |
document.getElementsByClassName('dth-recharge')[0].style.minHeight = pheight - 195 +'px';
|
|
|
7 |
}
|
|
|
8 |
if(document.getElementsByClassName('conf-cont')[0] != undefined){
|
|
|
9 |
document.getElementsByClassName('conf-cont')[0].style.minHeight = pheight - 170 +'px';
|
|
|
10 |
}
|
| 10582 |
lgm |
11 |
var operatorId;
|
|
|
12 |
var circleCode;
|
| 11715 |
lgm |
13 |
var isOperaMini = (navigator.userAgent.indexOf('Opera Mini') > -1);
|
|
|
14 |
if(isOperaMini){
|
|
|
15 |
document.getElementById('operator-list').style.display = "block";
|
|
|
16 |
}
|
| 10582 |
lgm |
17 |
function operator(){
|
|
|
18 |
var number = document.getElementById('mobile-number').value;
|
| 11721 |
lgm |
19 |
number = number.trim();
|
|
|
20 |
if(!/^\d+$/.test(number)){
|
|
|
21 |
document.getElementById('error').style.display = "block";
|
|
|
22 |
document.getElementById('error').innerHTML ='Please Use numbers only for Mobile Number!';
|
|
|
23 |
window.scrollTo(0,0); return false;
|
|
|
24 |
}
|
| 10582 |
lgm |
25 |
if(number.length == 10)
|
|
|
26 |
{
|
| 11325 |
lgm |
27 |
|
| 10582 |
lgm |
28 |
var url = base_url+'recharge/operator/'+number;
|
|
|
29 |
//window.location.href = a;
|
|
|
30 |
microAjax(url, function (res) {
|
| 11325 |
lgm |
31 |
|
| 10582 |
lgm |
32 |
if(res != ''){
|
| 11325 |
lgm |
33 |
|
| 10582 |
lgm |
34 |
var data = JSON.parse(res);
|
|
|
35 |
var planId;
|
|
|
36 |
operatorId = data.operatorId;
|
|
|
37 |
circleCode = data.circleCode;
|
|
|
38 |
var dropdownlistbox = document.getElementById("mobile-operator");
|
| 18237 |
manish.sha |
39 |
document.getElementById("mobile-operator").disabled = false;
|
| 10582 |
lgm |
40 |
for(var x=0;x < dropdownlistbox.length -1 ; x++)
|
|
|
41 |
{
|
|
|
42 |
if(data.operatorName == dropdownlistbox.options[x].text)
|
|
|
43 |
{
|
|
|
44 |
dropdownlistbox.selectedIndex = x;
|
|
|
45 |
var opids ='';
|
|
|
46 |
for(var i=0;i<plan.length;i++){
|
|
|
47 |
if(plan[i].operatorId == operatorId){
|
|
|
48 |
var planId = plan[i].operatorId;
|
|
|
49 |
opids += '<option value='+plan[i].Name+'>'+plan[i].displayName+'</option>';
|
|
|
50 |
}
|
|
|
51 |
}
|
|
|
52 |
if(planId == operatorId){
|
|
|
53 |
document.getElementById('plans').style.display = 'block';
|
|
|
54 |
}else{
|
|
|
55 |
document.getElementById('plans').style.display = 'none';
|
|
|
56 |
}
|
| 13006 |
anikendra |
57 |
document.getElementById('operator-palns').innerHTML = opids;
|
| 10582 |
lgm |
58 |
if(special.indexOf(operatorId) != -1){
|
|
|
59 |
document.getElementById('operatorName').innerHTML = data.operatorName;
|
|
|
60 |
document.getElementById('special').style.display = 'block';
|
|
|
61 |
}
|
|
|
62 |
else{
|
|
|
63 |
document.getElementById('special').style.display = 'none';
|
|
|
64 |
}
|
|
|
65 |
break;
|
|
|
66 |
}
|
|
|
67 |
}
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
});
|
| 11546 |
lgm |
71 |
}else if(number.length < 10){
|
|
|
72 |
if(document.getElementById("mobile-operator").disabled != true){
|
|
|
73 |
document.getElementById("mobile-operator").disabled = true;
|
|
|
74 |
}
|
| 11722 |
lgm |
75 |
var isOperaMini = (navigator.userAgent.indexOf('Opera Mini') > -1);
|
| 11715 |
lgm |
76 |
if(isOperaMini){
|
|
|
77 |
if(number ==''){
|
|
|
78 |
document.getElementById('error').style.display = "block";
|
|
|
79 |
document.getElementById('error').innerHTML ='Please fill Your Mobile Number!';
|
|
|
80 |
window.scrollTo(0,0); return false;
|
|
|
81 |
}
|
|
|
82 |
if(!/^\d+$/.test(number)){
|
|
|
83 |
document.getElementById('error').style.display = "block";
|
|
|
84 |
document.getElementById('error').innerHTML ='Please Use numbers only for Mobile Number!';
|
|
|
85 |
window.scrollTo(0,0); return false;
|
|
|
86 |
}
|
|
|
87 |
if(number.length != 10){
|
|
|
88 |
document.getElementById('error').style.display = "block";
|
|
|
89 |
document.getElementById('error').innerHTML ='Mobile Number should be of 10 digits';
|
|
|
90 |
window.scrollTo(0,0); return false;
|
|
|
91 |
}
|
|
|
92 |
}
|
| 10582 |
lgm |
93 |
}
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
function changeOperator(e){
|
| 11325 |
lgm |
97 |
|
| 10582 |
lgm |
98 |
var Id = e.currentTarget.value;
|
|
|
99 |
var opids ='';
|
|
|
100 |
for(var i=0;i<plan.length;i++){
|
|
|
101 |
if(plan[i].operatorId == Id){
|
|
|
102 |
var planId = plan[i].operatorId;
|
|
|
103 |
opids += '<option value='+plan[i].Name+'>'+plan[i].displayName+'</option>';
|
|
|
104 |
}
|
|
|
105 |
}
|
|
|
106 |
if(planId == Id){
|
|
|
107 |
document.getElementById('plans').style.display = 'block';
|
|
|
108 |
}else{
|
|
|
109 |
document.getElementById('plans').style.display = 'none';
|
|
|
110 |
}
|
|
|
111 |
document.getElementById('operator-palns').innerHTML = opids;
|
|
|
112 |
if(special.indexOf(parseInt(Id)) != -1){
|
|
|
113 |
var dropdownlistbox = document.getElementById("mobile-operator");
|
|
|
114 |
var index = e.currentTarget.selectedIndex;
|
|
|
115 |
document.getElementById('operatorName').innerHTML = dropdownlistbox.options[index].text;;
|
|
|
116 |
document.getElementById('special').style.display = 'block';
|
|
|
117 |
}
|
|
|
118 |
else{
|
|
|
119 |
document.getElementById('special').style.display = 'none';
|
|
|
120 |
}
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
function topup(e){
|
| 11325 |
lgm |
124 |
|
| 10582 |
lgm |
125 |
var Id = e.currentTarget.id;
|
|
|
126 |
var url = base_url+'recharge/topupSpecial/'+Id+'/'+operatorId+'/'+circleCode;
|
|
|
127 |
microAjax(url, function (res) {
|
| 11325 |
lgm |
128 |
|
| 10582 |
lgm |
129 |
if(res != '')
|
|
|
130 |
{
|
|
|
131 |
document.getElementsByClassName('rech-cont')[0].style.display = 'none';
|
|
|
132 |
document.getElementsByClassName('topup-cont')[0].style.display = 'block';
|
|
|
133 |
var appenddata = document.getElementById('appendlist');
|
| 11574 |
lgm |
134 |
//appenddata.innerHTML= appenddata.innerHTML + res;
|
|
|
135 |
appenddata.innerHTML = res;
|
| 10582 |
lgm |
136 |
}
|
|
|
137 |
});
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
function closePlan(){
|
| 11325 |
lgm |
141 |
//
|
| 10582 |
lgm |
142 |
document.getElementsByClassName('rech-cont')[0].style.display = 'block';
|
|
|
143 |
document.getElementsByClassName('topup-cont')[0].style.display = 'none';
|
|
|
144 |
}
|
|
|
145 |
function fillAmount(e){
|
| 11325 |
lgm |
146 |
//
|
| 10582 |
lgm |
147 |
var amount = e.currentTarget.innerHTML;
|
|
|
148 |
document.getElementById('mobile-amount').value = amount;
|
|
|
149 |
document.getElementsByClassName('rech-cont')[0].style.display = 'block';
|
|
|
150 |
document.getElementsByClassName('topup-cont')[0].style.display = 'none';
|
|
|
151 |
}
|
|
|
152 |
function changeName(e){
|
| 11325 |
lgm |
153 |
|
| 10582 |
lgm |
154 |
var id = e.currentTarget.value;
|
| 10806 |
lgm |
155 |
if(id != -1){
|
|
|
156 |
var name = dthIdMap[id];
|
|
|
157 |
document.getElementById('accountName').innerHTML = name;
|
|
|
158 |
}else if(id == -1){
|
|
|
159 |
document.getElementById('accountName').innerHTML = 'Account Number :';
|
|
|
160 |
}
|
| 10582 |
lgm |
161 |
}
|
|
|
162 |
function mobileValidation(){
|
| 11325 |
lgm |
163 |
|
| 10582 |
lgm |
164 |
var operator = document.getElementById('mobile-operator');
|
|
|
165 |
var number = document.getElementById('mobile-number').value;
|
|
|
166 |
var amount = document.getElementById('mobile-amount').value;
|
|
|
167 |
var email = document.getElementById("emailId").value;
|
|
|
168 |
document.getElementById('operator_hidden').value = operator[operator.selectedIndex].text;
|
|
|
169 |
email = email.trim();
|
|
|
170 |
var atpos = email.indexOf("@");
|
|
|
171 |
var dotpos = email.lastIndexOf(".");
|
| 11721 |
lgm |
172 |
number = number.trim();
|
| 10582 |
lgm |
173 |
if(number ==''){
|
|
|
174 |
document.getElementById('error').style.display = "block";
|
|
|
175 |
document.getElementById('error').innerHTML ='Please fill Your Mobile Number!';
|
|
|
176 |
window.scrollTo(0,0); return false;
|
|
|
177 |
}
|
| 10778 |
lgm |
178 |
if(!/^\d+$/.test(number)){
|
| 10582 |
lgm |
179 |
document.getElementById('error').style.display = "block";
|
|
|
180 |
document.getElementById('error').innerHTML ='Please Use numbers only for Mobile Number!';
|
|
|
181 |
window.scrollTo(0,0); return false;
|
|
|
182 |
}
|
|
|
183 |
if(number.length != 10){
|
|
|
184 |
document.getElementById('error').style.display = "block";
|
|
|
185 |
document.getElementById('error').innerHTML ='Mobile Number should be of 10 digits';
|
|
|
186 |
window.scrollTo(0,0); return false;
|
|
|
187 |
}
|
|
|
188 |
if(operator.selectedIndex == 0){
|
|
|
189 |
document.getElementById('error').style.display = "block";
|
|
|
190 |
document.getElementById('error').innerHTML ='Please select your operator!';
|
|
|
191 |
window.scrollTo(0,0); return false;
|
|
|
192 |
}
|
|
|
193 |
if(amount ==''){
|
|
|
194 |
document.getElementById('error').style.display = "block";
|
|
|
195 |
document.getElementById('error').innerHTML ='Please fill recharge amount!';
|
|
|
196 |
window.scrollTo(0,0); return false;
|
|
|
197 |
}
|
| 10748 |
lgm |
198 |
if(!/^\d+$/.test(amount)){
|
| 10582 |
lgm |
199 |
document.getElementById('error').style.display = "block";
|
|
|
200 |
document.getElementById('error').innerHTML ='Please Use numbers only!';
|
|
|
201 |
window.scrollTo(0,0); return false;
|
|
|
202 |
}
|
|
|
203 |
if((parseInt(amount) < 10) || (parseInt(amount) > 1000)){
|
|
|
204 |
document.getElementById('error').style.display = "block";
|
|
|
205 |
document.getElementById('error').innerHTML ='Recharge amount should be between Rs. 10-1000';
|
|
|
206 |
window.scrollTo(0,0); return false;
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
if(email ==''){
|
|
|
210 |
document.getElementById('error').style.display = "block";
|
|
|
211 |
document.getElementById('error').innerHTML ='Please fill email field!';
|
|
|
212 |
window.scrollTo(0,0); return false;}
|
|
|
213 |
if((atpos<1) || (dotpos < atpos+2) || (dotpos+2 >= email.length)){
|
|
|
214 |
document.getElementById('error').style.display = "block";
|
|
|
215 |
document.getElementById('error').innerHTML ='Please fill email in correct format!';
|
|
|
216 |
window.scrollTo(0,0); return false;
|
|
|
217 |
}
|
|
|
218 |
if(email.length> 50){
|
|
|
219 |
document.getElementById('error').style.display = "block";
|
|
|
220 |
document.getElementById('error').innerHTML ='Please enter less than 50 characters in email field!';
|
|
|
221 |
window.scrollTo(0,0); return false;
|
|
|
222 |
}
|
|
|
223 |
if(email.indexOf(' ') != -1){
|
|
|
224 |
document.getElementById('error').style.display = "block";
|
|
|
225 |
document.getElementById('error').innerHTML ='Please remove space from email field!';
|
|
|
226 |
window.scrollTo(0,0); return false;
|
|
|
227 |
}
|
| 10748 |
lgm |
228 |
if(email != email.trim()){
|
|
|
229 |
document.getElementById('error').style.display = "block";
|
|
|
230 |
document.getElementById('error').innerHTML ='Please remove space from email field!';
|
|
|
231 |
window.scrollTo(0,0); return false;
|
|
|
232 |
}
|
| 10582 |
lgm |
233 |
|
|
|
234 |
}
|
|
|
235 |
function dthValidation(){
|
| 11325 |
lgm |
236 |
|
| 10582 |
lgm |
237 |
var operator = document.getElementById('dth-operator');
|
|
|
238 |
var number = document.getElementById('dth-number').value;
|
|
|
239 |
var amount = document.getElementById('dth-amount').value;
|
|
|
240 |
var email = document.getElementById("dth-email").value;
|
| 10806 |
lgm |
241 |
var value = document.getElementById('accountName').innerHTML;
|
|
|
242 |
value = value.split(':')[0];
|
| 10582 |
lgm |
243 |
document.getElementById('dth_hidden').value = operator[operator.selectedIndex].text;
|
|
|
244 |
email = email.trim();
|
|
|
245 |
var atpos = email.indexOf("@");
|
|
|
246 |
var dotpos = email.lastIndexOf(".");
|
| 11721 |
lgm |
247 |
number = number.trim();
|
| 10582 |
lgm |
248 |
if(operator.selectedIndex == 0){
|
|
|
249 |
document.getElementById('error').style.display = "block";
|
|
|
250 |
document.getElementById('error').innerHTML ='Please select your operator!';
|
|
|
251 |
window.scrollTo(0,0); return false;
|
|
|
252 |
}
|
|
|
253 |
if(number ==''){
|
|
|
254 |
document.getElementById('error').style.display = "block";
|
| 10948 |
lgm |
255 |
document.getElementById('error').innerHTML ='Please enter the '+value+'!';
|
| 10582 |
lgm |
256 |
window.scrollTo(0,0); return false;
|
|
|
257 |
}
|
| 10748 |
lgm |
258 |
if(!/^\d+$/.test(number)){
|
|
|
259 |
document.getElementById('error').style.display = "block";
|
| 10806 |
lgm |
260 |
document.getElementById('error').innerHTML ='Please Use numbers only for '+value+' field!';
|
| 10748 |
lgm |
261 |
window.scrollTo(0,0); return false;
|
|
|
262 |
}
|
| 10582 |
lgm |
263 |
if(amount ==''){
|
|
|
264 |
document.getElementById('error').style.display = "block";
|
|
|
265 |
document.getElementById('error').innerHTML ='Please fill recharge amount!';
|
|
|
266 |
window.scrollTo(0,0); return false;
|
|
|
267 |
}
|
| 10748 |
lgm |
268 |
if(!/^\d+$/.test(amount)){
|
| 10582 |
lgm |
269 |
document.getElementById('error').style.display = "block";
|
|
|
270 |
document.getElementById('error').innerHTML ='Please Use numbers only!';
|
|
|
271 |
window.scrollTo(0,0); return false;
|
|
|
272 |
}
|
|
|
273 |
if((parseInt(amount) < 200) || (parseInt(amount) > 2000)){
|
|
|
274 |
document.getElementById('error').style.display = "block";
|
|
|
275 |
document.getElementById('error').innerHTML ='Recharge amount should be between Rs. 200-2000';
|
|
|
276 |
window.scrollTo(0,0); return false;
|
|
|
277 |
}
|
|
|
278 |
|
|
|
279 |
if(email ==''){
|
|
|
280 |
document.getElementById('error').style.display = "block";
|
|
|
281 |
document.getElementById('error').innerHTML ='Please fill email field!';
|
|
|
282 |
window.scrollTo(0,0); return false;}
|
|
|
283 |
if((atpos<1) || (dotpos < atpos+2) || (dotpos+2 >= email.length)){
|
|
|
284 |
document.getElementById('error').style.display = "block";
|
|
|
285 |
document.getElementById('error').innerHTML ='Please fill email in correct format!';
|
|
|
286 |
window.scrollTo(0,0); return false;
|
|
|
287 |
}
|
|
|
288 |
if(email.length> 50){
|
|
|
289 |
document.getElementById('error').style.display = "block";
|
|
|
290 |
document.getElementById('error').innerHTML ='Please enter less than 50 characters in email field!';
|
|
|
291 |
window.scrollTo(0,0); return false;
|
|
|
292 |
}
|
|
|
293 |
if(email.indexOf(' ') != -1){
|
|
|
294 |
document.getElementById('error').style.display = "block";
|
|
|
295 |
document.getElementById('error').innerHTML ='Please remove space from email field!';
|
|
|
296 |
window.scrollTo(0,0); return false;
|
|
|
297 |
}
|
|
|
298 |
|
|
|
299 |
}
|
|
|
300 |
|
|
|
301 |
function recahrgeAmount(){
|
| 11325 |
lgm |
302 |
|
| 10582 |
lgm |
303 |
var couponCode = document.getElementById('couponCode').value;
|
|
|
304 |
var recharge_Amount = document.getElementById('recharge_Amount').innerHTML;
|
|
|
305 |
var rechargeOperator = document.getElementById('rechargeOperator').innerHTML;
|
|
|
306 |
if(couponCode.length !=0){
|
|
|
307 |
var url = base_url+'recharge/rechargeAmount/'+recharge_Amount+'/'+couponCode;
|
|
|
308 |
microAjax(url, function (res) {
|
| 11325 |
lgm |
309 |
|
| 10582 |
lgm |
310 |
if(res != '')
|
|
|
311 |
{
|
|
|
312 |
var data = JSON.parse(res);
|
|
|
313 |
if(parseInt(data.couponAmount) == 0){
|
|
|
314 |
document.getElementById('error').style.display = "block";
|
|
|
315 |
document.getElementById('error').innerHTML ='Invalid Coupon Code!';
|
|
|
316 |
}
|
|
|
317 |
else{
|
|
|
318 |
if(data.payAmount == 0){
|
|
|
319 |
if(document.getElementById('captcha').style.display == 'none'){
|
|
|
320 |
changeCaptcha();
|
|
|
321 |
}
|
|
|
322 |
//document.getElementById('amount').value = parseInt(data.payAmount);
|
| 11330 |
lgm |
323 |
//document.getElementById('recharge_Amount').innerHTML = parseInt(data.payAmount);
|
| 11289 |
lgm |
324 |
document.getElementById('payAmount').innerHTML = parseInt(data.payAmount);
|
| 10582 |
lgm |
325 |
if(document.getElementById('walletAmount')){
|
| 11330 |
lgm |
326 |
if(parseInt(data.walletAmount) == 0){
|
|
|
327 |
document.getElementById('walletAmount').style.display = 'none';
|
|
|
328 |
document.getElementById('waText').style.display = 'none';
|
|
|
329 |
}else{
|
|
|
330 |
document.getElementById('walletAmount').innerHTML = parseInt(data.walletAmount);
|
|
|
331 |
}
|
| 10582 |
lgm |
332 |
}
|
|
|
333 |
if(document.getElementById('walletAmountLeft')){
|
| 11330 |
lgm |
334 |
if(parseInt(data.walletAmountLeft) == 0 || data.walletAmountLeft == undefined){
|
|
|
335 |
document.getElementById('walletAmountLeft').style.display = 'none';
|
|
|
336 |
document.getElementById('walText').style.display = 'none';
|
|
|
337 |
}else{
|
|
|
338 |
document.getElementById('walletAmountLeft').innerHTML = parseInt(data.walletAmountLeft);
|
|
|
339 |
}
|
|
|
340 |
}
|
| 10582 |
lgm |
341 |
document.getElementById('coupon_code').value = document.getElementById('couponCode').value;
|
| 11289 |
lgm |
342 |
document.getElementById('payAmount').value = parseInt(data.payAmount);
|
| 10582 |
lgm |
343 |
document.getElementById('coupon').style.display = "none";
|
|
|
344 |
document.getElementById('coupon_msg').innerHTML ='Coupon Code applied!';
|
|
|
345 |
document.getElementById('submit').value ='Recharge Now';
|
|
|
346 |
}else{
|
|
|
347 |
//document.getElementById('amount').value = parseInt(data.payAmount);
|
| 11330 |
lgm |
348 |
//document.getElementById('recharge_Amount').innerHTML = parseInt(data.payAmount);
|
| 10582 |
lgm |
349 |
document.getElementById('payAmount').innerHTML = parseInt(data.payAmount);
|
|
|
350 |
document.getElementById('coupon_code').value = document.getElementById('couponCode').value;
|
|
|
351 |
document.getElementById('payAmount').value = parseInt(data.payAmount);
|
|
|
352 |
document.getElementById('coupon').style.display = "none";
|
|
|
353 |
document.getElementById('coupon_msg').innerHTML ='Coupon Code applied!';
|
|
|
354 |
}
|
|
|
355 |
}
|
|
|
356 |
}
|
|
|
357 |
});
|
|
|
358 |
}
|
|
|
359 |
else{
|
|
|
360 |
document.getElementById('error').style.display = "block";
|
|
|
361 |
document.getElementById('error').innerHTML ='Please enter a Coupon Code!';
|
|
|
362 |
}
|
|
|
363 |
}
|
|
|
364 |
|
|
|
365 |
function clearError(){
|
|
|
366 |
if(document.getElementById('error').style.display == "block"){
|
|
|
367 |
document.getElementById('error').style.display = "none";
|
|
|
368 |
}
|
|
|
369 |
}
|
|
|
370 |
window.onload=function(){
|
|
|
371 |
var value = localStorage.getItem('rechargeValue');
|
|
|
372 |
if(parseInt(value) == 2){
|
|
|
373 |
if(document.getElementsByClassName('mobile-recharge')[0]){
|
|
|
374 |
document.getElementsByClassName('mobile-recharge')[0].style.display = 'none';
|
|
|
375 |
document.getElementsByClassName('dth-recharge')[0].style.display = 'block';
|
|
|
376 |
document.getElementsByClassName('mobile-re')[0].className = 'mobile-re';
|
|
|
377 |
document.getElementsByClassName('dth-re')[0].className += ' selected';
|
|
|
378 |
}
|
|
|
379 |
}
|
| 15837 |
amit.gupta |
380 |
if(document.getElementById('mobile-number').value.length==10){
|
|
|
381 |
document.getElementById('mobile-operator').disabled = false;
|
|
|
382 |
}
|
| 10582 |
lgm |
383 |
};
|
|
|
384 |
function changePayment(e){
|
| 11325 |
lgm |
385 |
|
| 10582 |
lgm |
386 |
var Id = e.currentTarget.id;
|
|
|
387 |
var defaultId = defaultPayment.id;
|
|
|
388 |
if(defaultId != Id){
|
| 11027 |
lgm |
389 |
var title = e.currentTarget.textContent.split('+')[0];
|
| 10582 |
lgm |
390 |
document.getElementById(defaultId).className = 'card';
|
|
|
391 |
defaultPayment.nextElementSibling.style.display = 'none';
|
|
|
392 |
defaultPayment.children[0].innerHTML = '+';
|
|
|
393 |
document.getElementById(Id).className += ' selected';
|
|
|
394 |
document.getElementById(Id).children[0].innerHTML = '-';
|
|
|
395 |
e.currentTarget.nextElementSibling.style.display = 'block';
|
|
|
396 |
//document.getElementById(Id).style.display = 'block';
|
|
|
397 |
defaultPayment = e.currentTarget;
|
| 12524 |
anikendra |
398 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
| 11027 |
lgm |
399 |
_gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab clicked',title]);
|
| 12524 |
anikendra |
400 |
}*/
|
|
|
401 |
ga('send', 'event', 'Payment Option', 'Payment option tab clicked', title);
|
| 10582 |
lgm |
402 |
}
|
|
|
403 |
}
|
|
|
404 |
var previousDebit;
|
|
|
405 |
function selectDebitCard(e){
|
| 11325 |
lgm |
406 |
|
| 10582 |
lgm |
407 |
var Id = e.currentTarget.id;
|
|
|
408 |
if(previousDebit == undefined){
|
|
|
409 |
document.getElementById(Id).className = 'selected';
|
|
|
410 |
}
|
|
|
411 |
else if(previousDebit != undefined){
|
|
|
412 |
document.getElementById(previousDebit).className = '';
|
|
|
413 |
document.getElementById(Id).className = 'selected';
|
|
|
414 |
}
|
|
|
415 |
document.getElementById('pay-debit').value = Id;
|
|
|
416 |
previousDebit = Id;
|
| 11027 |
lgm |
417 |
var title = e.currentTarget.getAttribute('data-parent');
|
|
|
418 |
title = title+'-'+Id;
|
| 12524 |
anikendra |
419 |
/*
|
| 11027 |
lgm |
420 |
if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
421 |
_gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
|
|
|
422 |
}
|
| 12524 |
anikendra |
423 |
*/
|
|
|
424 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
|
| 10582 |
lgm |
425 |
}
|
| 13350 |
anikendra |
426 |
function selectPayu(e){
|
|
|
427 |
|
|
|
428 |
var Id = e.currentTarget.id;
|
|
|
429 |
console.log(Id);
|
|
|
430 |
document.getElementById('pay-payu').value = Id;
|
|
|
431 |
var title = e.currentTarget.getAttribute('data-parent');
|
|
|
432 |
title = title+'-'+Id;
|
|
|
433 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
|
|
|
434 |
}
|
| 10582 |
lgm |
435 |
var previousCard;
|
|
|
436 |
function selectCard(e){
|
| 11325 |
lgm |
437 |
|
| 10582 |
lgm |
438 |
var Id = e.currentTarget.id;
|
|
|
439 |
if(previousCard == undefined){
|
|
|
440 |
document.getElementById(Id).className = 'selected';
|
|
|
441 |
}
|
|
|
442 |
else if(previousCard != undefined){
|
|
|
443 |
document.getElementById(previousCard).className = '';
|
|
|
444 |
document.getElementById(Id).className = 'selected';
|
|
|
445 |
}
|
|
|
446 |
document.getElementById('pay-credit').value = Id;
|
|
|
447 |
previousCard = Id;
|
| 11027 |
lgm |
448 |
var title = e.currentTarget.getAttribute('data-parent');
|
|
|
449 |
title = title+'-'+Id;
|
| 12524 |
anikendra |
450 |
/*
|
| 11027 |
lgm |
451 |
if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
452 |
_gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
|
|
|
453 |
}
|
| 12524 |
anikendra |
454 |
*/
|
|
|
455 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
|
| 10582 |
lgm |
456 |
}
|
| 11092 |
lgm |
457 |
var netBankingInfo;
|
| 11137 |
lgm |
458 |
var prevClass;
|
| 10582 |
lgm |
459 |
function changeNetBanking(e){
|
| 11325 |
lgm |
460 |
|
| 10678 |
lgm |
461 |
var Id;
|
| 11131 |
lgm |
462 |
var selected;
|
| 11137 |
lgm |
463 |
var hasClass;
|
| 10678 |
lgm |
464 |
Id = e.currentTarget.value;
|
|
|
465 |
if(Id == undefined){
|
| 11131 |
lgm |
466 |
selected = 1;
|
| 10678 |
lgm |
467 |
Id = e.currentTarget.id;
|
| 11137 |
lgm |
468 |
var dropDown = document.getElementById('net');
|
|
|
469 |
if(dropDown.selectedIndex != 0){
|
|
|
470 |
dropDown.selectedIndex = 0;
|
|
|
471 |
}
|
| 10678 |
lgm |
472 |
}
|
| 11092 |
lgm |
473 |
if(netBankingInfo == undefined){
|
| 11137 |
lgm |
474 |
if((selected == 1))
|
| 11131 |
lgm |
475 |
document.getElementById(Id).className = 'selected';
|
| 10678 |
lgm |
476 |
}
|
| 11092 |
lgm |
477 |
else if(netBankingInfo != undefined){
|
| 11137 |
lgm |
478 |
if((selected == 1)) {
|
| 11131 |
lgm |
479 |
document.getElementById(Id).className = 'selected';
|
| 11137 |
lgm |
480 |
if(prevClass == 'selected'){
|
|
|
481 |
document.getElementById(netBankingInfo).className = '';
|
|
|
482 |
}
|
|
|
483 |
}else{
|
|
|
484 |
if(prevClass == 'selected'){
|
|
|
485 |
document.getElementById(netBankingInfo).className = '';
|
|
|
486 |
}
|
| 11131 |
lgm |
487 |
}
|
| 10678 |
lgm |
488 |
}
|
| 10582 |
lgm |
489 |
document.getElementById('pay-net').value = Id;
|
| 11092 |
lgm |
490 |
netBankingInfo = Id;
|
| 11137 |
lgm |
491 |
prevClass = e.currentTarget.className;
|
| 10678 |
lgm |
492 |
var title = e.currentTarget.getAttribute('data-parent');
|
|
|
493 |
title = title+'-'+Id;
|
| 12524 |
anikendra |
494 |
/*
|
| 11027 |
lgm |
495 |
if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
496 |
_gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
|
|
|
497 |
}
|
| 12524 |
anikendra |
498 |
*/
|
|
|
499 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
|
| 10582 |
lgm |
500 |
}
|
|
|
501 |
function submitform(){
|
| 11319 |
lgm |
502 |
if(parseInt(document.getElementById('amountPayable').value) == 0 ){
|
| 15837 |
amit.gupta |
503 |
if(document.getElementById('captcha_response_box').value == ''){
|
|
|
504 |
// document.forms['recharge-confirm'].submit();
|
|
|
505 |
// }else{
|
|
|
506 |
var bRed = document.getElementById('captcha_response_box');
|
| 10582 |
lgm |
507 |
bRed.style.border = 'red solid 1px';
|
|
|
508 |
bRed.style.color = 'red';
|
| 15837 |
amit.gupta |
509 |
bRed.value = 'Please enter the captcha'
|
| 10582 |
lgm |
510 |
setTimeout(function(){
|
|
|
511 |
bRed.style.border = '';
|
|
|
512 |
bRed.style.color = '';
|
| 15837 |
amit.gupta |
513 |
bRed.value = '';
|
| 10582 |
lgm |
514 |
},3000);
|
|
|
515 |
return false;
|
|
|
516 |
}
|
|
|
517 |
}
|
|
|
518 |
var value = localStorage.getItem('rechargeValue');
|
|
|
519 |
if(parseInt(value) == 1){
|
| 12524 |
anikendra |
520 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
| 10953 |
lgm |
521 |
_gaq.push(['_trackEvent', 'Recharge', 'Confirm','Mobile']);
|
| 12524 |
anikendra |
522 |
}*/
|
|
|
523 |
ga('send', 'event', 'Recharge', 'Confirm', 'Mobile');
|
| 10582 |
lgm |
524 |
}else if(parseInt(value) == 2){
|
| 12524 |
anikendra |
525 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
526 |
_gaq.push(['_trackEvent', 'Recharge', 'Confirm','DTH']);
|
|
|
527 |
}*/
|
|
|
528 |
ga('send', 'event', 'Recharge', 'Confirm', 'DTH');
|
| 10582 |
lgm |
529 |
}
|
| 14841 |
anikendra |
530 |
var obj = document.getElementById('submit');
|
|
|
531 |
obj.style.display = 'none'
|
| 15837 |
amit.gupta |
532 |
var textnode = document.createTextNode("Submitting");
|
| 14841 |
anikendra |
533 |
var errordiv = document.getElementById('error1');
|
| 15837 |
amit.gupta |
534 |
errordiv.appendChild(textnode);
|
| 14841 |
anikendra |
535 |
errordiv.style.display = 'block';
|
| 10582 |
lgm |
536 |
}
|
|
|
537 |
function addressValidation(e){
|
| 11325 |
lgm |
538 |
|
| 10582 |
lgm |
539 |
var Id = e.currentTarget.id;
|
|
|
540 |
if(Id == 'creditcard'){
|
|
|
541 |
if(previousCard == undefined){
|
|
|
542 |
document.getElementById('error').style.display = "block";
|
|
|
543 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
|
|
544 |
window.scrollTo(0,0); return false;
|
|
|
545 |
}
|
|
|
546 |
}else if(Id == 'debitcard'){
|
|
|
547 |
if(previousDebit == undefined){
|
|
|
548 |
document.getElementById('error').style.display = "block";
|
|
|
549 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
|
|
550 |
window.scrollTo(0,0); return false;
|
|
|
551 |
}
|
|
|
552 |
}else if(Id == 'netbanking'){
|
|
|
553 |
var payOption = document.getElementById('pay-net').value;
|
|
|
554 |
if(payOption == undefined || payOption ==""){
|
|
|
555 |
document.getElementById('error').style.display = "block";
|
|
|
556 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
|
|
557 |
window.scrollTo(0,0); return false;
|
|
|
558 |
}
|
|
|
559 |
}
|
|
|
560 |
if(document.getElementById('ccAddress')){
|
|
|
561 |
var error = Id+'error';
|
|
|
562 |
var fname = document.getElementById(Id).name.value;
|
|
|
563 |
var street1 = document.getElementById(Id).line1.value;
|
|
|
564 |
var street2 = document.getElementById(Id).line2.value;
|
|
|
565 |
var city = document.getElementById(Id).city.value;
|
|
|
566 |
var state = document.getElementById(Id).state.value;
|
|
|
567 |
var zipcode = document.getElementById(Id).pincode.value;
|
|
|
568 |
var phone = document.getElementById(Id).phone.value;
|
| 10742 |
lgm |
569 |
if(fname =='')
|
| 10678 |
lgm |
570 |
{
|
|
|
571 |
document.getElementById('error').style.display = "block";
|
|
|
572 |
document.getElementById('error').innerHTML ='Please fill name field!';
|
|
|
573 |
window.scrollTo(0,0); return false;}
|
| 10742 |
lgm |
574 |
if(!removeScript(fname))
|
|
|
575 |
{
|
|
|
576 |
document.getElementById('error').style.display = "block";
|
|
|
577 |
document.getElementById('error').innerHTML ='Please remove script tags!';
|
|
|
578 |
window.scrollTo(0,0); return false;}
|
|
|
579 |
if(fname.length> 50)
|
|
|
580 |
{
|
|
|
581 |
document.getElementById('error').style.display = "block";
|
|
|
582 |
document.getElementById('error').innerHTML ='Please Enter Less Than 50 Characters in name field!';
|
|
|
583 |
window.scrollTo(0,0); return false;}
|
|
|
584 |
if(fname !== fname.trim())
|
|
|
585 |
{
|
|
|
586 |
document.getElementById('error').style.display = "block";
|
|
|
587 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from name field!';
|
|
|
588 |
window.scrollTo(0,0); return false;}
|
|
|
589 |
if(fname !== fname.replace(/\s+/g, ' '))
|
|
|
590 |
{
|
|
|
591 |
document.getElementById('error').style.display = "block";
|
|
|
592 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from name field!';
|
|
|
593 |
window.scrollTo(0,0); return false;}
|
|
|
594 |
if(street1 =='')
|
|
|
595 |
{
|
|
|
596 |
document.getElementById('error').style.display = "block";
|
|
|
597 |
document.getElementById('error').innerHTML ='Please fill address field!';
|
|
|
598 |
window.scrollTo(0,0); return false;}
|
|
|
599 |
if(street1 != street1.trim())
|
|
|
600 |
{
|
|
|
601 |
document.getElementById('error').style.display = "block";
|
|
|
602 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from address field!';
|
|
|
603 |
window.scrollTo(0,0); return false;}
|
|
|
604 |
if(street1 != street1.replace(/\s+/g, ' '))
|
|
|
605 |
{
|
|
|
606 |
document.getElementById('error').style.display = "block";
|
|
|
607 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from address field!';
|
|
|
608 |
window.scrollTo(0,0); return false;}
|
|
|
609 |
if(!removeScript(street1))
|
|
|
610 |
{
|
|
|
611 |
document.getElementById('error').style.display = "block";
|
|
|
612 |
document.getElementById('error').innerHTML ='Please remove script tags!';
|
|
|
613 |
window.scrollTo(0,0); return false;}
|
|
|
614 |
if(street2 != street2.trim())
|
|
|
615 |
{
|
|
|
616 |
document.getElementById('error').style.display = "block";
|
|
|
617 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from address field!';
|
|
|
618 |
window.scrollTo(0,0); return false;}
|
|
|
619 |
if(street2 != street2.replace(/\s+/g, ' '))
|
|
|
620 |
{
|
|
|
621 |
document.getElementById('error').style.display = "block";
|
|
|
622 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from address field!';
|
|
|
623 |
window.scrollTo(0,0); return false;}
|
|
|
624 |
if(!removeScript(street2))
|
|
|
625 |
{
|
|
|
626 |
document.getElementById('error').style.display = "block";
|
|
|
627 |
document.getElementById('error').innerHTML ='Please remove script tags!';
|
|
|
628 |
window.scrollTo(0,0); return false;}
|
|
|
629 |
if(state == -1)
|
|
|
630 |
{
|
|
|
631 |
document.getElementById('error').style.display = "block";
|
|
|
632 |
document.getElementById('error').innerHTML ='Please fill state field!';
|
|
|
633 |
window.scrollTo(0,0); return false;}
|
|
|
634 |
if(!removeScript(state))
|
|
|
635 |
{
|
|
|
636 |
document.getElementById('error').style.display = "block";
|
|
|
637 |
document.getElementById('error').innerHTML ='Please remove script tags!';
|
|
|
638 |
window.scrollTo(0,0); return false;}
|
|
|
639 |
if(city =='')
|
|
|
640 |
{
|
|
|
641 |
document.getElementById('error').style.display = "block";
|
|
|
642 |
document.getElementById('error').innerHTML ='Please fill City field!';
|
|
|
643 |
window.scrollTo(0,0); return false;}
|
|
|
644 |
if(!removeScript(city))
|
|
|
645 |
{
|
|
|
646 |
document.getElementById('error').style.display = "block";
|
|
|
647 |
document.getElementById('error').innerHTML ='Please remove script tags!';
|
|
|
648 |
window.scrollTo(0,0); return false;}
|
|
|
649 |
if(city != city.trim())
|
|
|
650 |
{
|
|
|
651 |
document.getElementById('error').style.display = "block";
|
|
|
652 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from city!';
|
|
|
653 |
window.scrollTo(0,0); return false;}
|
|
|
654 |
if(city != city.replace(/\s+/g, ' '))
|
|
|
655 |
{
|
|
|
656 |
document.getElementById('error').style.display = "block";
|
|
|
657 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from city!';
|
|
|
658 |
window.scrollTo(0,0); return false;}
|
|
|
659 |
if(zipcode =='')
|
|
|
660 |
{
|
|
|
661 |
document.getElementById('error').style.display = "block";
|
|
|
662 |
document.getElementById('error').innerHTML ='Please fill pincode field!';
|
|
|
663 |
window.scrollTo(0,0); return false;}
|
|
|
664 |
if(zipcode.length !=6)
|
|
|
665 |
{
|
|
|
666 |
document.getElementById('error').style.display = "block";
|
|
|
667 |
document.getElementById('error').innerHTML ='Pincode should be 6 digits long';
|
|
|
668 |
window.scrollTo(0,0); return false;}
|
| 10779 |
lgm |
669 |
if(!/^\d+$/.test(zipcode))
|
| 10742 |
lgm |
670 |
{
|
|
|
671 |
document.getElementById('error').style.display = "block";
|
|
|
672 |
document.getElementById('error').innerHTML ='Please Use numbers only for pincode!';
|
|
|
673 |
window.scrollTo(0,0); return false;}
|
|
|
674 |
if(zipcode != zipcode.trim())
|
|
|
675 |
{
|
|
|
676 |
document.getElementById('error').style.display = "block";
|
|
|
677 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from pincode!';
|
|
|
678 |
window.scrollTo(0,0); return false;}
|
|
|
679 |
if(zipcode != zipcode.replace(/\s+/g, ' '))
|
|
|
680 |
{
|
|
|
681 |
document.getElementById('error').style.display = "block";
|
|
|
682 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from pincode!';
|
|
|
683 |
window.scrollTo(0,0); return false;}
|
|
|
684 |
if(phone =='')
|
|
|
685 |
{
|
|
|
686 |
document.getElementById('error').style.display = "block";
|
|
|
687 |
document.getElementById('error').innerHTML ='Please fill phone number field!';
|
|
|
688 |
window.scrollTo(0,0); return false;}
|
| 10778 |
lgm |
689 |
if(!/^\d+$/.test(phone)){
|
| 10779 |
lgm |
690 |
document.getElementById('error').style.display = "block";
|
| 10742 |
lgm |
691 |
document.getElementById('error').innerHTML ='Please Use numbers only for Mobile Number!';
|
|
|
692 |
window.scrollTo(0,0); return false;}
|
|
|
693 |
if(phone.length != 10)
|
|
|
694 |
{ document.getElementById('error').style.display = "block";
|
|
|
695 |
document.getElementById('error').innerHTML ='Mobile number should be of 10 digits!';
|
|
|
696 |
window.scrollTo(0,0); return false;}
|
|
|
697 |
if(phone != phone.trim())
|
|
|
698 |
{
|
|
|
699 |
document.getElementById('error').style.display = "block";
|
|
|
700 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from phone number!';
|
|
|
701 |
window.scrollTo(0,0); return false;}
|
|
|
702 |
if(phone != phone.replace(/\s+/g, ' '))
|
|
|
703 |
{
|
|
|
704 |
document.getElementById('error').style.display = "block";
|
|
|
705 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from phone number!';
|
|
|
706 |
window.scrollTo(0,0); return false;}
|
| 10678 |
lgm |
707 |
}
|
| 11725 |
lgm |
708 |
if(document.getElementById('ccPhone')){
|
|
|
709 |
var phone = document.getElementById(Id).phone.value;
|
|
|
710 |
phone = phone.trim();
|
|
|
711 |
if(phone =='')
|
|
|
712 |
{
|
|
|
713 |
document.getElementById('error').style.display = "block";
|
|
|
714 |
document.getElementById('error').innerHTML ='Please fill phone number field!';
|
|
|
715 |
window.scrollTo(0,0); return false;
|
|
|
716 |
}
|
|
|
717 |
if(!/^\d+$/.test(phone)){
|
|
|
718 |
document.getElementById('error').style.display = "block";
|
|
|
719 |
document.getElementById('error').innerHTML ='Please Use numbers only for Mobile Number!';
|
|
|
720 |
window.scrollTo(0,0); return false;
|
|
|
721 |
}
|
|
|
722 |
if(phone.length != 10){
|
|
|
723 |
document.getElementById('error').style.display = "block";
|
|
|
724 |
document.getElementById('error').innerHTML ='Mobile number should be of 10 digits!';
|
|
|
725 |
window.scrollTo(0,0); return false;
|
|
|
726 |
}
|
|
|
727 |
if(phone != phone.replace(/\s+/g, ' '))
|
|
|
728 |
{
|
|
|
729 |
document.getElementById('error').style.display = "block";
|
|
|
730 |
document.getElementById('error').innerHTML ='Please remove excess whitespaces from phone number!';
|
|
|
731 |
window.scrollTo(0,0); return false;
|
|
|
732 |
}
|
|
|
733 |
}
|
| 10582 |
lgm |
734 |
var value = localStorage.getItem('rechargeValue');
|
|
|
735 |
if(parseInt(value) == 1){
|
| 12524 |
anikendra |
736 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
737 |
_gaq.push(['_trackEvent', 'Recharge', 'Pay Now','Mobile']);
|
|
|
738 |
}*/
|
|
|
739 |
ga('send', 'event', 'Recharge', 'Pay Now', 'Mobile');
|
| 10582 |
lgm |
740 |
}else if(parseInt(value) == 2){
|
| 12524 |
anikendra |
741 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
742 |
_gaq.push(['_trackEvent', 'Recharge', 'Pay Now','DTH']);
|
|
|
743 |
}*/
|
|
|
744 |
ga('send', 'event', 'Recharge', 'Pay Now', 'DTH');
|
| 10582 |
lgm |
745 |
}
|
|
|
746 |
}
|
|
|
747 |
var url;
|
|
|
748 |
url = document.URL;
|
|
|
749 |
if(url.indexOf('recharge-result') != -1){
|
| 12085 |
lgm |
750 |
// if(orderConfirmation != undefined){
|
|
|
751 |
// var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
|
|
|
752 |
// var orderId = orderConfirmation['response'].rechargeDisplayId;
|
|
|
753 |
// var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
|
|
|
754 |
// _gaq.push(['_addTrans',
|
|
|
755 |
// orderId, // Transaction ID. Required.
|
|
|
756 |
// 'Saholic', // Affiliation or store name.
|
|
|
757 |
// amount, // Grand Total.
|
|
|
758 |
// '0', // Shipping.
|
|
|
759 |
// '0', // Tax.
|
|
|
760 |
// "",
|
|
|
761 |
// "",
|
|
|
762 |
// "India"
|
|
|
763 |
// ]);
|
|
|
764 |
// _gaq.push(['_addItem',
|
|
|
765 |
// orderId, // Transaction ID. Required.
|
|
|
766 |
// deviceNumber, // SKU/code.
|
|
|
767 |
// orderConfirmation['response'].rechargeProvider, // Product name. Required.
|
|
|
768 |
// 'Digital', // Category or variation.
|
|
|
769 |
// amount, // Unit price.
|
|
|
770 |
// '1' // Quantity.
|
|
|
771 |
// ]);
|
|
|
772 |
// _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
|
|
|
773 |
// }
|
| 11885 |
anikendra |
774 |
}
|
| 17573 |
manish.sha |
775 |
|
|
|
776 |
|
|
|
777 |
function showMoreDeals(){
|
|
|
778 |
window.location.href = base_url+"private-deals/1";
|
|
|
779 |
}
|
|
|
780 |
|
|
|
781 |
function quickAddToCart(id,catalogId){
|
|
|
782 |
var email = document.getElementById("email").value;
|
|
|
783 |
email = email.trim();
|
|
|
784 |
var url = base_url+'cart/add/'+id+'/'+email+'/'+catalogId;
|
|
|
785 |
microAjax(url, function(res)
|
|
|
786 |
{
|
|
|
787 |
if(res!='')
|
|
|
788 |
{
|
|
|
789 |
|
|
|
790 |
data = JSON.parse(res);
|
|
|
791 |
if(data['addcart'][0].redirectUrl != undefined && data['addcart'][0].redirectUrl != ''){
|
|
|
792 |
//window.history.replaceState("",document.title, base_url+'cart');
|
|
|
793 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
|
|
794 |
_gaq.push(['_trackEvent', 'Order', 'Add To Cart',itemId]);
|
|
|
795 |
}*/
|
|
|
796 |
ga('send', 'event', 'Order', 'Add To Cart',id);
|
|
|
797 |
var ua = navigator.userAgent.toLowerCase();
|
|
|
798 |
var redirectUrl = data['addcart'][0].redirectUrl;
|
|
|
799 |
var isIE = ua.indexOf('msie') !== -1;
|
|
|
800 |
if (isIE){
|
|
|
801 |
window.location.replace(base_url+redirectUrl);
|
|
|
802 |
}else{
|
|
|
803 |
window.location.href = base_url+redirectUrl;
|
|
|
804 |
}
|
|
|
805 |
}else if(data['addcart'][0].message != undefined){
|
|
|
806 |
window.location.href=base_url+document.getElementById(id+"-url").value;
|
|
|
807 |
}
|
|
|
808 |
}
|
|
|
809 |
});
|
|
|
810 |
}
|