Example #1
0
 function display($tpl = null)
 {
     $this->form = $this->get('Form');
     // Get data from the model
     $this->item = $this->get('Item');
     // inturn calls getState in parent class and populateState() in model
     $this->state = $this->get('State');
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'models' . DS . 'taxrates.php';
     $model = new K2StoreModelTaxRates();
     $geozones = $model->getGeoZones();
     //generate geozone filter list
     $lists = array();
     $geozone_options = array();
     $geozone_options[] = JHTML::_('select.option', '', JText::_('K2STORE_SELECT_COUNTRY'));
     foreach ($geozones as $row) {
         $geozone_options[] = JHTML::_('select.option', $row->geozone_id, $row->geozone_name);
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     //add toolbar
     $this->addToolBar();
     $toolbar = new K2StoreToolBar();
     $toolbar->renderLinkbar();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
Example #2
0
 public function getInput()
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_k2store/models/taxrates.php';
     $model = new K2StoreModelTaxRates();
     $countries = $model->getGeoZones();
     //generate geozone filter list
     $geozone_options = array();
     $geozone_options[] = JHTML::_('select.option', '', JText::_('K2STORE_SELECT_GEOZONE'));
     foreach ($countries as $row) {
         $geozone_options[] = JHTML::_('select.option', $row->geozone_id, $row->geozone_name);
     }
     return JHTML::_('select.genericlist', $geozone_options, $this->name, 'onchange=', 'value', 'text', $this->value);
 }