/** * Creates a new data_customer */ public function createAction() { if (!$this->request->isPost()) { return $this->dispatcher->forward(array("controller" => "data_customer", "action" => "index")); } $data_customer = new DataCustomer(); $data_customer->nama_pemesan = $this->request->getPost("nama_pemesan"); $data_customer->alamat = $this->request->getPost("alamat"); $data_customer->kabupaten = $this->request->getPost("kabupaten"); $data_customer->no_tlp = $this->request->getPost("no_tlp"); if (!$data_customer->save()) { foreach ($data_customer->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array("controller" => "data_customer", "action" => "new")); } $this->flash->success("data_customer was created successfully"); return $this->dispatcher->forward(array("controller" => "data_customer", "action" => "index")); }