| 18900 |
naman |
1 |
<?php
|
|
|
2 |
App::uses('AppController', 'Controller');
|
|
|
3 |
/**
|
|
|
4 |
* Exceptionalnlcs Controller
|
|
|
5 |
*
|
|
|
6 |
* @property Exceptionalnlc $Exceptionalnlc
|
|
|
7 |
* @property PaginatorComponent $Paginator
|
|
|
8 |
*/
|
|
|
9 |
class TinsController extends AppController {
|
|
|
10 |
|
|
|
11 |
/**
|
|
|
12 |
* Components
|
|
|
13 |
*
|
|
|
14 |
* @var array
|
|
|
15 |
*/
|
|
|
16 |
public $components = array('Paginator');
|
|
|
17 |
|
|
|
18 |
public function beforeFilter() {
|
|
|
19 |
parent::beforeFilter();
|
| 18908 |
naman |
20 |
$this->Auth->allow(array('tin_search'));
|
| 18900 |
naman |
21 |
$this->apihost = Configure::read('pythonapihost');
|
|
|
22 |
}
|
|
|
23 |
public function tin_search($tin_num = null) {
|
|
|
24 |
$this->layout = 'ajax';
|
| 18912 |
naman |
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'];
|
| 18900 |
naman |
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);
|
|
|
30 |
$url = $this->apihost."tinsearch?tin=".$tin_num;
|
|
|
31 |
$tinres = $this->make_request($url,null);
|
| 18912 |
naman |
32 |
$this->set(compact('tinres' ,'tin_num','user_email'));
|
| 18900 |
naman |
33 |
$this->render('/Elements/gettindetail');
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
public function index() {
|
|
|
37 |
$this->layout = "innerpages";
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
public function confirm(){
|
|
|
41 |
// return $this->redirect(
|
|
|
42 |
// array('controller' => 'categories', 'action' => 'view',3));
|
| 18908 |
naman |
43 |
// mobileapi/tin?userId=<>&isLoggedIn=true&privateDealUser=true
|
| 18900 |
naman |
44 |
$this->redirect('/category/3');
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|