public function getAllLocation($from = null) { if (!$from) { $locationId = "from_location_id"; } else { $locationId = "to_location_id"; } $sql = "SELECT distinct(p.{$locationId}) as location_id, l.name from price as p left join location as l on p.{$locationId}=l.location_id where 1"; $db = Zend_DB_Table::getDefaultAdapter(); $results = $db->fetchAll($sql); $arr = array("" => "--Select--"); foreach ($results as $result) { $arr[$result['location_id']] = $result['name']; } return $arr; }
public function addformAction() { $module = $this->_getParam('meta_module'); if (!$module) { return $this->_forward('error', NULL, 'default', array('error' => 'No Module Requested')); } $target_dir = APPLICATION_PATH . '/modules/' . $module . '/'; if (!$this->_find_or_make_module($module)) { return $this->_forward('error', NULL, 'default', array('error' => 'Cannot make module directory ' . $target_dir)); } // note -- find or make module should also crate a forms folder $this->view->tables = array(); $adapter = Zend_DB_Table::getDefaultAdapter(); $this->view->tables = $adapter->fetchCol('SHOW TABLES'); $this->view->domain_module = $module; }