/** * remove bank interest * @param POST vars * @return JSON Encoded html * @author John Burrin * @since 1.3 * http://homelet.centos5.dev/json/portfolio-portfolio/remove-bank-interest */ public function removeBankInterestAction() { $pageSession = new Zend_Session_Namespace('portfolio_insurance_quote'); $customerReferenceNumber = $pageSession->CustomerRefNo; $ajaxForm = new Form_PortfolioInsuranceQuote_claimsDialog(); $return = array(); $request = $this->getRequest(); $postdata = $request->getPost(); $return['success'] = false; if ($ajaxForm->isValid($postdata)) { $interestManager = new Manager_Insurance_Portfolio_BankInterest(); $interestManager->removeInterest($postdata['id']); // Do the update stuffs // Get the properties to shove back into the page $interestArray = $interestManager->fetchAllInterests($customerReferenceNumber); if ($interestArray->count() > 0) { $return['html'] = $this->view->partialLoop('portfolio-insurance-quote/partials/bank-interest.phtml', $interestArray); } else { $return['html'] = '<em>None</em>'; } $return['success'] = true; } else { // TODO: This shouldn't do this should it? Zend_Debug::dump($ajaxForm->getMessages()); } echo Zend_Json::encode($return); }