Server IP : 180.180.241.3 / Your IP : 216.73.216.194 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/app/Controller/ |
Upload File : |
<?php App::uses('AppController', 'Controller'); /** * Visitors Controller * * @property Visitor $Visitor * @property PaginatorComponent $Paginator */ class VisitorsController extends AppController { /** * admin_index method * * @return void */ public function admin_index() { $this->Visitor->recursive = 0; $this->set('visitors', $this->Paginator->paginate()); } /** * admin_view method * * @throws NotFoundException * @param string $id * @return void */ public function admin_view($id = null) { if (!$this->Visitor->exists($id)) { throw new NotFoundException(__('Invalid visitor')); } $options = array('conditions' => array('Visitor.' . $this->Visitor->primaryKey => $id)); $this->set('visitor', $this->Visitor->find('first', $options)); } /** * admin_add method * * @return void */ public function admin_add() { if ($this->request->is('post')) { $this->Visitor->create(); if ($this->Visitor->save($this->request->data)) { $this->Session->setFlash(__('The visitor has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The visitor could not be saved. Please, try again.')); } } $activities = $this->Visitor->Activity->find('list'); $this->set(compact('activities')); } /** * admin_edit method * * @throws NotFoundException * @param string $id * @return void */ public function admin_edit($id = null) { if (!$this->Visitor->exists($id)) { throw new NotFoundException(__('Invalid visitor')); } if ($this->request->is('post') || $this->request->is('put')) { if ($this->Visitor->save($this->request->data)) { $this->Session->setFlash(__('The visitor has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The visitor could not be saved. Please, try again.')); } } else { $options = array('conditions' => array('Visitor.' . $this->Visitor->primaryKey => $id)); $this->request->data = $this->Visitor->find('first', $options); } $activities = $this->Visitor->Activity->find('list'); $this->set(compact('activities')); } /** * admin_delete method * * @throws NotFoundException * @param string $id * @return void */ public function admin_delete($id = null) { $this->Visitor->id = $id; if (!$this->Visitor->exists()) { throw new NotFoundException(__('Invalid visitor')); } $this->request->onlyAllow('post', 'delete'); if ($this->Visitor->delete()) { $this->Session->setFlash(__('The visitor has been deleted.')); } else { $this->Session->setFlash(__('The visitor could not be deleted. Please, try again.')); } return $this->redirect(array('action' => 'index')); }}