Subversion Repositories SmartDukaan

Rev

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

Rev 18908 Rev 18912
Line 20... Line 20...
20
		$this->Auth->allow(array('tin_search'));
20
		$this->Auth->allow(array('tin_search'));
21
		$this->apihost = Configure::read('pythonapihost');
21
		$this->apihost = Configure::read('pythonapihost');
22
	}
22
	}
23
	public function tin_search($tin_num = null) {
23
	public function tin_search($tin_num = null) {
24
		$this->layout = 'ajax';
24
		$this->layout = 'ajax';
-
 
25
		$this->loadModel('User');
-
 
26
		$opt = array('conditions'=>array('id'=>$this->Auth->user('id')),'recursive'=>-1,'fields'=>'email');
-
 
27
		$usId = $this->User->find('first',$opt);
-
 
28
		$user_email = $usId['User']['email'];
25
// 		$tinres = json_decode('{"tin" : "07976957280" , "cst" : "07976957280","counter_name" : "E-RETAIL SHOP","counter_address" : "SHOP IN H. NO. 61 BLOCK B MOLAR BAND EXTN.,-110044" ,"state" : "North Delhi","pan" : "AEEPV9740C","registered_on" :"16/03/15 ","cst_status" : "Active","valid_since" :"06/07/15", "isError": "false", "errorMsg": "Error message"}',true);
29
// 		$tinres = json_decode('{"tin" : "07976957280" , "cst" : "07976957280","counter_name" : "E-RETAIL SHOP","counter_address" : "SHOP IN H. NO. 61 BLOCK B MOLAR BAND EXTN.,-110044" ,"state" : "North Delhi","pan" : "AEEPV9740C","registered_on" :"16/03/15 ","cst_status" : "Active","valid_since" :"06/07/15", "isError": "false", "errorMsg": "Error message"}',true);
26
		$url = $this->apihost."tinsearch?tin=".$tin_num;
30
		$url = $this->apihost."tinsearch?tin=".$tin_num;
27
		$tinres = $this->make_request($url,null);
31
		$tinres = $this->make_request($url,null);
28
		$this->set(compact('tinres' ,'tin_num'));
32
		$this->set(compact('tinres' ,'tin_num','user_email'));
29
		$this->render('/Elements/gettindetail');
33
		$this->render('/Elements/gettindetail');
30
	}
34
	}
31
	
35
	
32
	public function index() {
36
	public function index() {
33
		$this->layout = "innerpages";
37
		$this->layout = "innerpages";