Example #1
0
 public function states()
 {
     $countryID = uri::segment(3);
     $data = array();
     if (input::post('title') == 'any') {
         $data[''] = __('any', 'system', array(), array(), false);
     } else {
         $data[''] = __('select', 'system', array(), array(), false);
     }
     foreach (geo_helper::getStates($countryID) as $id => $name) {
         $data[$id . ' '] = $name;
     }
     view::ajaxResponse($data);
 }
Example #2
0
        ?>

	<?php 
    case 'location':
        ?>

		<?php 
        echo form_helper::select($name . '[country]', array('' => isset($field['select']) && $field['select'] ? __('select', 'system') : __('any', 'system')) + geo_helper::getCountries(), form_helper::setSelect($name . '[country]', isset($value[$name]) ? $value[$name] : ''), array('class' => 'select geo ' . (isset($field['class']) && $field['class'] ? $field['class'] : ''), 'style' => isset($field['style']) && $field['style'] ? $field['style'] : '', 'id' => $id . '_country', 'onchange' => "geo('any',this.id,this.value)"));
        ?>

		<?php 
        if (isset($value[$name]['country']) && $value[$name]['country']) {
            ?>

			<?php 
            echo form_helper::select($name . '[state]', array('' => isset($field['select']) && $field['select'] ? __('select', 'system') : __('any', 'system')) + geo_helper::getStates($value[$name]['country']), form_helper::setSelect($name . '[state]', isset($value[$name]['state']) ? $value[$name]['state'] : ''), array('class' => 'select geo ' . (isset($field['class']) && $field['class'] ? $field['class'] : ''), 'style' => isset($field['style']) && $field['style'] ? $field['style'] : '', 'id' => $id . '_country_state', 'onchange' => "geo('any',this.id,null,this.value)"));
            ?>

			<?php 
            if (isset($value[$name]['state']) && $value[$name]['state']) {
                ?>

				<?php 
                echo form_helper::select($name . '[city]', array('' => isset($field['select']) && $field['select'] ? __('select', 'system') : __('any', 'system')) + geo_helper::getCities($value[$name]['state']), form_helper::setSelect($name . '[city]', isset($value[$name]['city']) ? $value[$name]['city'] : ''), array('class' => 'select geo ' . (isset($field['class']) && $field['class'] ? $field['class'] : ''), 'style' => isset($field['style']) && $field['style'] ? $field['style'] : '', 'id' => $id . '_country_state_city'));
                ?>

			<?php 
            }
            ?>

		<?php