Blame | Last modification | View Log | RSS feed
<?phpApp::uses('AppController', 'Controller');/*** SaholicLogs Controller** @property SaholicLog $SaholicLog* @property PaginatorComponent $Paginator*/class SaholicLogsController extends AppController {/*** Components** @var array*/public $components = array('Paginator');/*** index method** @return void*/public function index() {$this->SaholicLog->recursive = 0;$this->set('saholicLogs', $this->Paginator->paginate());}/*** view method** @throws NotFoundException* @param string $id* @return void*/public function view($id = null) {if (!$this->SaholicLog->exists($id)) {throw new NotFoundException(__('Invalid saholic log'));}$options = array('conditions' => array('SaholicLog.' . $this->SaholicLog->primaryKey => $id));$this->set('saholicLog', $this->SaholicLog->find('first', $options));}/*** add method** @return void*/public function add() {if ($this->request->is('post')) {$this->SaholicLog->create();if ($this->SaholicLog->save($this->request->data)) {$this->Session->setFlash(__('The saholic log has been saved.'));return $this->redirect(array('action' => 'index'));} else {$this->Session->setFlash(__('The saholic log could not be saved. Please, try again.'));}}}/*** edit method** @throws NotFoundException* @param string $id* @return void*/public function edit($id = null) {if (!$this->SaholicLog->exists($id)) {throw new NotFoundException(__('Invalid saholic log'));}if ($this->request->is(array('post', 'put'))) {if ($this->SaholicLog->save($this->request->data)) {$this->Session->setFlash(__('The saholic log has been saved.'));return $this->redirect(array('action' => 'index'));} else {$this->Session->setFlash(__('The saholic log could not be saved. Please, try again.'));}} else {$options = array('conditions' => array('SaholicLog.' . $this->SaholicLog->primaryKey => $id));$this->request->data = $this->SaholicLog->find('first', $options);}}/*** delete method** @throws NotFoundException* @param string $id* @return void*/public function delete($id = null) {$this->SaholicLog->id = $id;if (!$this->SaholicLog->exists()) {throw new NotFoundException(__('Invalid saholic log'));}$this->request->onlyAllow('post', 'delete');if ($this->SaholicLog->delete()) {$this->Session->setFlash(__('The saholic log has been deleted.'));} else {$this->Session->setFlash(__('The saholic log could not be deleted. Please, try again.'));}return $this->redirect(array('action' => 'index'));}/*** admin_index method** @return void*/public function admin_index() {$this->SaholicLog->recursive = 0;$this->Paginator->settings = array('order' => array('id'=>'desc'));$vari = $this->Paginator->paginate();$this->set('saholicLogs', $vari);}/*** admin_view method** @throws NotFoundException* @param string $id* @return void*/public function admin_view($id = null) {if (!$this->SaholicLog->exists($id)) {throw new NotFoundException(__('Invalid saholic log'));}$options = array('conditions' => array('SaholicLog.' . $this->SaholicLog->primaryKey => $id));$this->set('saholicLog', $this->SaholicLog->find('first', $options));}/*** admin_add method** @return void*/public function admin_add() {if ($this->request->is('post')) {$this->SaholicLog->create();if ($this->SaholicLog->save($this->request->data)) {$this->Session->setFlash(__('The saholic log has been saved.'));return $this->redirect(array('action' => 'index'));} else {$this->Session->setFlash(__('The saholic log 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->SaholicLog->exists($id)) {throw new NotFoundException(__('Invalid saholic log'));}if ($this->request->is(array('post', 'put'))) {if ($this->SaholicLog->save($this->request->data)) {$this->Session->setFlash(__('The saholic log has been saved.'));return $this->redirect(array('action' => 'index'));} else {$this->Session->setFlash(__('The saholic log could not be saved. Please, try again.'));}} else {$options = array('conditions' => array('SaholicLog.' . $this->SaholicLog->primaryKey => $id));$this->request->data = $this->SaholicLog->find('first', $options);}}/*** admin_delete method** @throws NotFoundException* @param string $id* @return void*/public function admin_delete($id = null) {$this->SaholicLog->id = $id;if (!$this->SaholicLog->exists()) {throw new NotFoundException(__('Invalid saholic log'));}$this->request->onlyAllow('post', 'delete');if ($this->SaholicLog->delete()) {$this->Session->setFlash(__('The saholic log has been deleted.'));} else {$this->Session->setFlash(__('The saholic log could not be deleted. Please, try again.'));}return $this->redirect(array('action' => 'index'));}public function admin_show($id=null){// $sqlQuery = "SELECT html FROM saholic_logs where id=$id" ;// $resul=$this->SaholicLog->query($sqlQuery);$this->set('id', $id);}public function admin_html($id=null){// $sqlQuery = "SELECT html FROM saholic_logs where id=$id" ;// $result=$this->SaholicLog->query($sqlQuery);$result = $this->SaholicLog->findById($id);$this->layout = 'ajax';$this->set('result', $result);}}