Rev 13646 | Rev 14517 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?phpApp::uses('AppController', 'Controller');/*** Exceptionalnlcs Controller** @property Exceptionalnlc $Exceptionalnlc* @property PaginatorComponent $Paginator*/class ExceptionalnlcsController extends AppController {/*** Components** @var array*/public $components = array('Paginator');public function beforeFilter() {parent::beforeFilter();// Configure::load('live');$this->apihost = Configure::read('pythonapihost');}/*** admin_index method** @return void*/public function admin_index() {$url = $this->apihost."exceptionalNlc/getExceptionalNlc";$response = $this->make_request($url,null);$this->set('exceptionalnlcs', $response);}/*** admin_view method** @throws NotFoundException* @param string $id* @return void*/public function admin_view($id = null) {if (!$this->Exceptionalnlc->exists($id)) {throw new NotFoundException(__('Invalid exceptionalnlc'));}$options = array('conditions' => array('Exceptionalnlc.' . $this->Exceptionalnlc->primaryKey => $id));$this->set('exceptionalnlc', $this->Exceptionalnlc->find('first', $options));}/*** admin_add method** @return void*/public function admin_add() {if ($this->request->is('post')) {$url = $this->apihost."exceptionalNlc/addExceptionalNlc";$jsonVar = json_encode($this->request->data['Exceptionalnlc'], JSON_NUMERIC_CHECK );$response = $this->make_request($url,$jsonVar);if (key($response)) {$this->Session->setFlash(current($response));return $this->redirect(array('action' => 'index'));} else {$this->Session->setFlash(current($response));}}}/*** admin_edit method** @throws NotFoundException* @param string $id* @return void*/public function admin_edit($id = null) {if (!$this->Exceptionalnlc->exists($id)) {throw new NotFoundException(__('Invalid exceptionalnlc'));}if ($this->request->is(array('post', 'put'))) {if ($this->Exceptionalnlc->save($this->request->data)) {$this->Session->setFlash(__('The exceptionalnlc has been saved.'));return $this->redirect(array('action' => 'index'));} else {$this->Session->setFlash(__('The exceptionalnlc could not be saved. Please, try again.'));}} else {$options = array('conditions' => array('Exceptionalnlc.' . $this->Exceptionalnlc->primaryKey => $id));$this->request->data = $this->Exceptionalnlc->find('first', $options);}}/*** admin_delete method** @throws NotFoundException* @param string $id* @return void*/public function admin_delete($id = null) {$this->Exceptionalnlc->id = $id;if (!$this->Exceptionalnlc->exists()) {throw new NotFoundException(__('Invalid exceptionalnlc'));}$this->request->onlyAllow('post', 'delete');if ($this->Exceptionalnlc->delete()) {$this->Session->setFlash(__('The exceptionalnlc has been deleted.'));} else {$this->Session->setFlash(__('The exceptionalnlc could not be deleted. Please, try again.'));}return $this->redirect(array('action' => 'index'));}}