public function addUserTypeAction() { // $form=new RsvAcl_Form_FrmUserType(); // $this->view->form=$form; if ($this->getRequest()->isPost()) { $db = new RsvAcl_Model_DbTable_DbUserType(); $post = $this->getRequest()->getPost(); if (!$db->isUserTypeExist($post['user_type'])) { $id = $db->insertUserType($post); //write log file $userLog = new Application_Model_Log(); $userLog->writeUserLog($id); //End write log file //Application_Form_FrmMessage::message('One row affected!'); Application_Form_FrmMessage::redirector('/rsvAcl/user-type/index'); } else { Application_Form_FrmMessage::message('User type had existed already'); } } $db = new Application_Model_DbTable_DbGlobal(); $rs = $db->getGlobalDb('SELECT user_type_id,user_type FROM rsv_acl_user_type WHERE status=1'); $options = array('' => 'Please select'); foreach ($rs as $read) { $options[$read['user_type_id']] = $read['user_type']; } $this->view->usertype_list = $options; }
public function addUserTypeAction() { $form = new RsvAcl_Form_FrmUserType(); $this->view->form = $form; $tr = Application_Form_FrmLanguages::getCurrentlanguage(); if ($this->getRequest()->isPost()) { $db = new RsvAcl_Model_DbTable_DbUserType(); $post = $this->getRequest()->getPost(); if (!$db->isUserTypeExist($post['user_type'])) { $id = $db->insertUserType($post); // $tr = Application_Form_FrmLanguages::getCurrentlanguage(); // Application_Form_FrmMessage::message($tr->translate('ROW_AFFECTED')); // Application_Form_FrmMessage::redirector('/rsvAcl/user-type/index'); $this->_redirect('/rsvAcl/user-type/index'); } else { Application_Form_FrmMessage::message('User type had existed already'); } } }