| Line 17... |
Line 17... |
| 17 |
|
17 |
|
| 18 |
public function beforeFilter() {
|
18 |
public function beforeFilter() {
|
| 19 |
parent::beforeFilter();
|
19 |
parent::beforeFilter();
|
| 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 |
$this->mobileapihost = Configure::read('saholicapihost');
|
| 22 |
}
|
23 |
}
|
| 23 |
public function tin_search($tin_num = null) {
|
24 |
public function tin_search($tin_num = null) {
|
| 24 |
$this->layout = 'ajax';
|
25 |
$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'];
|
26 |
$user_email = $this->Auth->user('email');
|
| 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);
|
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);
|
| 30 |
$url = $this->apihost."tinsearch?tin=".$tin_num;
|
28 |
$url = $this->apihost."tinsearch?tin=".$tin_num;
|
| 31 |
$tinres = $this->make_request($url,null);
|
29 |
$tinres = $this->make_request($url,null);
|
| 32 |
$this->set(compact('tinres' ,'tin_num','user_email'));
|
30 |
$this->set(compact('tinres' ,'tin_num','user_email'));
|
| 33 |
$this->render('/Elements/gettindetail');
|
31 |
$this->render('/Elements/gettindetail');
|
| Line 36... |
Line 34... |
| 36 |
public function index() {
|
34 |
public function index() {
|
| 37 |
$this->layout = "innerpages";
|
35 |
$this->layout = "innerpages";
|
| 38 |
}
|
36 |
}
|
| 39 |
|
37 |
|
| 40 |
public function confirm(){
|
38 |
public function confirm(){
|
| 41 |
// return $this->redirect(
|
39 |
// $this->layout = "innerpages";
|
| 42 |
// array('controller' => 'categories', 'action' => 'view',3));
|
40 |
$senddata = $this->request->query('aParam');
|
| 43 |
// mobileapi/tin?userId=<>&isLoggedIn=true&privateDealUser=true
|
41 |
// $url = $this->mobileapi."tin?userId=".$this->Auth->user('id')."&isLoggedIn=true&privateDealUser=true";
|
| - |
|
42 |
// $res = $this->post_request( $url, $senddata );
|
| 44 |
$this->redirect('/category/3');
|
43 |
$this->redirect('/category/3');
|
| 45 |
}
|
44 |
}
|
| 46 |
|
45 |
|
| 47 |
}
|
46 |
}
|
| 48 |
|
47 |
|