コード例 #1
0
ファイル: UserController.php プロジェクト: robjacoby/xlr8u
 public function sessionAction()
 {
     if ($this->getRequest()->isGet()) {
         $sessionid = $this->_getParam('id');
         $session = Model_Session::findOneById($sessionid);
         $this->view->session = $session;
     } else {
         $this->_redirect('/user/');
     }
 }
コード例 #2
0
ファイル: AdminController.php プロジェクト: robjacoby/xlr8u
 public function sessionAction()
 {
     if ($this->getRequest()->isGet()) {
         $sessionid = $this->_getParam('id');
         $session = Model_Session::findOneById($sessionid);
         $this->view->session = $session;
         $config = new Zend_Config_Ini(APPLICATION_PATH . '/forms/session.ini', 'result');
         $this->view->form = new Zend_Form($config->session);
         $this->view->form->sessionid->setValue($sessionid);
     } else {
         if ($this->getRequest()->isPost()) {
             $sessionid = $this->_getParam('sessionid');
             $result = new Model_Result();
             $result->sessionid = $sessionid;
             $result->description = $this->_getParam('description');
             $result->value = $this->_getParam('value');
             $result->save();
             $session = Model_Session::findOneById($sessionid);
             $this->view->session = $session;
             $config = new Zend_Config_Ini(APPLICATION_PATH . '/forms/session.ini', 'result');
             $this->view->form = new Zend_Form($config->session);
             $this->view->form->sessionid->setValue($sessionid);
         } else {
             $this->_redirect('/admin/');
         }
     }
 }