public function step3Action() { $pageForm = new LandlordsInsuranceQuote_Form_Step3(); // Tell page to use AJAX validation as we go $this->view->headScript()->appendScript('var ajaxValidate = true; var ajaxValidatePage = 3;'); // Get the session $session = new Zend_Session_Namespace('landlords_insurance_quote'); // Get customer details $customerManager = new Manager_Core_Customer(); $customer = $customerManager->getCustomer(Model_Core_Customer::LEGACY_IDENTIFIER, $this->_customerReferenceNumber); // Set up the quote manager so we can make use of the QHLI in the templates $quoteManager = new Manager_Insurance_LandlordsPlus_Quote($this->_quoteID); $policynumber = $quoteManager->getQuote(); $this->view->qhli = $policynumber; if ($this->getRequest()->isPost()) { // We need to validate and save the data $valid = $this->_formStepCommonValidate($pageForm, 3); if ($valid) { $pageSession = new Zend_Session_Namespace('landlords_insurance_quote'); $data = $pageForm->getValues(); //Update the WebLead summary and create a STEP3 blob. $webLeadManager = new Manager_Core_WebLead(); $webLeadSummary = $webLeadManager->getSummary($session->webLeadSummaryId); $webLeadSummary->lastUpdatedTime = $this->_offsetDate(); $webLeadManager->updateSummary($webLeadSummary); //Determine if a new STEP3 blob needs to be created, or an existing one retrieved. if ($webLeadManager->getBlobExists($webLeadSummary->webLeadSummaryId, Model_Core_WebLeadStep::STEP3)) { $webLeadBlob = $webLeadManager->getBlob($webLeadSummary->webLeadSummaryId, Model_Core_WebLeadStep::STEP3); } else { $webLeadBlob = $webLeadManager->createNewBlob($webLeadSummary->webLeadSummaryId, Model_Core_WebLeadStep::STEP3); } //Update the blob and store $webLeadBlob->blob = Zend_Json::encode($_POST); $webLeadBlob->blobChecksum = crc32($webLeadBlob->blob); $webLeadManager->updateBlob($webLeadBlob); // Everything has been saved OK so navigate to next step $this->_formStepCommonNavigate(3); return; } elseif (isset($_POST['back'])) { $this->_formStepCommonNavigate(3); return; } } // Load the element data from the database if we can if ($this->_formStepCommonPopulate($pageForm, 3)) { // Render the page unless we have been redirected $this->view->form = $pageForm; $this->render('step'); } }