| Line 1... |
Line 1... |
| 1 |
function sigin()
|
1 |
<?php $payments = json_decode($payment_process[0]);
|
| 2 |
{
|
2 |
$results = $payments->results;
|
| 3 |
return false;
|
3 |
$emi = $emi[0];
|
| 4 |
var pass1 = document.getElementById("txtPassword").value;
|
4 |
$bankInfo = array();
|
| 5 |
var email = document.getElementById("txtEmail").value;
|
5 |
$i=0;
|
| 6 |
var server = document.getElementById('servererror');
|
6 |
foreach($emi->emiSchemes as $bank){
|
| 7 |
var atpos = email.indexOf("@");
|
7 |
if(empty($bankInfo) || !in_array($bank->bankId,$bankInfo)){
|
| 8 |
var dotpos = email.lastIndexOf(".");
|
8 |
$bankInfo[$i]['Id'] = $bank->bankId;
|
| 9 |
if(email =='')
|
9 |
$bankInfo[$i]['Name'] = $bank->bankName;
|
| 10 |
{
|
10 |
$i++;
|
| 11 |
if(server)
|
11 |
}
|
| 12 |
document.getElementById('servererror').style.display = "none";
|
12 |
}
|
| 13 |
document.getElementById('error').style.display = "block";
|
13 |
$tmp = array ();
|
| 14 |
document.getElementById('errorcode').innerHTML ='Please fill Email field!';
|
14 |
foreach ($bankInfo as $row)
|
| 15 |
window.scrollTo(0,0); return false;}
|
15 |
if (!in_array($row,$tmp))
|
| 16 |
if((atpos<1) || (dotpos < atpos+2) || (dotpos+2 >= email.length)){
|
16 |
array_push($tmp,$row);
|
| 17 |
if(server)
|
17 |
$bankInfo = $tmp;
|
| 18 |
document.getElementById('servererror').style.display = "none";
|
18 |
$emiInfo = array();
|
| 19 |
document.getElementById('error').style.display = "block";
|
19 |
$i=0;
|
| 20 |
document.getElementById('errorcode').innerHTML ='Please fill Email in correct format!';
|
20 |
foreach($bankInfo as $bankId){
|
| 21 |
window.scrollTo(0,0); return false;
|
21 |
$j=0;
|
| 22 |
}
|
22 |
foreach($emi->emiSchemes as $bank){
|
| 23 |
if(email.length> 50)
|
23 |
if($bankId['Id'] == $bank->bankId){
|
| 24 |
{
|
24 |
$amount = str_replace(',', '', $payments->results->totalAmount);
|
| 25 |
if(server)
|
25 |
$amount = number_format((float)$amount,0,'.','');
|
| 26 |
document.getElementById('servererror').style.display = "none";
|
26 |
$rate = $bank->interestRate/(12*100);
|
| 27 |
document.getElementById('error').style.display = "block";
|
27 |
$term = $bank->tenure;
|
| 28 |
document.getElementById('errorcode').innerHTML ='Please Enter Less than 50 characters in Email field!';
|
28 |
$installment = $amount * $rate * (pow(1 + $rate, $term) / (pow(1 + $rate, $term) - 1));
|
| 29 |
window.scrollTo(0,0); return false;}
|
29 |
$installment = round($installment*100/100);
|
| 30 |
if(pass1 =='')
|
30 |
$installment = number_format((float)$installment,2,'.','');
|
| 31 |
{ if(server)
|
31 |
$totalAmount = ceil($installment*$term);
|
| 32 |
document.getElementById('servererror').style.display = "none";
|
32 |
$bank->installment = number_format((float)$installment, 2,'.','');
|
| 33 |
document.getElementById('error').style.display = "block";
|
33 |
$bank->total = $totalAmount;
|
| 34 |
document.getElementById('errorcode').innerHTML ='Please fill Password field!';
|
34 |
$intrestAmount = $totalAmount-$amount;
|
| 35 |
window.scrollTo(0,0); return false;}
|
35 |
$bank->intrestAmount = $intrestAmount;
|
| 36 |
if(!pass1.match(/^[A-Za-z0-9 ]{1,50}$/))
|
36 |
$emiInfo[$i][$j] = $bank;
|
| 37 |
{ if(server)
|
37 |
$j++;
|
| 38 |
document.getElementById('servererror').style.display = "none";
|
38 |
}
|
| 39 |
document.getElementById('error').style.display = "block";
|
39 |
}
|
| 40 |
document.getElementById('errorcode').innerHTML ='Please fill Alphabets and Numbers Only In Password field!';
|
40 |
$i++;
|
| 41 |
window.scrollTo(0,0); return false;}
|
41 |
}
|
| 42 |
if(pass1.length>50){
|
42 |
//print_r($payments);
|
| 43 |
if(server)
|
43 |
?>
|
| 44 |
document.getElementById('servererror').style.display = "none";
|
44 |
|
| 45 |
document.getElementById('error').style.display = "block";
|
45 |
<div class="payment-cont">
|
| 46 |
document.getElementById('errorcode').innerHTML ='Password Must be less than 50 characters!';
|
46 |
<div class="shipping-head clearfix">
|
| 47 |
window.scrollTo(0,0); return false;
|
47 |
<div class="shipping">Shipping</div>
|
| 48 |
}
|
48 |
<div class="payment selected">Payment</div>
|
| 49 |
}
|
49 |
</div>
|
| 50 |
|
50 |
<div class="payment-hldr">
|
| 51 |
function shippingform(){
|
51 |
<div class="gd-total clearfix">
|
| 52 |
debugger;
|
52 |
<div>Grand total</div>
|
| 53 |
var fname = document.getElementById("name").value;
|
53 |
<div>RS <?php echo $payments->results->totalAmount;?> </div>
|
| 54 |
var street1 = document.getElementById("line1").value;
|
54 |
</div><!--gd-total-->
|
| 55 |
var street2 = document.getElementById("line2").value;
|
55 |
<div class="hldr-sub">
|
| 56 |
var city = document.getElementById("city").value;
|
56 |
<div class="card">Select Payment Method</div>
|
| 57 |
// var state = document.getElementById("state");
|
57 |
<div id="error" class="error_msg" style="display:<?php if(isset($codCaptcha) && $codCaptcha == 1 ){echo 'block';} else { echo 'none'; }?>"><?php if(isset($codCaptcha) && $codCaptcha ==1){echo 'Invalid Captcha';}?></div>
|
| 58 |
// state = state.options[state.selectedIndex].text;
|
58 |
<?php if(($amount != 0) && !isset($payments->results->isTotalAmountZero)) {
|
| 59 |
var zipcode = document.getElementById("pin").value;
|
59 |
foreach($payments->options as $payment){
|
| 60 |
var phone = document.getElementById("phone").value;
|
60 |
if($payment->label == 'CREDIT CARDS'){
|
| 61 |
if(fname =='')
|
61 |
$defaultPayment = $payment->type;?>
|
| 62 |
{
|
62 |
<div id="<?php echo $payment->type;?>"class="card <?php if(!isset($codCaptcha) && $codCaptcha !=1 ){echo 'selected';}?>" onclick="changePayment(event);"><?php echo $payment->label;?> <span>-</span></div>
|
| 63 |
document.getElementById('error').style.display = "block";
|
63 |
<div style="display:<?php if(isset($codCaptcha) && $codCaptcha ==1 ){echo 'none';} else { echo 'block'; }?>" class="credit-cards clearfix">
|
| 64 |
document.getElementById('error').innerHTML ='Please fill name field!';
|
64 |
<div class="c-info">You will be taken to our Bank's payment gateway for making this payment.</div>
|
| 65 |
window.scrollTo(0,0); return false;}
|
65 |
<form id="creditcard" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)">
|
| 66 |
// if(!fname.match(/^[a-zA-Z]+$/))
|
66 |
<fieldset>
|
| 67 |
// {
|
67 |
<div class="cc-hldr clearfix">
|
| 68 |
// document.getElementById('error').style.display = "block";
|
68 |
<div id="india" class="selected" onclick="changeCountry(event)">Credit Cards </br>Issued in India</div>
|
| 69 |
// document.getElementById('errorcode').innerHTML ='Please fill Alphabets Only In First Name!';
|
69 |
<div id="outside" onclick="changeCountry(event)">Credit Cards </br>Issued outside India</div>
|
| 70 |
// window.scrollTo(0,0); return false;}
|
70 |
</div>
|
| 71 |
if(fname.length> 50)
|
71 |
<?php foreach($payment->options as $methods){
|
| 72 |
{
|
72 |
if($methods->label == 'Credit Cards issued in India'){?>
|
| 73 |
document.getElementById('error').style.display = "block";
|
73 |
<div class="in-india clearfix c-box" style="display:block">
|
| 74 |
document.getElementById('error').innerHTML ='Please Enter Less Than 50 Characters in name field!';
|
74 |
<?php foreach($methods->paymethods as $payment){?>
|
| 75 |
window.scrollTo(0,0); return false;}
|
75 |
<div onclick="selectCard(event)" id="<?php echo $payment->pay_option?>" data-parent="<?php echo $payment->label; ?>">
|
| 76 |
if(street1 =='')
|
76 |
<img src="<?php echo $this->config->item('curl_base_url').$payment->img?>;" alt="<?php echo $payment->label;?>">
|
| 77 |
{
|
77 |
</div>
|
| 78 |
document.getElementById('error').style.display = "block";
|
78 |
<?php } ?>
|
| 79 |
document.getElementById('error').innerHTML ='Please fill address field!';
|
79 |
<p >Tap to select your card type</p>
|
| 80 |
window.scrollTo(0,0); return false;}
|
80 |
</div><!--in-india-->
|
| 81 |
if(city =='')
|
81 |
<?php } elseif($methods->label == 'Credit Cards issued outside India'){ ?>
|
| 82 |
{
|
82 |
<div class="out-india clearfix c-box" style="display:none;">
|
| 83 |
document.getElementById('error').style.display = "block";
|
83 |
<?php foreach($methods->paymethods as $payment){?>
|
| 84 |
document.getElementById('error').innerHTML ='Please fill City field!';
|
84 |
<div onclick="selectCard(event)" id="<?php echo $payment->pay_option?>" data-parent="<?php echo $payment->label; ?>">
|
| 85 |
window.scrollTo(0,0); return false;}
|
85 |
<img src="<?php echo $this->config->item('curl_base_url').$payment->img?>;" alt="<?php echo $payment->label;?>">
|
| 86 |
// if(state =='')
|
86 |
</div>
|
| 87 |
// {
|
87 |
<?php } ?>
|
| 88 |
// document.getElementById('error').style.display = "block";
|
88 |
<p >Tap to select your card type</p>
|
| 89 |
// document.getElementById('error').innerHTML ='Please fill state field!';
|
89 |
</div><!--out-india -->
|
| 90 |
// window.scrollTo(0,0); return false;}
|
90 |
<?php } } ?>
|
| 91 |
if(zipcode =='')
|
91 |
<input type="hidden" name="payoption" id="pay-credit" value=""/>
|
| 92 |
{
|
92 |
<input id='ccSubmit' type="submit" name="submit" value='Make Payment' class="payment-btn tcenter"/>
|
| 93 |
document.getElementById('error').style.display = "block";
|
93 |
</fieldset>
|
| 94 |
document.getElementById('error').innerHTML ='Please fill pincode field!';
|
94 |
</form>
|
| 95 |
window.scrollTo(0,0); return false;}
|
95 |
</div><!--credit-cards-->
|
| 96 |
if(zipcode.length !=6)
|
96 |
<?php } ?>
|
| 97 |
{
|
97 |
<?php if($payment->label == 'DEBIT/ATM CARDS'){?>
|
| 98 |
document.getElementById('error').style.display = "block";
|
98 |
<div id="<?php echo $payment->type;?>" class="card" onclick="changePayment(event);"><?php echo $payment->label;?><span>+</span></div>
|
| 99 |
document.getElementById('error').innerHTML ='Pincode should be 6 digits long';
|
99 |
<div class="c-box" style="display:none;">
|
| 100 |
window.scrollTo(0,0); return false;}
|
100 |
<p class="c-info">You will be taken to our Bank's payment gateway for making this payment.</p>
|
| 101 |
if(!zipcode.match(/^\d+/))
|
101 |
<form id="debitcard" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)"><fieldset>
|
| 102 |
{
|
102 |
<input type="hidden" name="payoption" id="pay-debit" value="" />
|
| 103 |
document.getElementById('error').style.display = "block";
|
103 |
<?php foreach($payment->paymethods as $methods){?>
|
| 104 |
document.getElementById('error').innerHTML ='Please Use numbers only for pincode!';
|
104 |
<div id="<?php echo $methods->pay_option;?>" onclick="selectDebitCard(event)" data-parent="<?php echo $payment->label; ?>"><img src="<?php echo $this->config->item('curl_base_url').$methods->img?>;" alt="<?php echo $methods->label;?>"></div>
|
| 105 |
window.scrollTo(0,0); return false;}
|
105 |
<?php } ?>
|
| 106 |
if(phone =='')
|
106 |
<p class="tcenter">Tap to select your card type</p>
|
| 107 |
{
|
107 |
<input id='debitSubmit' type="submit" name="submit" value='Make Payment' class="payment-btn tcenter"/>
|
| 108 |
document.getElementById('error').style.display = "block";
|
108 |
</fieldset></form>
|
| 109 |
document.getElementById('error').innerHTML ='Please fill phone number field!';
|
109 |
</div><!--c-box-->
|
| 110 |
window.scrollTo(0,0); return false;}
|
110 |
<?php }?>
|
| 111 |
if(!phone.match(/^\d+/))
|
111 |
<?php if($payment->label == 'NET BANKING'){ ?>
|
| 112 |
{ document.getElementById('error').style.display = "block";
|
112 |
<div id="<?php echo $payment->type;?>" class="card" onclick="changePayment(event);"><?php echo $payment->label;?><span>+</span></div>
|
| 113 |
document.getElementById('error').innerHTML ='Please Use numbers only for Mobile Number!';
|
113 |
<div class="info-hldr" style="display:none">
|
| 114 |
window.scrollTo(0,0); return false;}
|
114 |
<div class="c-info">You will be taken to our Bank's payment gateway for making this payment.</div>
|
| 115 |
if(phone.length != 10)
|
115 |
<p>Please select your bank</p>
|
| 116 |
{ document.getElementById('error').style.display = "block";
|
116 |
<form id="netbanking" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)"><fieldset>
|
| 117 |
document.getElementById('error').innerHTML ='Mobile number should be of 10 digits!';
|
117 |
<input type="hidden" name="payoption" id="pay-net" value="<?php echo $payment->paymethods[0]->pay_option;?>" />
|
| 118 |
window.scrollTo(0,0); return false;}
|
118 |
<select id="net" onchange="changeNetBanking(event);" data-parent="<?php echo $payment->label; ?>">
|
| 119 |
|
119 |
<?php foreach($payment->paymethods as $methods){?>
|
| 120 |
}
|
120 |
<option value="<?php echo $methods->pay_option;?>" ><?php echo $methods->label;?></option>
|
| 121 |
function showForm(){
|
121 |
<?php } ?>
|
| 122 |
document.getElementsByClassName("address-form")[0].style.display = 'block';
|
122 |
</select>
|
| 123 |
document.getElementsByClassName("delivery-cont")[0].style.display = 'none';
|
123 |
<input id='netSubmit' type="submit" name="submit" value='Make Payment' class="payment-btn tcenter"/>
|
| 124 |
}
|
124 |
</fieldset></form>
|
| 125 |
|
125 |
</div><!--c-box-->
|
| 126 |
function deleteAddress(addressId){
|
126 |
<?php } ?>
|
| 127 |
debugger;
|
127 |
<?php if($payment->label == 'CASH CARDS'){ ?>
|
| 128 |
var url = base_url+'checkout/delete/'+addressId;
|
128 |
<div id="<?php echo $payment->type;?>" class="card" onclick="changePayment(event);"><?php echo $payment->label;?><span>+</span></div>
|
| 129 |
microAjax(url, function (res) {
|
129 |
<div class="c-box" style="display:none">
|
| 130 |
debugger;
|
130 |
<p class="c-info">You will be taken to our Bank's payment gateway for making this payment.</p>
|
| 131 |
if(res != ''){
|
131 |
<form id="cashcards" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)"><fieldset>
|
| 132 |
document.getElementById(addressId).style.display = 'none';
|
132 |
<input type="hidden" name="payoption" id="pay-cc" value="" />
|
| 133 |
}
|
133 |
<?php foreach($payment->paymethods as $methods){?>
|
| 134 |
});
|
134 |
<div id="<?php echo $methods->pay_option;?>" onclick="selectCashCard(event)" data-parent="<?php echo $payment->label; ?>"><img src="<?php echo $this->config->item('curl_base_url').$methods->img?>;" alt="<?php echo $methods->label;?>"></div>
|
| 135 |
}
|
135 |
<?php } ?>
|
| 136 |
|
136 |
<p class="tcenter">Tap to select your card type</p>
|
| 137 |
function changeAddress(addressId,type){
|
137 |
<input type="button" value='Make Payment' class="payment-btn tcenter"/>
|
| 138 |
debugger;
|
138 |
</fieldset></form>
|
| 139 |
if(defaultAddress != addressId){
|
139 |
</div><!--c-box-->
|
| 140 |
var url = base_url+'checkout/changeAddress/'+addressId+'/'+type;
|
140 |
<?php } ?>
|
| 141 |
microAjax(url, function (res) {
|
141 |
<?php if($payment->label == 'CASH ON DELIVERY'){ ?>
|
| 142 |
debugger;
|
142 |
<div id="<?php echo $payment->type;?>" class="card <?php if(isset($codCaptcha) && $codCaptcha ==1 ){echo 'selected';}?>" onclick="changePayment(event);"><?php echo $payment->label;?><span>+</span></div>
|
| 143 |
if(res == ''){
|
143 |
<div style="display:<?php if(isset($codCaptcha) && $codCaptcha ==1 ){echo 'block';} else { echo 'none'; }?>" class="info-hldr">
|
| 144 |
document.getElementById(defaultAddress).className = 'deliver-address';
|
144 |
<!-- <p class="c-info">You will be taken to our Bank's payment gateway for making this payment.</p> -->
|
| 145 |
document.getElementById(addressId).className += ' selected-add';
|
145 |
<div id="captcha" class="tcenter"><?php print_r($captcha['image']);?></div>
|
| 146 |
defaultAddress = addressId;
|
146 |
<div id="clickCaptcha" class="tcenter" onclick="changeCaptcha()">Click here to change image</div>
|
| 147 |
}
|
147 |
<form id="cod" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)">
|
| 148 |
else{
|
148 |
<fieldset>
|
| 149 |
return false;
|
149 |
<input type="hidden" name="payoption" id="pay-cod" value="<?php echo $payment->pay_option; ?>"/>
|
| 150 |
}
|
150 |
<input id="captcha_response_box" type="text" name="captcha_response_field" autocomplete="off">
|
| 151 |
});
|
151 |
<input type="submit" name="submit" value='Make Payment' class="payment-btn tcenter"/>
|
| 152 |
}
|
152 |
</fieldset>
|
| 153 |
}
|
153 |
</form>
|
| 154 |
|
154 |
</div>
|
| 155 |
function changePayment(e){
|
155 |
<?php } ?>
|
| 156 |
debugger;
|
156 |
<?php if($payment->label == 'EMI'){ ?>
|
| 157 |
var Id = e.currentTarget.id;
|
157 |
<div id="<?php echo $payment->type;?>" data-key="<?php echo $payment->label;?>" class="card" onclick="changePayment(event);"><?php echo $payment->label;?><span>+</span></div>
|
| 158 |
var defaultId = defaultPayment.id;
|
158 |
<?php if(isset($emiInfo) && !empty($emiInfo)){ ?>
|
| 159 |
if(defaultId != Id){
|
159 |
<div class="info-hldr" style="display:none">
|
| 160 |
var title = e.currentTarget.textContent.split('+')[0];
|
160 |
<p class="c-info">You will be taken to our Bank's payment gateway for making this payment.</p>
|
| 161 |
document.getElementById(defaultId).className = 'card';
|
161 |
<form id="emiform" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)">
|
| 162 |
defaultPayment.nextElementSibling.style.display = 'none';
|
162 |
<fieldset>
|
| 163 |
defaultPayment.children[0].innerHTML = '+';
|
163 |
<p>Please select your bank</p>
|
| 164 |
document.getElementById(Id).className += ' selected';
|
164 |
<?php if(isset($bankInfo) && !empty($bankInfo)){?>
|
| 165 |
document.getElementById(Id).children[0].innerHTML = '-';
|
165 |
<select id="emibank" onchange="changeBank(event);">
|
| 166 |
e.currentTarget.nextElementSibling.style.display = 'block';
|
166 |
<?php
|
| 167 |
//document.getElementById(Id).style.display = 'block';
|
167 |
foreach ($bankInfo as $key => $value) { ?>
|
| 168 |
defaultPayment = e.currentTarget;
|
168 |
<option value="<?php echo $value['Id'];?>"><?php echo $value['Name']; ?></option>
|
| 169 |
ga('send', 'event', 'Payment Option', 'Payment option tab clicked',title);
|
169 |
<?php } ?>
|
| 170 |
}
|
170 |
</select>
|
| 171 |
}
|
171 |
<?php } ?>
|
| 172 |
if(typeof bankInfo != 'undefined'){
|
172 |
|
| 173 |
var defaultBank = bankInfo.Id;
|
173 |
<div class="emi-hldr clearfix">
|
| 174 |
}
|
174 |
<?php $i=0;?>
|
| 175 |
function changeBank(e){
|
175 |
<div class="emi-head clearfix">
|
| 176 |
debugger;
|
176 |
<div>Tenure@rate</div>
|
| 177 |
var Id = e.currentTarget.value;
|
177 |
<div>Total Intrest</div>
|
| 178 |
var payOption = document.getElementById(Id).children[0].id;
|
178 |
<div>Monthly Installement</div>
|
| 179 |
document.getElementById(defaultBank).style.display = 'none';
|
179 |
</div><!--emi-head-->
|
| 180 |
document.getElementById(Id).style.display = 'block';
|
180 |
<input type="hidden" name="payoption" id="pay-emi" value="<?php echo $emiInfo[0][0]->id;?>"/>
|
| 181 |
document.getElementById('pay-emi').value = payOption;
|
181 |
<?php foreach($emiInfo as $emi){?>
|
| 182 |
defaultBank = Id;
|
182 |
<div style="display:<?php if($i == 0){echo 'block';} else {echo 'none';}?>" id="<?php echo $emi[0]->bankId;?>">
|
| 183 |
var id = e.currentTarget.id;
|
183 |
<?php $j=0;foreach($emi as $emiScheme){?>
|
| 184 |
var a = document.getElementById(id);
|
184 |
<div class="emi-body clearfix <?php if($j==0) echo 'selected';?>" id="<?php echo $emiScheme->id;?>" onclick="changePay(event);" data-bank="<?php echo $emiScheme->bankName;?>" data-tenure="<?php echo $emiScheme->tenureDescription;?>">
|
| 185 |
var bankName = a.options[a.selectedIndex].text;
|
185 |
<div><?php echo $emiScheme->tenureDescription.'@'.$emiScheme->interestRate.'%';?></div>
|
| 186 |
ga('send', 'event', 'EMI', 'Bank Selection',bankName);
|
186 |
<div>Rs <?php echo $emiScheme->intrestAmount;?></div>
|
| 187 |
}
|
187 |
<div>Rs <?php echo $emiScheme->installment;?></div>
|
| 188 |
function changePay(e){
|
188 |
</div>
|
| 189 |
debugger;
|
189 |
<?php $j++;}
|
| 190 |
var Id = e.currentTarget.id;
|
190 |
$i++; ?>
|
| 191 |
var payOption = document.getElementById('pay-emi').value;
|
191 |
</div>
|
| 192 |
document.getElementById(payOption).className = 'emi-body clearfix';
|
192 |
<?php }?>
|
| 193 |
document.getElementById(Id).className += ' selected';
|
193 |
</div>
|
| 194 |
document.getElementById('pay-emi').value = Id;
|
194 |
<input id='emiSubmit' type="submit" name="submit" value='Make Payment' class="payment-btn tcenter"/>
|
| 195 |
var bankName = e.currentTarget.getAttribute('data-bank');
|
195 |
</fieldset>
|
| 196 |
var tenure = e.currentTarget.getAttribute('data-tenure');
|
196 |
</form>
|
| 197 |
bankName = bankName+'-'+tenure;
|
197 |
</div><!--info-hldr-->
|
| 198 |
ga('send', 'event', 'EMI', 'Plan Selection',bankName);
|
198 |
<?php }}?>
|
| 199 |
}
|
199 |
<?php } }elseif($amount ==0 && isset($payments->results->isTotalAmountZero) && $payments->results->isTotalAmountZero==1) {
|
| 200 |
function changeNetBanking(e){
|
200 |
foreach($payments->options as $payment){
|
| 201 |
debugger;
|
201 |
if($payment->label == 'CONFIRM ORDER'){ ?>
|
| 202 |
var Id = e.currentTarget.value;
|
202 |
<div id="<?php echo $payment->type;?>" class="card"><?php echo $payment->label;?><span>+</span></div>
|
| 203 |
var payOption = document.getElementById('pay-net').value;
|
203 |
<div style="" class="info-hldr">
|
| 204 |
document.getElementById('pay-net').value = Id;
|
204 |
<!-- <p class="c-info">You will be taken to our Bank's payment gateway for making this payment.</p> -->
|
| 205 |
var title = e.currentTarget.getAttribute('data-parent');
|
205 |
<div id="captcha" class="tcenter"><?php print_r($captcha['image']);?></div>
|
| 206 |
title = title+'-'+Id;
|
206 |
<div id="clickCaptcha" class="tcenter" onclick="changeCaptcha()">Click here to change image</div>
|
| 207 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payotion selected',title);
|
207 |
<form id="zod" method="post" data-key="<?php echo $payment->label;?>" action="<?php echo base_url().'payment';?>" onsubmit="return paymentValidation(event)">
|
| 208 |
}
|
208 |
<fieldset>
|
| 209 |
function changeCountry(e){
|
209 |
<input id="captcha_response_box" type="text" name="captcha_response_field" autocomplete="off" placeholder="Please Enter Captcha">
|
| 210 |
debugger;
|
210 |
<input type="hidden" name="payoption" id="pay-captcha" value="<?php echo $payment->pay_option; ?>"/>
|
| 211 |
var Id = e.currentTarget.id;
|
211 |
<input type="submit" name="submit" value='Confirm Order' class="payment-btn tcenter"/>
|
| 212 |
if(Id == 'india'){
|
212 |
</fieldset>
|
| 213 |
document.getElementById('india').className = 'selected';
|
213 |
</form>
|
| 214 |
document.getElementById('outside').className = '';
|
214 |
</div>
|
| 215 |
document.getElementsByClassName('in-india')[0].style.display = 'block';
|
215 |
</div>
|
| 216 |
document.getElementsByClassName('out-india')[0].style.display = 'none';
|
216 |
<?php break;}
|
| 217 |
}
|
217 |
}
|
| 218 |
if(Id == 'outside'){
|
218 |
}?>
|
| 219 |
document.getElementById('outside').className = 'selected';
|
219 |
</div><!--hldr-sub-->
|
| 220 |
document.getElementById('india').className = '';
|
- |
|
| 221 |
document.getElementsByClassName('out-india')[0].style.display = 'block';
|
- |
|
| 222 |
document.getElementsByClassName('in-india')[0].style.display = 'none';
|
- |
|
| 223 |
}
|
- |
|
| 224 |
}
|
- |
|
| 225 |
var previousCard;
|
- |
|
| 226 |
function selectCard(e){
|
- |
|
| 227 |
debugger;
|
- |
|
| 228 |
var Id = e.currentTarget.id;
|
- |
|
| 229 |
if(previousCard == undefined){
|
- |
|
| 230 |
document.getElementById(Id).className = 'selected';
|
- |
|
| 231 |
}
|
- |
|
| 232 |
else if(previousCard != undefined){
|
- |
|
| 233 |
document.getElementById(previousCard).className = '';
|
- |
|
| 234 |
document.getElementById(Id).className = 'selected';
|
- |
|
| 235 |
}
|
- |
|
| 236 |
document.getElementById('pay-credit').value = Id;
|
- |
|
| 237 |
previousCard = Id;
|
- |
|
| 238 |
var title = e.currentTarget.getAttribute('data-parent');
|
- |
|
| 239 |
title = title+'-'+Id;
|
- |
|
| 240 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payotion selected',title);
|
- |
|
| 241 |
}
|
- |
|
| 242 |
var previousDebit;
|
- |
|
| 243 |
function selectDebitCard(e){
|
- |
|
| 244 |
debugger;
|
- |
|
| 245 |
var Id = e.currentTarget.id;
|
- |
|
| 246 |
if(previousDebit == undefined){
|
- |
|
| 247 |
document.getElementById(Id).className = 'selected';
|
- |
|
| 248 |
}
|
- |
|
| 249 |
else if(previousDebit != undefined){
|
- |
|
| 250 |
document.getElementById(previousDebit).className = '';
|
- |
|
| 251 |
document.getElementById(Id).className = 'selected';
|
- |
|
| 252 |
}
|
- |
|
| 253 |
document.getElementById('pay-debit').value = Id;
|
- |
|
| 254 |
previousDebit = Id;
|
- |
|
| 255 |
var title = e.currentTarget.getAttribute('data-parent');
|
- |
|
| 256 |
title = title+'-'+Id;
|
- |
|
| 257 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected',title);
|
- |
|
| 258 |
}
|
- |
|
| 259 |
var previousCC;
|
- |
|
| 260 |
function selectCashCard(e){
|
- |
|
| 261 |
debugger;
|
- |
|
| 262 |
var Id = e.currentTarget.id;
|
- |
|
| 263 |
if(previousCC == undefined){
|
- |
|
| 264 |
document.getElementById(Id).className = 'selected';
|
- |
|
| 265 |
}
|
- |
|
| 266 |
else if(previousCC != undefined){
|
- |
|
| 267 |
document.getElementById(previousCC).className = '';
|
- |
|
| 268 |
document.getElementById(Id).className = 'selected';
|
- |
|
| 269 |
}
|
- |
|
| 270 |
document.getElementById('pay-cc').value = Id;
|
- |
|
| 271 |
previousCC = Id;
|
- |
|
| 272 |
var title = e.currentTarget.getAttribute('data-parent');
|
- |
|
| 273 |
title = title+'-'+Id;
|
- |
|
| 274 |
ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected',title);
|
- |
|
| 275 |
}
|
- |
|
| 276 |
// function changeCaptcha(){
|
- |
|
| 277 |
// var url = base_url+'checkout/changeCaptcha';
|
- |
|
| 278 |
// microAjax(url, function (res) {
|
- |
|
| 279 |
// debugger;
|
- |
|
| 280 |
// if(res != ''){
|
- |
|
| 281 |
// debugger;
|
- |
|
| 282 |
// data = JSON.parse(res);
|
- |
|
| 283 |
// document.getElementById('captcha').innerHTML = data.image;
|
- |
|
| 284 |
// }
|
- |
|
| 285 |
// else{
|
- |
|
| 286 |
// return false;
|
- |
|
| 287 |
// }
|
- |
|
| 288 |
// });
|
- |
|
| 289 |
// }
|
- |
|
| 290 |
function infoPage(){
|
- |
|
| 291 |
document.getElementsByClassName("address-form")[0].style.display = 'none';
|
- |
|
| 292 |
document.getElementsByClassName("delivery-cont")[0].style.display = 'block';
|
- |
|
| 293 |
}
|
- |
|
| 294 |
|
- |
|
| 295 |
function togglepicup(e){
|
- |
|
| 296 |
debugger;
|
- |
|
| 297 |
if(e.currentTarget.className == 'pick-up'){
|
- |
|
| 298 |
e.currentTarget.className += ' selected';
|
- |
|
| 299 |
document.getElementsByClassName("deliverhere")[0].setAttribute('class','deliverhere');
|
- |
|
| 300 |
document.getElementsByClassName("pickup")[0].style.display = 'block';
|
- |
|
| 301 |
document.getElementsByClassName("deliver-here")[0].style.display = 'none';
|
- |
|
| 302 |
}else{
|
- |
|
| 303 |
e.currentTarget.className += ' selected';
|
- |
|
| 304 |
document.getElementsByClassName("pick-up")[0].setAttribute('class','pick-up');
|
- |
|
| 305 |
document.getElementsByClassName("deliver-here")[0].style.display = 'block';
|
- |
|
| 306 |
document.getElementsByClassName("pickup")[0].style.display = 'none';
|
- |
|
| 307 |
|
220 |
|
| 308 |
}
|
- |
|
| 309 |
}
|
- |
|
| 310 |
var prevZone;
|
- |
|
| 311 |
function changeZone(e){
|
- |
|
| 312 |
debugger;
|
- |
|
| 313 |
var value = e.currentTarget.value;
|
- |
|
| 314 |
var currentStore = storeInfo[value];
|
- |
|
| 315 |
var storeAddress = '';
|
- |
|
| 316 |
if(prevZone == undefined || prevZone != value){
|
- |
|
| 317 |
for(i=0;i<currentStore.length;i++){
|
- |
|
| 318 |
storeAddress +='<div class="pickup-spot" id="'+currentStore[i].id+'" data-key="'+currentStore[i].hotspotId+'" onclick=selectStore(event)><div>'+currentStore[i].name+'</div><div>'+currentStore[i].line1+'</div><div>'+currentStore[i].line2+'</div><div>'+currentStore[i].city+'</div><div>'+currentStore[i].state+'</div><div>Pin: '+currentStore[i].pin+'</div><div>Phone: '+currentStore[i].phone+'</div></div>';
|
221 |
</div><!--payment-cont-->
|
| 319 |
}
|
- |
|
| 320 |
document.getElementById('appendData').innerHTML = storeAddress;
|
- |
|
| 321 |
prevZone = value;
|
- |
|
| 322 |
ga('send', 'event', 'InStore Pickup Region', 'Store Zone',value);
|
- |
|
| 323 |
}
|
- |
|
| 324 |
}
|
- |
|
| 325 |
var shopId;
|
- |
|
| 326 |
var inStoreDelivery;
|
- |
|
| 327 |
function selectStore(e){
|
- |
|
| 328 |
debugger;
|
- |
|
| 329 |
var id = e.currentTarget.id;
|
- |
|
| 330 |
var hotspotId = e.currentTarget;
|
- |
|
| 331 |
if(shopId == undefined){
|
- |
|
| 332 |
document.getElementById(id).className += ' selected-add';
|
- |
|
| 333 |
shopId = id;
|
- |
|
| 334 |
}else if(shopId != id){
|
- |
|
| 335 |
document.getElementById(shopId).className += 'pickup-spot';
|
- |
|
| 336 |
document.getElementById(id).className += ' selected-add';
|
- |
|
| 337 |
shopId = id;
|
- |
|
| 338 |
inStoreDelivery = true;
|
- |
|
| 339 |
}
|
- |
|
| 340 |
var url = base_url+'checkout/pickupSpot/'+id;
|
- |
|
| 341 |
microAjax(url,function(res){
|
- |
|
| 342 |
debugger;
|
- |
|
| 343 |
if(res != ''){
|
- |
|
| 344 |
}else{
|
- |
|
| 345 |
window.location.href = document.URL;
|
- |
|
| 346 |
}
|
- |
|
| 347 |
});
|
- |
|
| 348 |
document.getElementById('hotSpot').value = id;
|
- |
|
| 349 |
}
|
- |
|
| 350 |
if(insuranceInfo != undefined){
|
- |
|
| 351 |
var insuranceInfo = insuranceInfo;
|
- |
|
| 352 |
}
|
- |
|
| 353 |
function validateInsurance(type){
|
- |
|
| 354 |
debugger;
|
- |
|
| 355 |
var type = type;
|
- |
|
| 356 |
if(document.getElementById('ccAddress') && insuranceInfo == 1){
|
- |
|
| 357 |
var bday = document.getElementById('bday').value;
|
- |
|
| 358 |
var gname = document.getElementById('gName').value;
|
- |
|
| 359 |
if(gname == '')
|
- |
|
| 360 |
{
|
- |
|
| 361 |
document.getElementById('error1').style.display = "block";
|
- |
|
| 362 |
document.getElementById('error1').innerHTML ='Please fill name field!';
|
- |
|
| 363 |
return false;}
|
- |
|
| 364 |
if(gname.length> 50)
|
- |
|
| 365 |
{
|
- |
|
| 366 |
document.getElementById('error1').style.display = "block";
|
- |
|
| 367 |
document.getElementById('error1').innerHTML ='Please Enter Less Than 50 Characters in name field!';
|
- |
|
| 368 |
return false;}
|
- |
|
| 369 |
// if(bday =='')
|
- |
|
| 370 |
// {
|
- |
|
| 371 |
// document.getElementById('error1').style.display = "block";
|
- |
|
| 372 |
// document.getElementById('error1').innerHTML ='Please fill birthday field!';
|
- |
|
| 373 |
// return false;}
|
- |
|
| 374 |
var validformat=/^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format validity
|
- |
|
| 375 |
var returnval=false
|
- |
|
| 376 |
if (!validformat.test(bday)){
|
- |
|
| 377 |
document.getElementById('error1').style.display = "block";
|
- |
|
| 378 |
document.getElementById('error1').innerHTML ='Please Enter valid date';
|
- |
|
| 379 |
return false;
|
- |
|
| 380 |
}else if(validformat.test(bday)){ //Detailed check for valid date ranges
|
- |
|
| 381 |
var monthfield=bday.split("/")[0]
|
- |
|
| 382 |
var dayfield=bday.split("/")[1]
|
- |
|
| 383 |
var yearfield=bday.split("/")[2]
|
222 |
<script type="text/javascript">
|
| 384 |
var dayobj = new Date(yearfield, monthfield-1, dayfield)
|
- |
|
| 385 |
if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield)){
|
- |
|
| 386 |
document.getElementById('error1').style.display = "block";
|
- |
|
| 387 |
document.getElementById('error1').innerHTML ='Invalid Day, Month, or Year range detected. Please correct and submit again.';
|
- |
|
| 388 |
return false;
|
- |
|
| 389 |
}
|
- |
|
| 390 |
}
|
- |
|
| 391 |
if(type == 1){
|
- |
|
| 392 |
var bday = bday.replace(/\//g, '-');
|
- |
|
| 393 |
gname = gname.replace(/\ /g,'-');
|
- |
|
| 394 |
var url = base_url+'checkout/insuranceInfo/'+bday+'/'+gname+'/'+insuranceAddressId;
|
- |
|
| 395 |
microAjax(url,function(res){
|
- |
|
| 396 |
debugger;
|
223 |
debugger;
|
| 397 |
if(res != ''){
|
- |
|
| 398 |
debugger;
|
- |
|
| 399 |
var data = JSON.parse(res);
|
- |
|
| 400 |
if(data['response'].status == 'SUCCESS'){
|
- |
|
| 401 |
if(document.getElementById('ccAddress').style.display == ''){
|
- |
|
| 402 |
document.getElementById('ccAddress').style.display = 'none';
|
- |
|
| 403 |
}
|
- |
|
| 404 |
}
|
- |
|
| 405 |
else{
|
- |
|
| 406 |
document.getElementById('error1').style.display = "block";
|
- |
|
| 407 |
document.getElementById('error1').innerHTML ='Request could not be completed.Please try again!';
|
- |
|
| 408 |
}
|
- |
|
| 409 |
}
|
- |
|
| 410 |
});
|
- |
|
| 411 |
}
|
- |
|
| 412 |
if(type == 2){
|
- |
|
| 413 |
if(inStoreDelivery == true){
|
- |
|
| 414 |
ga('send','event','Delivery Type','In-Store Pickup');
|
- |
|
| 415 |
}else{
|
- |
|
| 416 |
ga('send','event','Delivery Type','Deliver to address');
|
- |
|
| 417 |
}
|
- |
|
| 418 |
ga('send','event','Order','Proceed To Pay');
|
- |
|
| 419 |
window.location.href = base_url+'payment';
|
- |
|
| 420 |
}
|
- |
|
| 421 |
}else{
|
- |
|
| 422 |
if(inStoreDelivery == true){
|
- |
|
| 423 |
ga('send','event','Delivery Type','In-Store Pickup');
|
- |
|
| 424 |
}else{
|
- |
|
| 425 |
ga('send','event','Delivery Type','Deliver to address');
|
- |
|
| 426 |
}
|
- |
|
| 427 |
ga('send','event','Order','Proceed To Pay');
|
- |
|
| 428 |
window.location.href = base_url+'payment';
|
- |
|
| 429 |
}
|
- |
|
| 430 |
}
|
- |
|
| 431 |
function paymentValidation(e){
|
- |
|
| 432 |
debugger;
|
- |
|
| 433 |
var Id = e.currentTarget.id;
|
- |
|
| 434 |
if(Id == 'creditcard'){
|
- |
|
| 435 |
if(previousCard == undefined){
|
- |
|
| 436 |
document.getElementById('error').style.display = "block";
|
- |
|
| 437 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
- |
|
| 438 |
window.scrollTo(0,0); return false;
|
- |
|
| 439 |
}
|
- |
|
| 440 |
var paymentTitle = e.currentTarget.getAttribute('data-key');
|
- |
|
| 441 |
ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
|
- |
|
| 442 |
|
- |
|
| 443 |
}else if(Id == 'debitcard'){
|
- |
|
| 444 |
if(previousDebit == undefined){
|
- |
|
| 445 |
document.getElementById('error').style.display = "block";
|
- |
|
| 446 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
- |
|
| 447 |
window.scrollTo(0,0); return false;
|
- |
|
| 448 |
}
|
- |
|
| 449 |
var paymentTitle = e.currentTarget.getAttribute('data-key');
|
- |
|
| 450 |
ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
|
- |
|
| 451 |
}else if(Id == 'netbanking'){
|
- |
|
| 452 |
var payOption = document.getElementById('pay-net').value;
|
- |
|
| 453 |
if(payOption == undefined || payOption ==""){
|
- |
|
| 454 |
document.getElementById('error').style.display = "block";
|
- |
|
| 455 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
- |
|
| 456 |
window.scrollTo(0,0); return false;
|
- |
|
| 457 |
}
|
- |
|
| 458 |
var paymentTitle = e.currentTarget.getAttribute('data-key');
|
- |
|
| 459 |
ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
|
- |
|
| 460 |
}else if(Id == 'cashcards'){
|
- |
|
| 461 |
if(previousCC == undefined){
|
- |
|
| 462 |
document.getElementById('error').style.display = "block";
|
- |
|
| 463 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
- |
|
| 464 |
window.scrollTo(0,0); return false;
|
- |
|
| 465 |
}
|
- |
|
| 466 |
var paymentTitle = e.currentTarget.getAttribute('data-key');
|
- |
|
| 467 |
ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
|
- |
|
| 468 |
}else if(Id == 'emiform'){
|
- |
|
| 469 |
var payOption = document.getElementById('pay-emi').value;
|
- |
|
| 470 |
if(payOption == undefined || payOption ==""){
|
- |
|
| 471 |
document.getElementById('error').style.display = "block";
|
- |
|
| 472 |
document.getElementById('error').innerHTML ='Please select payment method!';
|
- |
|
| 473 |
window.scrollTo(0,0); return false;
|
- |
|
| 474 |
}
|
- |
|
| 475 |
var paymentTitle = e.currentTarget.getAttribute('data-key');
|
- |
|
| 476 |
ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
|
- |
|
| 477 |
}else if(Id == 'cod'){
|
- |
|
| 478 |
if(document.getElementById('captcha_response_box').value == ''){
|
- |
|
| 479 |
// document.forms['recharge-confirm'].submit();
|
- |
|
| 480 |
// }else{
|
- |
|
| 481 |
var bRed = document.getElementById('captcha_response_box');
|
- |
|
| 482 |
bRed.style.border = 'red solid 1px';
|
- |
|
| 483 |
bRed.style.color = 'red';
|
- |
|
| 484 |
bRed.value = 'Please enter the captcha'
|
- |
|
| 485 |
setTimeout(function(){
|
- |
|
| 486 |
bRed.style.border = '';
|
- |
|
| 487 |
bRed.style.color = '';
|
- |
|
| 488 |
bRed.value = '';
|
- |
|
| 489 |
},3000);
|
- |
|
| 490 |
return false;
|
- |
|
| 491 |
}
|
- |
|
| 492 |
var paymentTitle = e.currentTarget.getAttribute('data-key');
|
- |
|
| 493 |
ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
|
- |
|
| 494 |
}
|
- |
|
| 495 |
}
|
- |
|
| 496 |
|
224 |
<?php if(isset($defaultPayment) && !empty($defaultPayment)){?>
|
| - |
|
225 |
var defaultPayment = <?php echo $defaultPayment;?>;
|
| - |
|
226 |
<?php } ?>
|
| - |
|
227 |
var bankInfo = <?php echo json_encode($bankInfo[0]);?>;
|
| - |
|
228 |
</script>
|
| - |
|
229 |
|
| 497 |
|
230 |
|