Subversion Repositories SmartDukaan

Rev

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

<?php
App::uses('AppController', 'Controller');
/**
 * Exceptionalnlcs Controller
 *
 * @property Exceptionalnlc $Exceptionalnlc
 * @property PaginatorComponent $Paginator
 */
class TinsController extends AppController {

/**
 * Components
 *
 * @var array
 */
        public $components = array('Paginator');

        public function beforeFilter() {
                parent::beforeFilter();
                $this->Auth->allow(array('tin_search'));
                $this->apihost = Configure::read('pythonapihost');
        }
        public function tin_search($tin_num = null) {
                $this->layout = 'ajax';
//              $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);
                $url = $this->apihost."tinsearch?tin=".$tin_num;
                $tinres = $this->make_request($url,null);
                $this->set(compact('tinres' ,'tin_num'));
                $this->render('/Elements/gettindetail');
        }
        
        public function index() {
                $this->layout = "innerpages";
        }
        
        public function confirm(){
//              return $this->redirect(
//                              array('controller' => 'categories', 'action' => 'view',3));
//              mobileapi/tin?userId=<>&isLoggedIn=true&privateDealUser=true
                $this->redirect('/category/3');
        }

}