Ejemplo n.º 1
0
 public function signAction()
 {
     $data = array();
     if ($this->_hasParam('id')) {
         $id = Zend_filter::filterStatic($this->_getParam('id'), 'int');
         if (Application_Model_Classroom::isAvailable($id)) {
             $session = new Zend_Session_Namespace('data');
             $session->classroom_id = $id;
             $classroom = new Zend_Db_Table('classroom');
             $row = $classroom->fetchRow(array('id = ?' => $id));
             if (PAYMENT && $row->amount && $row->amount > 0) {
                 $this->_redirect('/classroom/pay');
             } else {
                 $this->_redirect('/classroom/register');
             }
         }
     }
     $this->view->messages = array('Unavailable');
 }
Ejemplo n.º 2
0
 public function deleteAction()
 {
     $id = Zend_filter::filterStatic($this->_getParam('id'), 'int');
     $userId = Zend_filter::filterStatic($this->_getParam('userId'), 'int');
     $classroomUser = new Tri_Db_Table('classroom_user');
     $classroomUser->delete(array('user_id = ?' => $userId, 'classroom_id = ?' => $id));
     $this->_helper->_flashMessenger->addMessage('Success');
     $this->_redirect('admin/classroom/list-user/id/' . $id);
 }