Subversion Repositories SmartDukaan

Rev

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

Rev 18915 Rev 18954
Line 22... Line 22...
22
		$this->mobileapihost = Configure::read('saholicapihost');
22
		$this->mobileapihost = Configure::read('saholicapihost');
23
	}
23
	}
24
	public function tin_search($tin_num = null) {
24
	public function tin_search($tin_num = null) {
25
		$this->layout = 'ajax';
25
		$this->layout = 'ajax';
26
		$user_email = $this->Auth->user('email');
26
		$user_email = $this->Auth->user('email');
-
 
27
		$phone_number = $this->Auth->user('mobile_number');;
27
// 		$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);
28
// 		$tinres = json_decode('{"pin_required" : "false" , "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);
28
		$url = $this->apihost."tinsearch?tin=".$tin_num;
29
		$url = $this->apihost."tinsearch?tin=".$tin_num;
29
		$tinres = $this->make_request($url,null);
30
		$tinres = $this->make_request($url,null);
-
 
31
		$pincheck = "";
-
 
32
		if($tinres['pin_required'] == false){
-
 
33
			$pincheck = $tin_res['pin'];
-
 
34
		}
30
		$this->set(compact('tinres' ,'tin_num','user_email'));
35
		$this->set(compact('tinres' ,'tin_num','user_email','phone_number','pincheck'));
31
		$this->render('/Elements/gettindetail');
36
		$this->render('/Elements/gettindetail');
32
	}
37
	}
33
	
38
	
34
	public function index() {
39
	public function index() {
35
		$this->layout = "innerpages";
40
		$this->layout = "innerpages";
36
	}
41
	}
37
	
42
	
38
	public function confirm(){
43
	public function confirm(){
39
//		$this->layout = "innerpages";
44
		$this->autoRender = false;
-
 
45
		$this->request->onlyAllow ( 'ajax' );
-
 
46
		$arr=array();
-
 
47
		$data = $this->request->data;
-
 
48
		
-
 
49
		$arr['tinMap'] = json_encode($data);
40
		$senddata = $this->request->query('aParam');
50
// 		$senddata = $this->request->query('aParam');
-
 
51
		$this->loadModel('UserAccount');
-
 
52
		$opt = array('conditions'=>array('user_id'=>$this->Auth->user('id'),'account_type'=>'saholic'),'recursive'=>-1,'fields'=>'account_key');
-
 
53
		$usId = $this->UserAccount->find('first',$opt);
-
 
54
		$cuid = $usId['UserAccount']['account_key'];
41
// 		$url = $this->mobileapi."tin?userId=".$this->Auth->user('id')."&isLoggedIn=true&privateDealUser=true";
55
		$url = $this->mobileapihost."register!registerTin?userId=".$cuid."&isLoggedIn=true&privateDealUser=true";
-
 
56
// 		$url = "http://45.79.106.95:8080/mobileapi/register!registerTin?isLoggedIn=true&privateDealUser=true&userId=483649";
42
// 		$res = $this->post_request( $url, $senddata );
57
		$res = $this->post_request( $url, $arr );
43
		$this->redirect('/category/3');
58
// 		$this->redirect('/category/3');
-
 
59
		return	json_encode($data);
44
	}
60
	}
45
 
61
 
46
}
62
}
47
 
63
 
48
 
64