Subversion Repositories SmartDukaan

Rev

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

Rev 18718 Rev 18734
Line 93... Line 93...
93
				}
93
				}
94
			}
94
			}
95
			$this->Session->write('creditorAssociated', $creditorAssociated);
95
			$this->Session->write('creditorAssociated', $creditorAssociated);
96
			$this->Session->write('creditLimit', $creditLimit);
96
			$this->Session->write('creditLimit', $creditLimit);
97
			$this->Session->write('creditTicketSize', $creditTicketSize);
97
			$this->Session->write('creditTicketSize', $creditTicketSize);
98
			$addressEditable = $response ['addressEditable'];
98
			$taxInvoiceEnabledUser = $response ['taxInvoiceEnabledUser'];
99
			$this->Session->write('addressEditable', $addressEditable);
99
			$this->Session->write('taxInvoiceEnabledUser', $taxInvoiceEnabledUser);
100
			
100
			
101
			if(empty($response ['addresses'])){
101
			if(empty($response ['addresses'])){
102
				$this->redirect ( array (
102
				$this->redirect ( array (
103
						'action' => 'add' 
103
						'action' => 'add' 
104
				));
104
				));
Line 161... Line 161...
161
				array_push ( $firstshowaddress, $moreshowaddress [$i] );
161
				array_push ( $firstshowaddress, $moreshowaddress [$i] );
162
			}
162
			}
163
			
163
			
164
			$this->set ( 'address', $response );
164
			$this->set ( 'address', $response );
165
			
165
			
166
			$this->set ( compact ( 'firstshowaddress', 'totalPayable', 'user_name', 'user_contact', 'pincode', 'defaultselectedaddress', 'message', 'codAvailable', 'addressEditable', 'creditorAssociated', 'creditLimit', 'creditTicketSize') );
166
			$this->set ( compact ( 'firstshowaddress', 'totalPayable', 'user_name', 'user_contact', 'pincode', 'defaultselectedaddress', 'message', 'codAvailable', 'taxInvoiceEnabledUser', 'creditorAssociated', 'creditLimit', 'creditTicketSize') );
167
		}
167
		}
168
	}
168
	}
169
	public function add($user_name = null, $user_contact = null) {
169
	public function add($user_name = null, $user_contact = null) {
170
		$this->layout = 'cartinnerpages';
170
		$this->layout = 'cartinnerpages';
171
		
171
		
172
		$totalPayable = $_SESSION ['totalPayable'];
172
		$totalPayable = $_SESSION ['totalPayable'];
173
		$codAvailable = $_SESSION ['cod'];
173
		$codAvailable = $_SESSION ['cod'];
174
		$creditLimit = $_SESSION ['creditLimit'];
174
		$creditLimit = $_SESSION ['creditLimit'];
175
		$creditorAssociated = $_SESSION ['creditorAssociated'];
175
		$creditorAssociated = $_SESSION ['creditorAssociated'];
176
		$creditTicketSize = $_SESSION ['creditTicketSize'];
176
		$creditTicketSize = $_SESSION ['creditTicketSize'];
-
 
177
		$taxInvoiceEnabledUser = $_SESSION['taxInvoiceEnabledUser'];
177
		//$pinval = base64_decode ( $_COOKIE ['s_pincode'] );
178
		//$pinval = base64_decode ( $_COOKIE ['s_pincode'] );
178
		$pinval='';
179
		$pinval='';
179
		$suserId = base64_decode ( $_COOKIE ['s_id'] );
180
		$suserId = base64_decode ( $_COOKIE ['s_id'] );
180
		$scart = base64_decode ( $_COOKIE ['s_cart'] );
181
		$scart = base64_decode ( $_COOKIE ['s_cart'] );
181
		
182
		
Line 244... Line 245...
244
		// debug($getstate);
245
		// debug($getstate);
245
		$getstateval = "";
246
		$getstateval = "";
246
		if ($getstate != "{}") {
247
		if ($getstate != "{}") {
247
			$getstateval = ucwords ( strtolower ( $getstate ['state'] ) );
248
			$getstateval = ucwords ( strtolower ( $getstate ['state'] ) );
248
		}
249
		}
249
		$this->set(compact('getstateval', 'user_name', 'user_contact', 'pinval', 'totalPayable', 'codAvailable', 'creditorAssociated', 'creditLimit', 'creditTicketSize'));
250
		$this->set(compact('getstateval', 'user_name', 'user_contact', 'pinval', 'totalPayable', 'codAvailable', 'creditorAssociated', 'creditLimit', 'creditTicketSize', 'taxInvoiceEnabledUser'));
250
	}
251
	}
251
	public function submitcheck() {
252
	public function submitcheck() {
252
		$this->autoRender = false;
253
		$this->autoRender = false;
253
		$this->request->onlyAllow ( 'ajax' );
254
		$this->request->onlyAllow ( 'ajax' );
254
		
255
		
Line 361... Line 362...
361
		$cod = $this->request->query('cod');
362
		$cod = $this->request->query('cod');
362
		$userId = $this->request->query('user_id');
363
		$userId = $this->request->query('user_id');
363
		
364
		
364
		//Added token validation to ensure only user 
365
		//Added token validation to ensure only user 
365
	 	$tokenValidated = !Configure::read ( 'requireusercheck' ) || $this->checkToken($userId);
366
	 	$tokenValidated = !Configure::read ( 'requireusercheck' ) || $this->checkToken($userId);
-
 
367
	 	$this->log(print_r($tokenValidated),'ordersdet');
366
		if(!empty($userId) && $tokenValidated==1){			
368
		if(!empty($userId) && $tokenValidated==1){			
367
			$url = $this->getAutoLoginUrl($userId,$url);
369
			$url = $this->getAutoLoginUrl($userId,$url);
368
	
370
	
369
			if(isset($this->request->data->pincode)){
371
			if(isset($this->request->data->pincode)){
370
				$pincode = $this->request->data->pincode;
372
				$pincode = $this->request->data->pincode;