本文整理汇总了PHP中osc_get_regions函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_get_regions函数的具体用法?PHP osc_get_regions怎么用?PHP osc_get_regions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_get_regions函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: osc_user
?>
</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 {
示例2: osc_user
</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>
示例3: region_select
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;
}
}
示例4: get_region_id
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;
}
示例5: item_region_box
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;
}
}
示例6: region_select
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;
}
}
示例7: region_select
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;
}
}
}
示例8: osc_esc_html
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>
示例9: pop_search_filters
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()) {
//.........这里部分代码省略.........