Subversion Repositories SmartDukaan

Rev

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

Rev 15051 Rev 19748
Line 226... Line 226...
226
			$this->Session->setFlash(__('The retailer could not be deleted. Please, try again.'));
226
			$this->Session->setFlash(__('The retailer could not be deleted. Please, try again.'));
227
		}
227
		}
228
		return $this->redirect(array('action' => 'index'));
228
		return $this->redirect(array('action' => 'index'));
229
	}
229
	}
230
 
230
 
-
 
231
	public function admin_pendingretailer(){
-
 
232
// 		$options['conditions'] = array('status LIKE '=>"%$search%");
-
 
233
		$opt = array('conditions' => array('status'=> 'pending_verification'));
-
 
234
		$pending = $this->Retailer->find('all',$opt);
-
 
235
		$this->set(compact('pending'));
-
 
236
	}
231
	
237
	
-
 
238
	public function admin_retailerverify($id,$tin){
-
 
239
		$options['conditions'] = array('id'=> $id);
-
 
240
		$pending = $this->Retailer->find('first',$options);
-
 
241
		$result = $pending['Retailer'];
-
 
242
		$tinresult = "";
-
 
243
		if($tin != null){
-
 
244
			$url = Configure::read('pythonapihost')."tinsearch?tin=".$tin;
-
 
245
			$tinres = $this->make_request($url, null);
-
 
246
			if(!$tinres['isError']){
-
 
247
				$tinresult = $tinres;
-
 
248
				$this->set(compact('tinresult'));
-
 
249
			}
-
 
250
		}
-
 
251
		$this->set(compact('result'));
-
 
252
	}
-
 
253
	public function admin_verifycancel($id,$type){
-
 
254
		if($type == "verify"){
-
 
255
			$retquery ="update retailers set status = 'retailer_verified' and isvalidated = 1  where id = ".$id."";
-
 
256
			$this->Retailer->query($retquery);
-
 
257
		}else if($type == "cancel"){
-
 
258
			$retquery ="update retailers set status = 'not_verified' where id = ".$id."";
-
 
259
			$this->Retailer->query($retquery);
-
 
260
		}
-
 
261
		$this->redirect("pendingretailer");
-
 
262
	}
232
}
263
}