| Line 78... |
Line 78... |
| 78 |
$user_name = "";
|
78 |
$user_name = "";
|
| 79 |
$user_contact = "";
|
79 |
$user_contact = "";
|
| 80 |
|
80 |
|
| 81 |
$codAvailable = $cartskus['cod'];
|
81 |
$codAvailable = $cartskus['cod'];
|
| 82 |
$this->Session->write('cod', $codAvailable);
|
82 |
$this->Session->write('cod', $codAvailable);
|
| - |
|
83 |
$creditTicketSize = 0;
|
| 83 |
|
84 |
|
| 84 |
$creditorAssociated = $response ['creditorAssociated'];
|
85 |
$creditorAssociated = $response ['creditorAssociated'];
|
| 85 |
if(empty($response ['userSanctions'])){
|
86 |
if(empty($response ['userSanctions'])){
|
| 86 |
$creditLimit = 0;
|
87 |
$creditLimit = 0;
|
| 87 |
}else{
|
88 |
}else{
|
| 88 |
$creditLimit = 0;
|
89 |
$creditLimit = 0;
|
| - |
|
90 |
$creditTicketSize = intval($response ['userSanctions'][0]['ticket_size']);
|
| 89 |
foreach ( $response ['userSanctions'] as $key => $value ) {
|
91 |
foreach ( $response ['userSanctions'] as $key => $value ) {
|
| 90 |
$creditLimit = $creditLimit + intval($response ['credit_limit']) - (intval($response['credit_blocked'])+intval($response['loan']));
|
92 |
$creditLimit = $creditLimit + intval($value ['credit_limit']) - (intval($value['credit_blocked'])+intval($value['loan']));
|
| 91 |
}
|
93 |
}
|
| 92 |
}
|
94 |
}
|
| 93 |
$this->Session->write('creditorAssociated', $creditorAssociated);
|
95 |
$this->Session->write('creditorAssociated', $creditorAssociated);
|
| 94 |
$this->Session->write('creditLimit', $creditLimit);
|
96 |
$this->Session->write('creditLimit', $creditLimit);
|
| - |
|
97 |
$this->Session->write('creditTicketSize', $creditTicketSize);
|
| 95 |
$addressEditable = $response ['addressEditable'];
|
98 |
$addressEditable = $response ['addressEditable'];
|
| 96 |
$this->Session->write('addressEditable', $addressEditable);
|
99 |
$this->Session->write('addressEditable', $addressEditable);
|
| 97 |
|
100 |
|
| 98 |
if(empty($response ['addresses'])){
|
101 |
if(empty($response ['addresses'])){
|
| 99 |
$this->redirect ( array (
|
102 |
$this->redirect ( array (
|
| Line 158... |
Line 161... |
| 158 |
array_push ( $firstshowaddress, $moreshowaddress [$i] );
|
161 |
array_push ( $firstshowaddress, $moreshowaddress [$i] );
|
| 159 |
}
|
162 |
}
|
| 160 |
|
163 |
|
| 161 |
$this->set ( 'address', $response );
|
164 |
$this->set ( 'address', $response );
|
| 162 |
|
165 |
|
| 163 |
$this->set ( compact ( 'firstshowaddress', 'totalPayable', 'user_name', 'user_contact', 'pincode', 'defaultselectedaddress', 'message', 'codAvailable', 'addressEditable', 'creditorAssociated', 'creditLimit') );
|
166 |
$this->set ( compact ( 'firstshowaddress', 'totalPayable', 'user_name', 'user_contact', 'pincode', 'defaultselectedaddress', 'message', 'codAvailable', 'addressEditable', 'creditorAssociated', 'creditLimit', 'creditTicketSize') );
|
| 164 |
}
|
167 |
}
|
| 165 |
}
|
168 |
}
|
| 166 |
public function add($user_name = null, $user_contact = null) {
|
169 |
public function add($user_name = null, $user_contact = null) {
|
| 167 |
$this->layout = 'cartinnerpages';
|
170 |
$this->layout = 'cartinnerpages';
|
| 168 |
|
171 |
|
| 169 |
$totalPayable = $_SESSION ['totalPayable'];
|
172 |
$totalPayable = $_SESSION ['totalPayable'];
|
| 170 |
$codAvailable = $_SESSION ['cod'];
|
173 |
$codAvailable = $_SESSION ['cod'];
|
| 171 |
$creditLimit = $_SESSION ['creditLimit'];
|
174 |
$creditLimit = $_SESSION ['creditLimit'];
|
| 172 |
$creditorAssociated = $_SESSION ['creditorAssociated'];
|
175 |
$creditorAssociated = $_SESSION ['creditorAssociated'];
|
| - |
|
176 |
$creditTicketSize = $_SESSION ['creditTicketSize'];
|
| 173 |
//$pinval = base64_decode ( $_COOKIE ['s_pincode'] );
|
177 |
//$pinval = base64_decode ( $_COOKIE ['s_pincode'] );
|
| 174 |
$pinval='';
|
178 |
$pinval='';
|
| 175 |
$suserId = base64_decode ( $_COOKIE ['s_id'] );
|
179 |
$suserId = base64_decode ( $_COOKIE ['s_id'] );
|
| 176 |
$scart = base64_decode ( $_COOKIE ['s_cart'] );
|
180 |
$scart = base64_decode ( $_COOKIE ['s_cart'] );
|
| 177 |
|
181 |
|
| Line 240... |
Line 244... |
| 240 |
// debug($getstate);
|
244 |
// debug($getstate);
|
| 241 |
$getstateval = "";
|
245 |
$getstateval = "";
|
| 242 |
if ($getstate != "{}") {
|
246 |
if ($getstate != "{}") {
|
| 243 |
$getstateval = ucwords ( strtolower ( $getstate ['state'] ) );
|
247 |
$getstateval = ucwords ( strtolower ( $getstate ['state'] ) );
|
| 244 |
}
|
248 |
}
|
| 245 |
$this->set(compact('getstateval', 'user_name', 'user_contact', 'pinval', 'totalPayable', 'codAvailable', 'creditorAssociated', 'creditLimit'));
|
249 |
$this->set(compact('getstateval', 'user_name', 'user_contact', 'pinval', 'totalPayable', 'codAvailable', 'creditorAssociated', 'creditLimit', 'creditTicketSize'));
|
| 246 |
}
|
250 |
}
|
| 247 |
public function submitcheck() {
|
251 |
public function submitcheck() {
|
| 248 |
$this->autoRender = false;
|
252 |
$this->autoRender = false;
|
| 249 |
$this->request->onlyAllow ( 'ajax' );
|
253 |
$this->request->onlyAllow ( 'ajax' );
|
| 250 |
|
254 |
|