コード例 #1
0
ファイル: AjaxRender.php プロジェクト: lstaszak/zf_zk_aleph
 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;
 }
コード例 #2
0
 public function renderinvoiceformAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper("layout")->disableLayout();
     $oModelVOrderPaymentHistory = new Borrower_Model_VOrderPaymentHistory();
     $oFormOrderInvoice = new Borrower_Form_OrderInvoice();
     $oUser = new Admin_Model_User();
     $aJson = null;
     if ($this->_request->isPost()) {
         $aPostData = $this->_request->getPost();
         if ($aPostData["module"] == "borrower" && is_numeric($aPostData["order_payment_id"]) && isset($oFormOrderInvoice)) {
             $oRowset = $oModelVOrderPaymentHistory->getUserPaymentDetails($this->_nUserId, $aPostData["order_payment_id"]);
             if ($oRowset->count()) {
                 $aParam["id"] = $aPostData["order_payment_id"];
                 $aParam["user_email_address"] = $oUser->findEmailAddress($this->_nUserId);
                 $aParam["user_name"] = $this->_sUserName;
                 foreach ($oRowset->toArray() as $nKey => $aValue) {
                     $aParam["amount"] = $aValue["order_payment_total_amount"] / 100 . " PLN";
                     $aParam["order_id"] .= $aValue["order_journal_id"] . "; ";
                 }
             }
             $oFormOrderInvoice->populate($aParam);
             $aJson = $oFormOrderInvoice->render();
         }
     }
     header("Content-type: application/json");
     echo Zend_Json::encode($aJson);
     exit;
 }