• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP osc_get_countries函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中osc_get_countries函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_get_countries函数的具体用法?PHP osc_get_countries怎么用?PHP osc_get_countries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osc_get_countries函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: country_text

 public static function country_text($item = null)
 {
     if ($item == null) {
         $item = osc_item();
     }
     if (Session::newInstance()->_getForm('country') != "") {
         $item['s_country'] = Session::newInstance()->_getForm('country');
     }
     $only_one = false;
     if (!isset($item['s_country'])) {
         $countries = osc_get_countries();
         if (count($countries) == 1) {
             $item['s_country'] = $countries[0]['s_name'];
             $item['fk_c_country_code'] = $countries[0]['pk_c_code'];
             $only_one = true;
         }
     }
     parent::generic_input_text('countryName', isset($item['s_country']) ? $item['s_country'] : null, null, $only_one);
     parent::generic_input_hidden('countryId', isset($item['fk_c_country_code']) && $item['fk_c_country_code'] != null ? $item['fk_c_country_code'] : '');
     return true;
 }
开发者ID:randomecho,项目名称:OSClass,代码行数:21,代码来源:Item.form.class.php


示例2: _e

          </label>
          <div class="controls">
            <?php 
UserForm::phone_land_text(osc_user());
?>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label" for="country">
            <?php 
_e('Stream', OSCLASSWIZARDS_THEME_FOLDER);
?>
          </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>
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:user-profile.php


示例3: get_country_id

function get_country_id($item)
{
    $country_id = "";
    $aCountries = osc_get_countries();
    if (count($aCountries) == 1) {
        $country_id = $aCountries[0]['pk_c_code'];
    }
    if (array_key_exists('fk_c_country_code', $item)) {
        $country_id = $item['fk_c_country_code'];
    }
    if (Session::newInstance()->_getForm('countryId') != '') {
        $country_id = Session::newInstance()->_getForm('countryId');
    }
    return $country_id;
}
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:15,代码来源:functions.php


示例4: _e

    _e('Region', 'bender');
    ?>
</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());
开发者ID:mylastof,项目名称:os-class,代码行数:31,代码来源:item-post.php


示例5: country_text

 public static function country_text()
 {
     // get params GET (only manageItems)
     if (Params::getParam('country') != '') {
         $item['s_country'] = Params::getParam('country');
         $item['fk_c_country_code'] = Params::getParam('countryId');
     }
     $only_one = false;
     if (!isset($item['s_country'])) {
         $countries = osc_get_countries();
         if (count($countries) == 1) {
             $item['s_country'] = $countries[0]['s_name'];
             $item['fk_c_country_code'] = $countries[0]['pk_c_code'];
             $only_one = true;
         }
     }
     parent::generic_input_text('countryName', isset($item['s_country']) ? $item['s_country'] : null, null, $only_one);
     parent::generic_input_hidden('countryId', isset($item['fk_c_country_code']) && $item['fk_c_country_code'] != null ? $item['fk_c_country_code'] : '');
     return true;
 }
开发者ID:ranjithinnergys,项目名称:OSClass,代码行数:20,代码来源:ManageItems.form.class.php


示例6: fbc_button

</button>
                     <div id="facebook-login">
                 <?php 
fbc_button();
?>
                </div>
                </div>

            </div>
        </form>
    </div>
</div>
<?php 
PopUserForm::location_javascript();
UserForm::js_validation();
if (count(osc_get_countries()) == 1) {
    ?>
<script type="text/javascript">
    $(document).ready(function() {

        $('select[id="countryId"]').addClass("{required: true, messages: { required: '<?php 
    _e("Country is required", "pop");
    ?>
'}}") ;
        $('select[id="regionId"]').addClass("{required: true, messages: { required: '<?php 
    _e("Region is required", "pop");
    ?>
'}}") ;
        $('select[id="cityId"]').addClass("{required: true, messages: { required: '<?php 
    _e("City is required", "pop");
    ?>
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:user-register.php


示例7: pop_user_update_lat_long

function pop_user_update_lat_long($userId)
{
    $user = User::newInstance()->findByPrimaryKey($userId);
    $lat = 41.298336;
    $long = 2.084683;
    $location_string = pop_get_listing_location_string($user);
    if ($location_string == '') {
        $aCountries = osc_get_countries();
        $country = $aCountries[0];
        $url = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $country['s_name'] . "&sensor=true_or_false";
    } else {
        $url = "http://maps.googleapis.com/maps/api/geocode/json?address=" . urlencode($location_string) . "&sensor=true_or_false";
    }
    $content = file_get_contents($url);
    if (json_encode($content)) {
        $json = json_decode($content, true);
        if (isset($json['results'][0]['geometry']['location']['lat'])) {
            $lat = $json['results'][0]['geometry']['location']['lat'];
            $long = $json['results'][0]['geometry']['location']['lng'];
        }
    }
    User::newInstance()->update(array('d_coord_lat' => $lat, 'd_coord_long' => $long), array('pk_i_id' => $userId));
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:23,代码来源:functions.php


示例8: item_country_box

function item_country_box($country_txt, $country_select_txt)
{
    $aCountries = osc_get_countries();
    $item = osc_item() != null ? osc_item() : array();
    switch (count($aCountries)) {
        case 0:
            // no country, show input
            ?>
                        <div class="clearfix">
                            <label><?php 
            echo $country_txt;
            ?>
</label>
                            <div class="input">
                                <input class="country_name" id="country_name" type="text" name="country" value="<?php 
            echo get_country_name($item);
            ?>
" />
                            </div>
                        </div>
            <?php 
            break;
        case 1:
            // one country
            ?>
                        <input class="country_id" id="country_id" type="hidden" name="countryId" value="<?php 
            echo get_country_id($item) == "" ? $aCountries[0]['pk_c_code'] : get_country_id($item);
            ?>
" />
            <?php 
            break;
        default:
            // more than one country
            ?>
                        <div class="clearfix">
                            <label><?php 
            echo $country_txt;
            ?>
</label>
                            <div class="input">
                                <select class="country_id" id="country_id" name="countryId">
                                    <option value=""><?php 
            echo $country_select_txt;
            ?>
</option>
                                    <?php 
            foreach ($aCountries as $country) {
                ?>
                                        <option value="<?php 
                echo $country['pk_c_code'];
                ?>
"><?php 
                echo $country['s_name'];
                ?>
</option>
                                    <?php 
            }
            ?>
                                </select>
                            </div>
                        </div>
            <?php 
            break;
    }
}
开发者ID:nsswaga,项目名称:OSClass,代码行数:65,代码来源:functions.php


示例9: country_select

 public static function country_select($countries = null, $item = null)
 {
     if ($countries == null) {
         $countries = osc_get_countries();
     }
     if ($item == null) {
         $item = osc_item();
     }
     if (count($countries) > 1) {
         parent::generic_select('countryId', $countries, 'pk_c_code', 's_name', __('Select a country...'), isset($item['fk_c_country_code']) ? $item['fk_c_country_code'] : null);
         return true;
     } else {
         if (count($countries) == 1) {
             parent::generic_input_hidden('countryId', isset($item['fk_c_country_code']) ? $item['fk_c_country_code'] : $countries[0]['pk_c_code']);
             echo '</span>' . $countries[0]['s_name'] . '</span>';
             return false;
         } else {
             parent::generic_input_text('country', isset($item['s_country']) ? $item['s_country'] : null);
             return true;
         }
     }
 }
开发者ID:hashemgamal,项目名称:OSClass,代码行数:22,代码来源:Item.form.class.php



注:本文中的osc_get_countries函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP osc_get_ip_address函数代码示例发布时间:2022-05-15
下一篇:
PHP osc_get_all_get_params函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap