Ejemplo n.º 1
0
 public function editcurrencyAction()
 {
     global $mySession;
     $db = new Db();
     $currencyId = $this->getRequest()->getParam('currencyId');
     $this->view->currencyId = $currencyId;
     $myform = new Form_Currency($currencyId);
     $this->view->pageHeading = "Edit Currency";
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $myObj = new Currencies();
             $result = $myObj->saveCurrency($dataForm, $currencyId);
             if ($result == 1) {
                 $mySession->sucessMsg = "Currency Updated Sucessfully";
                 $this->_redirect('currencies/index');
             } else {
                 $mySession->errorMsg = "This Currency Name Already Exists.";
             }
         }
     }
     $this->view->myform = $myform;
 }