当前位置: 首页>>代码示例>>PHP>>正文


PHP osc_locale_thousands_sep函数代码示例

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


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

示例1: multicurrency_add_prices

function multicurrency_add_prices($formatted_price)
{
    if (osc_item_price() != NULL && osc_item_price() != '' && osc_item_price() != 0) {
        $rates = ModelMC::newInstance()->getRates(osc_item_currency());
        $data = array();
        foreach ($rates as $r) {
            $price = osc_item_price() / 1000000 * $r['f_rate'];
            $symbol = $r['s_to'];
            $currencyFormat = osc_locale_currency_format();
            $currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat);
            $currencyFormat = str_replace('{CURRENCY}', $symbol, $currencyFormat);
            $data[] = $currencyFormat;
        }
        return $formatted_price . ' <a class=MCtooltip href="#">' . __('Other currencies', 'multicurrency') . '<span>' . implode("<br />", $data) . '</span></a>';
    }
    return $formatted_price;
}
开发者ID:bomvendador,项目名称:soroka_r,代码行数:17,代码来源:index.php

示例2: prepareData


//.........这里部分代码省略.........
            }

            if($is_add || $this->is_admin) {
                $dt_expiration = Params::getParam('dt_expiration');
                if($dt_expiration==-1) {
                    $aItem['dt_expiration'] = '';
                } else if($dt_expiration!='' && (preg_match('|^([0-9]+)$|', $dt_expiration, $match) || preg_match('|([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})|', $dt_expiration, $match))) {
                    $aItem['dt_expiration'] = $dt_expiration;
                } else {
                    $_category = Category::newInstance()->findByPrimaryKey($aItem['catId']);
                    $aItem['dt_expiration'] = $_category['i_expiration_days'];
                }
                unset($dt_expiration);
            } else {
                $aItem['dt_expiration'] = '';
            };

            // check params
            $country = Country::newInstance()->findByCode($aItem['countryId']);
            if( count($country) > 0 ) {
                $countryId = $country['pk_c_code'];
                $countryName = $country['s_name'];
            } else {
                $countryId = null;
                $countryName = $aItem['country'];
            }
            $aItem['countryId']   = $countryId;
            $aItem['countryName']   = $countryName;

            if( $aItem['regionId'] != '' ) {
                if( intval($aItem['regionId']) ) {
                    $region = Region::newInstance()->findByPrimaryKey($aItem['regionId']);
                    if( count($region) > 0 ) {
                        $regionId = $region['pk_i_id'];
                        $regionName = $region['s_name'];
                    }
                }
            } else {
                $regionId = null;
                $regionName = $aItem['region'];
                if( $aItem['countryId'] != '' ) {
                    $auxRegion  = Region::newInstance()->findByName($aItem['region'], $aItem['countryId'] );
                    if($auxRegion){
                        $regionId   = $auxRegion['pk_i_id'];
                        $regionName = $auxRegion['s_name'];
                    }
                }
            }

            $aItem['regionId']      = $regionId;
            $aItem['regionName']    = $regionName;

            if( $aItem['cityId'] != '' ) {
                if( intval($aItem['cityId']) ) {
                    $city = City::newInstance()->findByPrimaryKey($aItem['cityId']);
                    if( count($city) > 0 ) {
                        $cityId = $city['pk_i_id'];
                        $cityName = $city['s_name'];
                    }
                }
            } else {
                $cityId = null;
                $cityName = $aItem['city'];
                if( $aItem['countryId'] != '' ) {
                    $auxCity = City::newInstance()->findByName($aItem['city'], $aItem['regionId'] );
                    if($auxCity){
                        $cityId   = $auxCity['pk_i_id'];
                        $cityName = $auxCity['s_name'];
                    }
                }
            }

            $aItem['cityId']      = $cityId;
            $aItem['cityName']    = $cityName;

            if( $aItem['cityArea'] == '' ) {
                $aItem['cityArea'] = null;
            }

            if( $aItem['address'] == '' ) {
                $aItem['address'] = null;
            }

            if( !is_null($aItem['price']) ) {
                $price = str_replace(osc_locale_thousands_sep(), '', trim($aItem['price']));
                $price = str_replace(osc_locale_dec_point(), '.', $price);
                $aItem['price'] = $price*1000000;
                //$aItem['price'] = (float) $aItem['price'];
            }

            if( $aItem['catId'] == ''){
                $aItem['catId'] = 0;
            }

            if( $aItem['currency'] == '' ) {
                $aItem['currency'] = null;
            }

            $this->data = $aItem;
        }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:101,代码来源:ItemActions.php

示例3: prepareData


//.........这里部分代码省略.........
             $data = User::newInstance()->findByPrimaryKey($userId);
             $aItem['contactName'] = $data['s_name'];
             $aItem['contactEmail'] = $data['s_email'];
             Params::setParam('contactName', $data['s_name']);
             Params::setParam('contactEmail', $data['s_email']);
         } else {
             $aItem['contactName'] = Params::getParam('contactName');
             $aItem['contactEmail'] = Params::getParam('contactEmail');
         }
         $aItem['userId'] = $userId;
     }
     // get params
     $aItem['catId'] = Params::getParam('catId');
     $aItem['countryId'] = Params::getParam('countryId');
     $aItem['country'] = Params::getParam('country');
     $aItem['region'] = Params::getParam('region');
     $aItem['regionId'] = Params::getParam('regionId');
     $aItem['city'] = Params::getParam('city');
     $aItem['cityId'] = Params::getParam('cityId');
     $aItem['price'] = Params::getParam('price') != '' ? Params::getParam('price') : null;
     $aItem['cityArea'] = Params::getParam('cityArea');
     $aItem['address'] = Params::getParam('address');
     $aItem['currency'] = Params::getParam('currency');
     $aItem['showEmail'] = Params::getParam('showEmail') != '' ? 1 : 0;
     $aItem['title'] = Params::getParam('title');
     $aItem['description'] = Params::getParam('description');
     $aItem['photos'] = Params::getFiles('photos');
     // check params
     $country = Country::newInstance()->findByCode($aItem['countryId']);
     if (count($country) > 0) {
         $countryId = $country['pk_c_code'];
         $countryName = $country['s_name'];
     } else {
         $countryId = null;
         $countryName = $aItem['country'];
     }
     $aItem['countryId'] = $countryId;
     $aItem['countryName'] = $countryName;
     if ($aItem['regionId'] != '') {
         if (intval($aItem['regionId'])) {
             $region = Region::newInstance()->findByPrimaryKey($aItem['regionId']);
             if (count($region) > 0) {
                 $regionId = $region['pk_i_id'];
                 $regionName = $region['s_name'];
             }
         }
     } else {
         $regionId = null;
         $regionName = $aItem['region'];
         if ($aItem['countryId'] != '') {
             $auxRegion = Region::newInstance()->findByName($aItem['region'], $aItem['countryId']);
             if ($auxRegion) {
                 $regionId = $auxRegion['pk_i_id'];
                 $regionName = $auxRegion['s_name'];
             }
         }
     }
     $aItem['regionId'] = $regionId;
     $aItem['regionName'] = $regionName;
     if ($aItem['cityId'] != '') {
         if (intval($aItem['cityId'])) {
             $city = City::newInstance()->findByPrimaryKey($aItem['cityId']);
             if (count($city) > 0) {
                 $cityId = $city['pk_i_id'];
                 $cityName = $city['s_name'];
             }
         }
     } else {
         $cityId = null;
         $cityName = $aItem['city'];
         if ($aItem['countryId'] != '') {
             $auxCity = City::newInstance()->findByName($aItem['city'], $aItem['regionId']);
             if ($auxCity) {
                 $cityId = $auxCity['pk_i_id'];
                 $cityName = $auxCity['s_name'];
             }
         }
     }
     $aItem['cityId'] = $cityId;
     $aItem['cityName'] = $cityName;
     if ($aItem['cityArea'] == '') {
         $aItem['cityArea'] = null;
     }
     if ($aItem['address'] == '') {
         $aItem['address'] = null;
     }
     if (!is_null($aItem['price'])) {
         $price = str_replace(osc_locale_thousands_sep(), '', trim($aItem['price']));
         $price = str_replace(osc_locale_dec_point(), '.', $price);
         $aItem['price'] = $price * 1000000;
         //$aItem['price'] = (float) $aItem['price'];
     }
     if ($aItem['catId'] == '') {
         $aItem['catId'] = 0;
     }
     if ($aItem['currency'] == '') {
         $aItem['currency'] = null;
     }
     $this->data = $aItem;
 }
开发者ID:ranjithinnergys,项目名称:OSClass,代码行数:101,代码来源:ItemActions.php

示例4: while

    <?php 
if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
    ?>
    $().ready(function(){
        $("#price").blur(function(event) {
            var price = $("#price").prop("value");
            <?php 
    if (osc_locale_thousands_sep() != '') {
        ?>
            while(price.indexOf('<?php 
        echo osc_esc_js(osc_locale_thousands_sep());
        ?>
')!=-1) {
                price = price.replace('<?php 
        echo osc_esc_js(osc_locale_thousands_sep());
        ?>
', '');
            }
            <?php 
    }
    ?>
            <?php 
    if (osc_locale_dec_point() != '') {
        ?>
            var tmp = price.split('<?php 
        echo osc_esc_js(osc_locale_dec_point());
        ?>
');
            if(tmp.length>2) {
                price = tmp[0]+'<?php 
开发者ID:mylastof,项目名称:os-class,代码行数:30,代码来源:item-post.php

示例5: osc_format_price

/**
 * Formats the price using the appropiate currency.
 *
 * @param float $price
 * @return string
 */
function osc_format_price($price)
{
    if ($price == null) {
        return osc_apply_filter('item_price_null', __('Check with seller'));
    }
    if ($price == 0) {
        return osc_apply_filter('item_price_zero', __('Free'));
    }
    $price = $price / 1000000;
    $currencyFormat = osc_locale_currency_format();
    $currencyFormat = str_replace('{NUMBER}', number_format($price, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep()), $currencyFormat);
    $currencyFormat = str_replace('{CURRENCY}', osc_item_currency(), $currencyFormat);
    return osc_apply_filter('item_price', $currencyFormat);
}
开发者ID:randomecho,项目名称:OSClass,代码行数:20,代码来源:hItems.php

示例6: customHead

function customHead()
{
    ?>
        <script type="text/javascript">

            document.write('<style type="text/css"> .tabber{ display:none; } </style>');
            $(document).ready(function(){
                $('input[name="user"]').attr( "autocomplete", "off" );
                $('#user,#fUser').autocomplete({
                    source: "<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=userajax",
                    minLength: 0,
                    select: function( event, ui ) {
                        if(ui.item.id=='') {
                            $("#contact_info").show();
                            return false;
                        }
                        $('#userId').val(ui.item.id);
                        $('#fUserId').val(ui.item.id);
                        $("#contact_info").hide();
                    }
                });

                <?php 
    if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
        ?>
                $("#price").blur(function(event) {
                    var price = $("#price").attr("value");
                    <?php 
        if (osc_locale_thousands_sep() != '') {
            ?>
                    while(price.indexOf('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
')!=-1) {
                        price = price.replace('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
', '');
                    }
                    <?php 
        }
        ?>
                    <?php 
        if (osc_locale_dec_point() != '') {
            ?>
                    var tmp = price.split('<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
'+tmp[1];
                    }
                    <?php 
        }
        ?>
                    $("#price").attr("value", price);
                });
                <?php 
    }
    ?>
            });
        </script>
        <?php 
    ItemForm::location_javascript_new('admin');
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:78,代码来源:frm.php

示例7: osc_prepare_price

function osc_prepare_price($price)
{
    return number_format($price / 1000000, osc_locale_num_dec(), osc_locale_dec_point(), osc_locale_thousands_sep());
}
开发者ID:naneri,项目名称:Osclass,代码行数:4,代码来源:utils.php

示例8: customHead

function customHead()
{
    ?>
        <script type="text/javascript" src="<?php 
    echo osc_current_admin_theme_js_url('jquery.validate.min.js');
    ?>
"></script>
        <script type="text/javascript">
            document.write('<style type="text/css"> .tabber{ display:none; } </style>') ;
            $(document).ready(function(){
                $("#userId").bind('change', function() {
                    if($(this).val() == '') {
                        $("#contact_info").show() ;
                    } else {
                        $("#contact_info").hide() ;
                    }
                }) ;

                if( $("#userId").val() == '') {
                    $("#contact_info").show() ;
                } else {
                    $("#contact_info").hide() ;
                }

                <?php 
    if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
        ?>
                $("#price").blur(function(event) {
                    var price = $("#price").attr("value");
                    <?php 
        if (osc_locale_thousands_sep() != '') {
            ?>
                    while(price.indexOf('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
')!=-1) {
                        price = price.replace('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
', '');
                    }
                    <?php 
        }
        ?>
                    <?php 
        if (osc_locale_dec_point() != '') {
            ?>
                    var tmp = price.split('<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
'+tmp[1];
                    }
                    <?php 
        }
        ?>
                    $("#price").attr("value", price);
                });
                <?php 
    }
    ?>
            });
        </script>
        <?php 
    ItemForm::location_javascript_new('admin');
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}
开发者ID:ranjithinnergys,项目名称:OSClass,代码行数:77,代码来源:frm.php

示例9: customHead

function customHead()
{
    ?>
        <script type="text/javascript">

            document.write('<style type="text/css"> .tabber{ display:none; } </style>');
            $(document).ready(function(){
                $('input[name="user"]').attr( "autocomplete", "off" );
                $('#user,#fUser').autocomplete({
                    source: "<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=userajax",
                    minLength: 0,
                    select: function( event, ui ) {
                        if(ui.item.id=='') {
                            $("#contact_info").show();
                            return false;
                        }
                        $('#userId').val(ui.item.id);
                        $('#fUserId').val(ui.item.id);
                        $("#contact_info").hide();
                    }
                });

                $('.ui-autocomplete').css('zIndex', 10000);

                <?php 
    if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
        ?>
                $("#price").on("blur", function(event) {
                    var price = $("#price").prop("value");
                    <?php 
        if (osc_locale_thousands_sep() != '') {
            ?>
                    while(price.indexOf('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
')!=-1) {
                        price = price.replace('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
', '');
                    }
                    <?php 
        }
        ?>
                    <?php 
        if (osc_locale_dec_point() != '') {
            ?>
                    var tmp = price.split('<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
'+tmp[1];
                    }
                    <?php 
        }
        ?>
                    $("#price").prop("value", price);

                });
                <?php 
    }
    ?>

                $('#update_expiration').change( function() {
                    if($(this).attr("checked")) {
                        $('#dt_expiration').prop('value', '');
                        $('div.update_expiration').show();
                    } else {
                        $('#dt_expiration').prop('value', '-1');
                        $('div.update_expiration').hide();
                    }
                });

                $('body').on("created", '[name^="select_"]',function(evt) {
                    selectUi($(this));
                });

            });
        </script>
        <?php 
    ItemForm::location_javascript('admin');
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:96,代码来源:frm.php

示例10: fjs_search

    function fjs_search()
    {
        echo "\n";
        ?>
    <script type="text/javascript">
    var sQuery = '<?php 
        echo osc_esc_js(osc_get_preference('keyword_placeholder', 'realestate'));
        ?>
' ;
    $(document).ready(function(){
                var element = $('input[name="sPattern"]');
                element.focus(function(){
                        $(this).prev().hide();
                }).blur(function(){
                    if($(this).val() == '') {
                        $(this).prev().show();
                    }
                }).prev().click(function(){
                        $(this).hide();
                        $(this).next().focus();
                });
                if(element.val() != ''){
                    element.prev().hide();
                }
                <?php 
        if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
            ?>
                    $("#price").blur(function(event) {
                        var price = $("#price").attr("value");
                        <?php 
            if (osc_locale_thousands_sep() != '') {
                ?>
                        while(price.indexOf('<?php 
                echo osc_esc_js(osc_locale_thousands_sep());
                ?>
')!=-1) {
                            price = price.replace('<?php 
                echo osc_esc_js(osc_locale_thousands_sep());
                ?>
', '');
                        }
                        <?php 
            }
            ?>
                        <?php 
            if (osc_locale_dec_point() != '') {
                ?>
                        var tmp = price.split('<?php 
                echo osc_esc_js(osc_locale_dec_point());
                ?>
');
                        if(tmp.length>2) {
                            price = tmp[0]+'<?php 
                echo osc_esc_js(osc_locale_dec_point());
                ?>
'+tmp[1];
                        }
                        <?php 
            }
            ?>
                        $("#price").attr("value", price);
                    });
                <?php 
        }
        ?>
            });
    function doSearch() {
        var sPattern = $('input[name=sPattern]');
        var text = '<?php 
        echo osc_esc_js(__('Your search must be at least three characters long', 'realestate'));
        ?>
';
        if((sPattern.hasClass('js-input-home') && sPattern.val() == '' && sPattern.val().length < 3) || (sPattern.val() != '' && sPattern.val().length < 3)) {
            $('#message-seach').text(text).show();
            return false;
        }
        return true;
    }
    </script>
    <?php 
    }
开发者ID:blairmain,项目名称:theme-realestate,代码行数:81,代码来源:functions.php


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