public function checkavailabilityAction() { global $mySession; $db = new Db(); $res = array("error" => "true", "success" => "true", "message" => "no posted data"); $book = new Booking(); if ($this->getRequest()->isPost()) { $dataForm = $this->getRequest()->getParams(); $result = $book->checkAvailablity($dataForm, $dataForm['pptyId']); if ($result["output"]) { $res["cost"] = $result["cost"] ? $result["cost"] : 0; $res["error"] = "false"; $res["success"] = "true"; } else { $res["message"] = $result["message"]; $res["error"] = "true"; $res["success"] = "false"; } } echo $this->_helper->json($res); }
public function processbookAction() { global $mySession; $db = new Db(); $dataForm = array(); $dataextraForm = array(); $this->core(); $myform = new Form_Booking($this->ppty); $this->view->myform = $myform; $request = $this->getRequest(); if ($this->getRequest()->isPost() && isset($_REQUEST['agree'])) { if ($myform->isValid($request->getPost())) { $book = new Booking(); $dataForm = $myform->getValues(); $result = $book->checkAvailablity($dataForm, $this->ppty); if ($result === 1) { $this->_redirect("booking/index/step/2/ppty/" . $this->ppty); } else { $mySession->errorMsg = $result; $this->render("index"); } } else { $this->_redirect("booking/index/step/2/ppty/" . $this->ppty); } } else { $this->_redirect("booking/index/ppty/" . $this->ppty); } }