public function renderForm($nInstanceId, $aData = null) { $sForm = null; if (is_numeric($nInstanceId)) { if ($nInstanceId == 1) { $oFormImageAddTo = new Admin_Form_ImageAddTo(); $sForm = $oFormImageAddTo->render(); } else { if ($nInstanceId == 2) { $oFormImageSettings = new Admin_Form_ImageSettings(); $sForm = $oFormImageSettings->render(); } else { if ($nInstanceId == 4) { if ($aData["module"] == "borrower") { $oFormOrderSettings = new Borrower_Form_OrderInvoice(); } if (isset($oFormOrderSettings)) { $sForm = $oFormOrderSettings->render(); } } } } return $sForm; } return null; }
public function sendinvoiceAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->getHelper("layout")->disableLayout(); $aJson = null; if ($this->_request->isPost()) { $oOrderInvoiceForm = new Borrower_Form_OrderInvoice(); $aPostData = $this->_request->getPost(); if ($oOrderInvoiceForm->isValid($aPostData)) { $oMail = new AppCms2_Controller_Plugin_Mail(); $oMail->sendInvoice($aPostData); $aJson = true; } } header("Content-type: application/json"); echo Zend_Json::encode($aJson); exit; }