?> </label> <div class="controls"> <?php if (bender_default_location_show_as() == 'dropdown') { ItemForm::region_select(osc_get_regions(osc_user_field('fk_c_country_code')), osc_user()); } else { ItemForm::region_text(osc_user()); } ?> </div> </div> <?php } else { $aCountries = osc_get_countries(); $aRegions = osc_get_regions($aCountries[0]['pk_c_code']); ?> <input type="hidden" id="countryId" name="countryId" value="<?php echo osc_esc_html($aCountries[0]['pk_c_code']); ?> "/> <div class="control-group"> <label class="control-label" for="region"><?php _e('Region', 'bender'); ?> </label> <div class="controls"> <?php if (bender_default_location_show_as() == 'dropdown') { ItemForm::region_select($aRegions, osc_user()); } else {
</label> <div class="controls"> <?php UserForm::country_select(osc_get_countries(), osc_user()); ?> </div> </div> <div class="form-group"> <label class="control-label" for="region"> <?php _e('University', OSCLASSWIZARDS_THEME_FOLDER); ?> </label> <div class="controls"> <?php UserForm::region_select(osc_get_regions(), osc_user()); ?> </div> </div> <div class="form-group"> <label class="control-label" for="city"> <?php _e('College', OSCLASSWIZARDS_THEME_FOLDER); ?> </label> <div class="controls"> <?php UserForm::city_select(osc_get_cities(), osc_user()); ?> </div> </div>
public static function region_select($regions = null, $item = null) { // if have input text instead of select if (Session::newInstance()->_getForm('region') != '') { $regions = null; } else { if ($regions == null) { $regions = osc_get_regions(); } } if ($item == null) { $item = osc_item(); } if (count($regions) >= 1) { if (Session::newInstance()->_getForm('regionId') != "") { $item['fk_i_region_id'] = Session::newInstance()->_getForm('regionId'); if (Session::newInstance()->_getForm('countryId') != "") { $regions = Region::newInstance()->findByCountry(Session::newInstance()->_getForm('countryId')); } } parent::generic_select('regionId', $regions, 'pk_i_id', 's_name', __('Select a region...'), isset($item['fk_i_region_id']) ? $item['fk_i_region_id'] : null); return true; } else { if (Session::newInstance()->_getForm('region') != "") { $item['s_region'] = Session::newInstance()->_getForm('region'); } parent::generic_input_text('region', isset($item['s_region']) ? $item['s_region'] : null); return true; } }
function get_region_id($item) { $region_id = ""; $aRegions = osc_get_regions(); if (count($aRegions) == 1) { $region_id = $aRegions[0]['pk_i_id']; } if (array_key_exists('fk_i_region_id', $item)) { $region_id = $item['fk_i_region_id']; } if (Session::newInstance()->_getForm('regionId') != '') { $region_id = Session::newInstance()->_getForm('regionId'); } return $region_id; }
function item_region_box($region_txt, $region_select_txt) { $aRegions = osc_get_regions(); $item = osc_item() != null ? osc_item() : array(); switch (count($aRegions)) { case 0: // 0 regions ?> <div class="clearfix"> <label><?php echo $region_txt; ?> </label> <div class="input"> <input class="region_name" id="region_name" type="text" name="region" value="<?php echo get_region_name($item); ?> " /> </div> </div> <?php break; case 1: // only one region ?> <input class="region_id" id="region_id" type="hidden" name="regionId" value="<?php echo get_region_id($item); ?> " /> <?php break; default: // more than one region ?> <div class="clearfix"> <label><?php echo $region_txt; ?> </label> <div class="input"> <select class="region_id" id="region_id" name="regionId"> <option value=""><?php echo $region_select_txt; ?> </option> <?php foreach ($aRegions as $region) { ?> <option value="<?php echo $region['pk_i_id']; ?> "><?php echo $region['s_name']; ?> </option> <?php } ?> </select> </div> </div> <?php break; } }
public static function region_select($regions = null, $item = null) { // if have input text instead of select if (Session::newInstance()->_getForm('region') != '') { $regions = null; } else { if ($regions == null) { $regions = osc_get_regions(); } } if ($item == null) { $item = osc_item(); } if (count($regions) >= 1) { if (Session::newInstance()->_getForm('regionId') != "") { $item['fk_i_region_id'] = Session::newInstance()->_getForm('regionId'); if (Session::newInstance()->_getForm('countryId') != "") { $regions = Region::newInstance()->getByCountry(Session::newInstance()->_getForm('countryId')); } } parent::generic_select('regionId', $regions, 'pk_i_id', 's_name', __('Select a region...'), isset($item['fk_i_region_id']) ? $item['fk_i_region_id'] : null); return true; // } else if ( count($regions) == 1 ) { // if( Session::newInstance()->_getForm('regionId') != "" ) { // $item['fk_i_region_id'] = Session::newInstance()->_getForm('regionId'); // } // parent::generic_input_hidden('regionId', (isset($item['fk_i_region_id'])) ? $item['fk_i_region_id'] : $regions[0]['pk_i_id']) ; // echo '<span>' .$regions[0]['s_name'] . '</span>'; // return false ; } else { if (Session::newInstance()->_getForm('region') != "") { $item['s_region'] = Session::newInstance()->_getForm('region'); } parent::generic_input_text('region', isset($item['s_region']) ? $item['s_region'] : null); return true; } }
public static function region_select($regions = null, $item = null) { if ($regions == null) { $regions = osc_get_regions(); } if ($item == null) { $item = osc_item(); } if (count($regions) > 1) { parent::generic_select('regionId', $regions, 'pk_i_id', 's_name', __('Select a region...'), isset($item['fk_i_region_id']) ? $item['fk_i_region_id'] : null); return true; } else { if (count($regions) == 1) { parent::generic_input_hidden('regionId', isset($item['fk_i_region_id']) ? $item['fk_i_region_id'] : $regions[0]['pk_i_id']); echo '</span>' . $regions[0]['s_name'] . '</span>'; return false; } else { parent::generic_input_text('region', isset($item['s_region']) ? $item['s_region'] : null); return true; } } }
echo osc_esc_html(osc_search_pattern()); ?> " /> </fieldset> <fieldset class="form-group"> <label> <?php _e('Region', 'pop'); ?> </label> <div> <?php $sCountries = osc_get_countries(); $countryId = $sCountries[0]['pk_c_code']; $sRegions = osc_get_regions($countryId); ?> <?php location_autocomplete($sRegions); ?> <input type="hidden" id="countryId" name="countryId" value="<?php echo $countryId; ?> " /> <input class="input-text" type="text" id="region" name="sRegion" value="<?php echo osc_esc_html(osc_search_region()); ?> " /> <input type="hidden" id="regionId" name="regionId" /> </div> </fieldset>
function pop_search_filters() { ?> <form id="filterForm" name="filterForm" action="<?php echo osc_base_url(true); ?> " method="get" class="nocsrf"> <input type="hidden" name="page" value="search" /> <input type="hidden" name="sOrder" value="<?php echo osc_search_order(); ?> " /> <input type="hidden" name="iOrderType" value="<?php $allowedTypesForSorting = Search::getAllowedTypesForSorting(); echo $allowedTypesForSorting[osc_search_order_type()]; ?> " /> <?php foreach (osc_search_user() as $userId) { ?> <input type="hidden" name="sUser[]" value="<?php echo $userId; ?> " /> <?php } ?> <fieldset class="form-group first"> <h6> <?php _e('Search text', 'pop'); ?> </h6> <input class="input-text" type="text" name="sPattern" id="query" value="<?php echo osc_esc_html(osc_search_pattern()); ?> " /> </fieldset> <fieldset class="form-group"> <h6> <?php _e('Region', 'pop'); ?> </h6> <div> <?php $sCountries = osc_get_countries(); $countryId = $sCountries[0]['pk_c_code']; $sRegions = osc_get_regions($countryId); ?> <?php //pop_region_autocomplete($sRegions); ?> <input type="hidden" id="countryId" name="countryId" value="<?php echo $countryId; ?> " /> <input class="input-text" type="text" id="region" name="sRegion" value="<?php echo osc_esc_html(osc_search_region()); ?> " /> <input type="hidden" id="regionId" name="regionId" /> </div> </fieldset> <fieldset class="form-group"> <h6> <?php _e('City', 'pop'); ?> </h6> <div> <input class="input-text" type="text" id="city" name="sCity" value="<?php echo osc_esc_html(osc_search_city()); ?> " /> <input type="hidden" id="cityId" name="cityId" /> </div> </fieldset> <?php if (osc_images_enabled_at_items()) { ?> <fieldset class="form-group"> <div class="checkbox"> <input type="checkbox" name="bPic" id="withPicture" value="1" <?php echo osc_search_has_pic() ? 'checked' : ''; ?> /> <label for="withPicture"> <?php _e('Listings with pictures', 'pop'); ?> </label> </div> </fieldset> <?php } ?> <?php if (osc_price_enabled_at_items()) { ?> <fieldset class="form-group"> <div class="price-slice"> <h6> <?php _e('Price', 'pop'); ?> </h6> <ul class="row"> <li class="col-md-6"> <span> <?php _e('Min', 'pop'); ?> :</span> <input class="input-text" type="text" id="priceMin" name="sPriceMin" value="<?php echo osc_esc_html(osc_search_price_min()); ?> " size="6" maxlength="6" /> </li> <li class="col-md-6"> <span> <?php _e('Max', 'pop'); ?> :</span> <input class="input-text" type="text" id="priceMax" name="sPriceMax" value="<?php echo osc_esc_html(osc_search_price_max()); ?> " size="6" maxlength="6" /> </li> </ul> </div> </fieldset> <?php } ?> <div class="form-group plugin-hooks"> <?php if (osc_search_category_id()) { osc_run_hook('search_form', osc_search_category_id()); } else { osc_run_hook('search_form'); } ?> </div> <?php $aCategories = osc_search_category(); foreach ($aCategories as $cat_id) { ?> <input type="hidden" name="sCategory[]" value="<?php echo osc_esc_html($cat_id); ?> " /> <?php } ?> <div class="actions"> <button type="submit" class="btn btn-primary"> <?php _e('Apply', 'pop'); ?> </button> <a class="clear" onclick="formReset($('#filterForm'))"> <i class="fa fa-times"></i><?php echo _e('Clear filters', 'pop'); ?> </a> </div> </form> <?php }