Esempio n. 1
0
 public static function getCountryOptions()
 {
     $options = array();
     $options = array_merge(JEMHelperCountries::getCountryOptions(), $options);
     array_unshift($options, JHtml::_('select.option', '0', JText::_('COM_JEM_SELECT_COUNTRY')));
     return $options;
 }
Esempio n. 2
0
 /**
  * get Holiday-options
  */
 static function getHolidayOptions($countryType = false, $value_tag = 'value', $text_tag = 'text')
 {
     $currentValue = '0';
     # Retrieve Country's
     $countryoptions = array();
     $countryoptions = array_merge(JEMHelperCountries::getCountryOptions(), $countryoptions);
     array_unshift($countryoptions, JHtml::_('select.option', '0', JText::_('COM_JEM_SELECT_COUNTRY')));
     $countryoutput = JHtml::_('select.genericlist', $countryoptions, 'countryactivated', null, 'value', 'text', $currentValue);
     # Retrieve Holidays
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('date_name,id');
     $query->from('#__jem_dates');
     $query->where('holiday =' . $db->Quote('1'));
     $db->setQuery($query);
     $holidays = $db->loadObjectList();
     $options = array();
     foreach ($holidays as $holiday) {
         //$name = explode(',', $country['name']);
         $options[] = JHtml::_('select.option', $holiday->id, JText::_($holiday->date_name), $value_tag, $text_tag);
     }
     //$options2 = array();
     //$options2 = array_merge($options,$options2);
     //array_unshift($options2, JHtml::_('select.option', '0', JText::_('COM_JEM_SELECT_HOLIDAY')));
     //$html[] = JHtml::_('select.genericlist', $countryoptions, 'countryactivated', null, 'value', 'text', $currentValue);
     $html[] = JHtml::_('select.genericlist', $options, 'activated[]', 'class="inputbox" size="6" multiple="true"', 'value', 'text', $currentValue);
     return implode("\n", $html);
 }