| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 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 : /AppServ/www/app/Controller/ |
Upload File : |
<?php
App::uses('AppController', 'Controller');
/**
* Mous Controller
*
* @property Mou $Mou
* @property PaginatorComponent $Paginator
*/
class MousController extends AppController {
/**
* admin_index method
*
* @return void
*/
public function admin_index() {
$this->Mou->recursive = 0;
$this->set('mous', $this->Paginator->paginate());
}
/**
* admin_view method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function admin_view($id = null) {
if (!$this->Mou->exists($id)) {
throw new NotFoundException(__('Invalid mou'));
}
$options = array('conditions' => array('Mou.' . $this->Mou->primaryKey => $id));
$this->set('mou', $this->Mou->find('first', $options));
}
/**
* admin_add method
*
* @return void
*/
public function admin_add() {
if ($this->request->is('post')) {
$this->Mou->create();
if ($this->Mou->save($this->request->data)) {
$this->Session->setFlash(__('The mou has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The mou could not be saved. Please, try again.'));
}
}
}
/**
* admin_edit method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function admin_edit($id = null) {
if (!$this->Mou->exists($id)) {
throw new NotFoundException(__('Invalid mou'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->Mou->save($this->request->data)) {
$this->Session->setFlash(__('The mou has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The mou could not be saved. Please, try again.'));
}
} else {
$options = array('conditions' => array('Mou.' . $this->Mou->primaryKey => $id));
$this->request->data = $this->Mou->find('first', $options);
}
}
/**
* admin_delete method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
public function admin_delete( $id = null ) {
$this->Mou->id = $id;
if (!$this->Mou->exists()) {
throw new NotFoundException(__('Invalid mou'));
}
$this->request->onlyAllow('post', 'delete');
if ($this->Mou->delete()) {
$this->Session->setFlash(__('The mou has been deleted.'));
} else {
$this->Session->setFlash(__('The mou could not be deleted. Please, try again.'));
}
return $this->redirect(array('action' => 'index'));
}}