/** * Get the company type for the dropdown select box */ public function getcompanytypesAction() { // Get the parameters $id = $request = $this->getRequest()->getParam('id'); if (!empty($id) && is_numeric($id)) { echo json_encode(CompanyTypes::getListbyLegalformID($id)); } die; }
/** * Select the type of companies starting from the legal form * @return json */ public function companytypeAction() { if ($this->getRequest()->isXmlHttpRequest()) { $id = $this->getParam('id'); if (!empty($id)) { $records = CompanyTypes::getListbyLegalformID($id); die(json_encode($records)); } $records = Customers::getAll(); die(json_encode($records)); } else { die; } }