Пример #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 J2StoreModelTaxRates();
     $geozones = $model->getGeoZones();
     //generate geozone filter list
     $lists = array();
     $geozone_options = array();
     $geozone_options[] = JHTML::_('select.option', '', JText::_('J2STORE_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 J2StoreToolBar();
     $toolbar->renderLinkbar();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
Пример #2
0
 public function getInput()
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/models/taxrates.php';
     $model = new J2StoreModelTaxRates();
     $countries = $model->getGeoZones();
     //generate geozone filter list
     $geozone_options = array();
     $geozone_options[] = JHTML::_('select.option', '', JText::_('J2STORE_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);
 }