Subversion Repositories SmartDukaan

Rev

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

Rev 18954 Rev 18969
Line 26... Line 26...
26
		$user_email = $this->Auth->user('email');
26
		$user_email = $this->Auth->user('email');
27
		$phone_number = $this->Auth->user('mobile_number');;
27
		$phone_number = $this->Auth->user('mobile_number');;
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
// 		$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);
29
		$url = $this->apihost."tinsearch?tin=".$tin_num;
29
		$url = $this->apihost."tinsearch?tin=".$tin_num;
30
		$tinres = $this->make_request($url,null);
30
		$tinres = $this->make_request($url,null);
31
		$pincheck = "";
31
		$pincheck = "nothing";
32
		if($tinres['pin_required'] == false){
32
		if($tinres['pin_required'] == false){
33
			$pincheck = $tin_res['pin'];
33
			$pincheck = $tinres['pin'];
34
		}
34
		}
35
		$this->set(compact('tinres' ,'tin_num','user_email','phone_number','pincheck'));
35
		$this->set(compact('tinres' ,'tin_num','user_email','phone_number','pincheck'));
36
		$this->render('/Elements/gettindetail');
36
		$this->render('/Elements/gettindetail');
37
	}
37
	}
38
	
38
	
Line 52... Line 52...
52
		$opt = array('conditions'=>array('user_id'=>$this->Auth->user('id'),'account_type'=>'saholic'),'recursive'=>-1,'fields'=>'account_key');
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);
53
		$usId = $this->UserAccount->find('first',$opt);
54
		$cuid = $usId['UserAccount']['account_key'];
54
		$cuid = $usId['UserAccount']['account_key'];
55
		$url = $this->mobileapihost."register!registerTin?userId=".$cuid."&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";
56
// 		$url = "http://45.79.106.95:8080/mobileapi/register!registerTin?isLoggedIn=true&privateDealUser=true&userId=483649";
57
		$res = $this->post_request( $url, $arr );
57
		$res = $this->post_request( $url, $arr, 'nojson' );
-
 
58
		//print_r($res);
58
// 		$this->redirect('/category/3');
59
// 		$this->redirect('/category/3');
59
		return	json_encode($data);
60
		return	$res;
60
	}
61
	}
61
 
62
 
62
}
63
}
63
 
64
 
64
 
65