function ChangeState() { $country = (int) JRequest::getVar('country'); $states = hotelguide_state::getStateTree($country); if (count($states) > 0) { $javascript = 'onChange="ChangeCity(this.value)"'; $output = hotelguide_state::buildstateselect($states, 'states', 0, 'class="inputbox" size="1" style="font-size: 10px; width: 200px; text-align:left;"' . $javascript); } else { $stateoption[] = JHTML::_('select.option', 0, JText::_('HG_NOT_AVAILABLE')); $output = JHTML::_('select.genericlist', $stateoption, 'states', 'class="inputbox" size="1" style="font-size: 10px; width: 200px; text-align:left;"' . 'disabled', 'value', 'text', 0); } echo $output; }
/** * Get the room tree * based on the joomla 1.0 treerecurse * * @access public * @return array */ function treerecurse($id, $indent, $list, &$children, $title, $maxlevel = 9999, $level = 0, $type = 1) { if (@$children[$id] && $level <= $maxlevel) { foreach ($children[$id] as $v) { $id = $v->id; if ($type) { $pre = '<sup>|_</sup> '; $spacer = '. '; } else { $pre = '- '; $spacer = ' '; } if ($title) { if ($v->parent_id == 0) { $txt = '' . $v->name; } else { $txt = $pre . $v->name; } } else { if ($v->parent_id == 0) { $txt = ''; } else { $txt = $pre; } } $pt = $v->parent_id; $list[$id] = $v; $list[$id]->treename = "{$indent}{$txt}"; $list[$id]->children = count(@$children[$id]); $list = hotelguide_state::treerecurse($id, $indent . $spacer, $list, $children, $title, $maxlevel, $level + 1, $type); } } return $list; }
function ChangeState_planroute2() { $country = (int) JRequest::getVar('country2'); $results = hotelguide_state::getStateTree($country); if (count($results) > 0) { $stateoption[] = JHTML::_('select.option', '0', '- ' . JText::_('HG_SELECT_A_STATES') . ' -'); $stateoption = @array_merge($stateoption, $results); $javascript = 'onChange="ChangeStateCity_planroute2(this.value,2)"'; $output = JHTML::_('select.genericlist', $stateoption, 'filter_states2', 'class="inputbox" size="1" style="font-size: 10px; width: 100%; text-align:left;"' . $javascript); } else { $stateoption[] = JHTML::_('select.option', 0, JText::_('HG_NOT_AVAILABLE')); $javascript = 'onChange="ChangeCity_planroute2(this.value,2)"'; $output = JHTML::_('select.genericlist', $stateoption, 'filter_states2', 'class="inputbox" size="1" style="font-size: 10px; width: 100%; text-align:left;"' . $javascript . 'disabled'); } echo $output; }