Subversion Repositories SmartDukaan

Rev

Rev 18912 | Rev 18954 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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');
18915 naman 22
		$this->mobileapihost = Configure::read('saholicapihost');
18900 naman 23
	}
24
	public function tin_search($tin_num = null) {
25
		$this->layout = 'ajax';
18915 naman 26
		$user_email = $this->Auth->user('email');
18900 naman 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
		$url = $this->apihost."tinsearch?tin=".$tin_num;
29
		$tinres = $this->make_request($url,null);
18912 naman 30
		$this->set(compact('tinres' ,'tin_num','user_email'));
18900 naman 31
		$this->render('/Elements/gettindetail');
32
	}
33
 
34
	public function index() {
35
		$this->layout = "innerpages";
36
	}
37
 
38
	public function confirm(){
18915 naman 39
//		$this->layout = "innerpages";
40
		$senddata = $this->request->query('aParam');
41
// 		$url = $this->mobileapi."tin?userId=".$this->Auth->user('id')."&isLoggedIn=true&privateDealUser=true";
42
// 		$res = $this->post_request( $url, $senddata );
18900 naman 43
		$this->redirect('/category/3');
44
	}
45
 
46
}
47
 
48
 
49
 
50
 
51
 
52
 
53