<div class="control-group form-group <?php echo $group_classes['city']; ?> " style="<?php echo $styleStateField; ?> " id="stateField"> <label for="state" class="control-label col-sm-2"> * <?php echo JText::_('COM_AKEEBASUBS_LEVEL_FIELD_STATE'); ?> </label> <div class="controls"> <span class="col-sm-3"> <?php echo AkeebasubsHelperSelect::states($field_data['state'], 'state', array('class' => 'form-control')); ?> </span> <span id="state_empty" class="help-inline help-block" <?php if (strpos($group_classes['city'], 'error') === false) { ?> style="display:none"<?php } ?> > <?php echo JText::_('COM_AKEEBASUBS_LEVEL_ERR_REQUIRED'); ?> </span> </div> </div>
</label> <div class="controls"> <?php echo AkeebasubsHelperSelect::countries($this->item->country, 'country'); ?> </div> </div> <div class="control-group"> <label for="state" class="control-label"><?php echo JText::_('COM_AKEEBASUBS_TAXRULES_STATE'); ?> </label> <div class="controls"> <?php echo AkeebasubsHelperSelect::states($this->item->state, 'state'); ?> </div> </div> <div class="control-group"> <label for="city" class="control-label"><?php echo JText::_('COM_AKEEBASUBS_TAXRULES_CITY'); ?> </label> <div class="controls"> <input type="text" name="city" id="city" value="<?php echo $this->item->city; ?> " /> </div>
function akeebasubsHelperSelect_init() { $model = F0FModel::getTmpInstance('States', 'AkeebasubsModel'); $rawstates = $model->enabled(1)->orderByLabels(1)->getItemList(true); $states = array(); $current_country = ''; $current_country_name = 'N/A'; $current_states = array('' => 'N/A'); foreach ($rawstates as $rawstate) { if ($rawstate->country != $current_country) { if (!empty($current_country_name)) { $states[$current_country_name] = $current_states; $current_states = array(); $current_country = ''; $current_country_name = ''; } if (empty($rawstate->country) || empty($rawstate->state) || empty($rawstate->label)) { continue; } $current_country = $rawstate->country; $current_country_name = AkeebasubsHelperSelect::$countries[$current_country]; } $current_states[$rawstate->state] = $rawstate->label; } if (!empty($current_country_name)) { $states[$current_country_name] = $current_states; } AkeebasubsHelperSelect::$states = $states; }