Esempio n. 1
0
 private function _editMain()
 {
     if ($this->_isPost()) {
         $_POST['status'] = $_POST['status'] ? 1 : 0;
         if ($this->_modelMenu->update(array('value' => $_POST['value'], 'name' => $_POST['name'], 'status' => $_POST['status']), "Id={$_POST['Id']}")) {
             $this->_utilMsg->showMsg('更改成功', 1, Tools::url(CONTROL, ACTION));
         } else {
             $this->_utilMsg->showMsg('更改失败,可能已经有相同的标识', -2);
         }
     } else {
         $this->_view->assign('id', $_GET['Id']);
         $this->_view->assign('data', $this->_modelMenu->findById($_GET['Id']));
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'Menu/EditMain.html'));
         $this->_view->display();
     }
 }
Esempio n. 2
0
 private function _editMain()
 {
     if ($this->_isPost()) {
         $_POST['status'] = $_POST['status'] ? 1 : 0;
         if ($this->_modelMenu->update(array('value' => $_POST['value'], 'name' => $_POST['name'], 'status' => $_POST['status']), "Id={$_POST['Id']}")) {
             $this->_utilMsg->showMsg(Tools::getLang('UPDATE_SUCCESS', 'Common'), 1, Tools::url(CONTROL, ACTION));
         } else {
             $this->_utilMsg->showMsg(Tools::getLang('UPDATE_ERROR', __CLASS__), -2);
         }
     } else {
         $this->_view->assign('id', $_GET['Id']);
         $this->_view->assign('data', $this->_modelMenu->findById($_GET['Id']));
         $this->_utilMsg->createNavBar();
         $this->_view->set_tpl(array('body' => 'Menu/EditMain.html'));
         $this->_view->display();
     }
 }