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


PHP get_currencies函数代码示例

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


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

示例1: loadCurrencies

 protected function loadCurrencies()
 {
     $currencies = array_get(get_currencies(), 'iso');
     foreach ($currencies as $iso => $currency) {
         $iso = $this->prepareIso($iso);
         $currency = Currency::loadFromArray($iso, $currency);
         $this->put($iso, $currency);
     }
 }
开发者ID:arcanedev,项目名称:currency,代码行数:9,代码来源:CurrencyCollection.php

示例2: count

$QUERY = 'SELECT count(*) FROM cc_card INNER JOIN cc_card_subscription ON cc_card.id = cc_card_subscription.id_cc_card INNER JOIN cc_subscription_service ON cc_card_subscription.id_subscription_fee=cc_subscription_service.id' . ' WHERE cc_subscription_service.status=1 AND cc_card_subscription.startdate < NOW() AND (cc_card_subscription.stopdate = "0000-00-00 00:00:00" OR cc_card_subscription.stopdate > NOW())' . ' AND cc_subscription_service.startdate < NOW() AND (cc_subscription_service.stopdate = "0000-00-00 00:00:00" OR cc_subscription_service.stopdate > NOW()) AND cc_card_subscription.paid_status !=3';
$result = $instance_table->SQLExec($A2B->DBHandle, $QUERY);
$nb_card = $result[0][0];
$nbpagemax = ceil($nb_card / $groupcard);
if ($verbose_level >= 1) {
    echo "===> NB_CARD : {$nb_card} - NBPAGEMAX:{$nbpagemax}\n";
}
if (!($nb_card > 0)) {
    if ($verbose_level >= 1) {
        echo "[No card to run the Subscription service]\n";
    }
    write_log(LOGFILE_CRONT_SUBSCRIPTIONFEE, basename(__FILE__) . ' line:' . __LINE__ . "[No card to run the Subscription Feeservice]");
    exit;
}
$billdaybefor_anniversary = $A2B->config['global']['subscription_bill_days_before_anniversary'];
$currencies_list = get_currencies($A2B->DBHandle);
$service_array = array();
for ($page = 0; $page < $nbpagemax; $page++) {
    $sql = 'SELECT cc_card.id card_id ,cc_subscription_service.id service_id, cc_subscription_service.label, cc_subscription_service.fee, cc_subscription_service.emailreport,DATE(cc_card_subscription.startdate) startdate , cc_card_subscription.paid_status , cc_card_subscription.last_run, cc_card_subscription.next_billing_date , cc_card_subscription.limit_pay_date , cc_card_subscription.id card_subscription_id, cc_card_subscription.product_name product_name' . ' FROM cc_card INNER JOIN cc_card_subscription ON cc_card.id = cc_card_subscription.id_cc_card  INNER JOIN cc_subscription_service ON cc_card_subscription.id_subscription_fee=cc_subscription_service.id ' . ' WHERE cc_subscription_service.status=1 AND cc_card_subscription.startdate < NOW() AND (cc_card_subscription.stopdate = "0000-00-00 00:00:00" OR cc_card_subscription.stopdate > NOW())' . ' AND cc_subscription_service.startdate < NOW() AND (cc_subscription_service.stopdate = "0000-00-00 00:00:00" OR cc_subscription_service.stopdate > NOW()) AND cc_card_subscription.paid_status !=3' . ' ORDER BY cc_card.id';
    if ($A2B->config["database"]['dbtype'] == "postgres") {
        $sql .= " LIMIT {$groupcard} OFFSET " . $page * $groupcard;
    } else {
        $sql .= " LIMIT " . $page * $groupcard . ", {$groupcard}";
    }
    $result_subscriptions = $instance_table->SQLExec($A2B->DBHandle, $sql);
    foreach ($result_subscriptions as $subscription) {
        $service_id = $subscription['service_id'];
        if (!is_array($service_array[$service_id])) {
            $service_array[$service_id] = array("totalcardperform" => 0, "totalcredit" => 0);
        }
        $action = "";
开发者ID:ekamhara,项目名称:BootStrap-A2Billing-custom-templates,代码行数:31,代码来源:a2billing_subscription_fee.php

示例3: tep_redirect

<?php

if (!tep_session_is_registered('login_account_number') && tep_not_null($login_account_number)) {
    tep_redirect(get_href_link(PAGE_LOGIN));
}
// get currencies balance
$currencies_balance = array();
$sql_balances = "SELECT currency_code, balance FROM " . _TABLE_USER_BALANCE . " WHERE user_id='" . $login_userid . "'";
$balances_query = db_query($sql_balances);
while ($balance = db_fetch_array($balances_query)) {
    $balances_array[$balance['currency_code']] = $balance['balance'];
}
// get all currencies_list
$currencies_array = get_currencies();
foreach ($currencies_array as $currency_code => $currency_info) {
    $balance_info_array[] = array('balance_name' => $currency_info['title'], 'balance_text' => get_currency_value_format($balances_array[$currency_code], $currency_info));
}
$smarty->assign('balances', $balance_info_array);
$_html_main_content = $smarty->fetch('home/login_balance.html');
开发者ID:rongandat,项目名称:e-global-cya,代码行数:19,代码来源:login_balance.php

示例4: lang

echo lang('text_items');
?>
</span>
                            </a>
                        </div>
                        <div class="dropdown pull-right">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="javascrip:void(0);"><?php 
echo currency_title();
?>
 (<?php 
echo currency_symbol_left();
?>
)<b class="caret"></b></a>
                            <ul class="dropdown-menu" role="menu">
                            <?php 
foreach (get_currencies() as $code => $currency) {
    ?>
                                <li role="menuitem">
                                	<a href="<?php 
    echo current_url() . '?currency=' . $code;
    ?>
"><?php 
    echo $currency['title'];
    ?>
 (<?php 
    echo $currency['symbol_left'];
    ?>
)</a>
                                </li>
                            <?php 
}
开发者ID:colonia,项目名称:tomatocart-v2,代码行数:31,代码来源:index.php

示例5: __construct

 function __construct($DB_Handle, $verbose_level = 0)
 {
     $this->DB_Handle = $DB_Handle;
     $this->instance_table = new Table();
     $this->verbose_level = $verbose_level;
     $this->currencies_list = get_currencies($this->DB_Handle);
     global $A2B;
     $this->base_currency = $A2B->config['global']['base_currency'];
 }
开发者ID:sayemk,项目名称:a2billing,代码行数:9,代码来源:A2B_invoice.php

示例6: display_currencies

function display_currencies()
{
    $company_currency = get_company_currency();
    $result = get_currencies(check_value('show_inactive'));
    start_table(TABLESTYLE);
    $th = array(_("Abbreviation"), _("Symbol"), _("Currency Name"), _("Hundredths name"), _("Country"), _("Auto update"), "", "");
    inactive_control_column($th);
    table_header($th);
    $k = 0;
    //row colour counter
    while ($myrow = db_fetch($result)) {
        if ($myrow[1] == $company_currency) {
            start_row("class='currencybg'");
        } else {
            alt_table_row_color($k);
        }
        label_cell($myrow["curr_abrev"]);
        label_cell($myrow["curr_symbol"]);
        label_cell($myrow["currency"]);
        label_cell($myrow["hundreds_name"]);
        label_cell($myrow["country"]);
        label_cell($myrow[1] == $company_currency ? '-' : ($myrow["auto_update"] ? _('Yes') : _('No')), "align='center'");
        inactive_control_cell($myrow["curr_abrev"], $myrow["inactive"], 'currencies', 'curr_abrev');
        edit_button_cell("Edit" . $myrow["curr_abrev"], _("Edit"));
        if ($myrow["curr_abrev"] != $company_currency) {
            delete_button_cell("Delete" . $myrow["curr_abrev"], _("Delete"));
        } else {
            label_cell('');
        }
        end_row();
    }
    //END WHILE LIST LOOP
    inactive_control_row($th);
    end_table();
    display_note(_("The marked currency is the home currency which cannot be deleted."), 0, 0, "class='currentfg'");
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:36,代码来源:currencies.php

示例7: create_field

 /**
  * Create field.
  *
  * Creates the HTML interface for the Currency field.
  *
  * @since 1.1.0
  *
  * @param  array $field	an array holding all the field's data
  */
 public function create_field($field)
 {
     // value must be array
     if (!is_array($field['value'])) {
         // perhaps this is a default value with new lines in it?
         if (strpos($field['value'], "\n") !== false) {
             // found multiple lines, explode it
             $field['value'] = explode("\n", $field['value']);
         } else {
             $field['value'] = array($field['value']);
         }
     }
     // trim value
     $field['value'] = array_map('trim', $field['value']);
     // multiple select
     $multiple = '';
     if ($field['multiple']) {
         // create a hidden field to allow for no selections
         echo '<input type="hidden" name="' . $field['name'] . '" />';
         $multiple = ' multiple="multiple" size="5" ';
         $field['name'] .= '[]';
     }
     echo '<select id="' . $field['id'] . '" class="select" name="' . $field['name'] . '" ' . $multiple . '>';
     // null option
     if ($field['allow_null']) {
         echo '<option value="null">- ' . __("Select", 'acf') . ' -</option>';
     }
     // get currencies via WP Currencies
     $currencies = get_currencies();
     // print options
     foreach ($currencies as $currency => $data) {
         $data = (array) $data;
         $selected = in_array($currency, $field['value']) ? 'selected="selected"' : '';
         echo '<option value="' . $currency . '" ' . $selected . '>' . $currency . ' ' . $data['name'] . '</option>' . "\n";
     }
     echo '</select>';
 }
开发者ID:nekojira,项目名称:wp-currencies,代码行数:46,代码来源:acf-v4.php

示例8: EmailInvoice


//.........这里部分代码省略.........
    if ($nb_record <= $FG_LIMITE_DISPLAY) {
        $nb_record_max = 1;
    } else {
        if ($nb_record % $FG_LIMITE_DISPLAY == 0) {
            $nb_record_max = intval($nb_record / $FG_LIMITE_DISPLAY);
        } else {
            $nb_record_max = intval($nb_record / $FG_LIMITE_DISPLAY) + 1;
        }
    }
    /*************************************************************/
    if (isset($customer) && $customer > 0 || isset($entercustomer) && $entercustomer > 0) {
        $FG_TABLE_CLAUSE = "";
        if (isset($customer) && $customer > 0) {
            $FG_TABLE_CLAUSE = " username='{$customer}' ";
        } elseif (isset($entercustomer) && $entercustomer > 0) {
            $FG_TABLE_CLAUSE = " username='{$entercustomer}' ";
        }
        $instance_table_customer = new Table("cc_card", "id,  username, lastname, firstname, address, city, state, country, zipcode, phone, email, fax, activated, creationdate");
        $info_customer = $instance_table_customer->Get_list($DBHandle, $FG_TABLE_CLAUSE, "id", "ASC", null, null, null, null);
    }
    if ($invoice_type == 1) {
        $QUERY = "Select CASE WHEN max(cover_enddate) is NULL THEN '0001-01-01 01:00:00' ELSE max(cover_enddate) END from cc_invoices WHERE cardid = " . $cardid;
    } else {
        $QUERY = "Select cover_enddate,cover_startdate  from cc_invoices where id ='{$id}'";
    }
    if (!$nodisplay) {
        $invoice_dates = $instance_table->SQLExec($DBHandle, $QUERY);
        if ($invoice_dates[0][0] == '0001-01-01 01:00:00') {
            $invoice_dates[0][0] = $info_customer[0][13];
        }
    }
    require '../Public/pdf-invoices/html2pdf/html2fpdf.php';
    ob_start();
    $currencies_list = get_currencies();
    //For DID DIAL & Fixed + Dial
    $totalcost = 0;
    if (is_array($list_total_destination) && count($list_total_destination) > 0) {
        $mmax = 0;
        $totalcall = 0;
        $totalminutes = 0;
        foreach ($list_total_destination as $data) {
            if ($mmax < $data[1]) {
                $mmax = $data[1];
            }
            $totalcall += $data[3];
            $totalminutes += $data[1];
            $totalcost += $data[2];
        }
    }
    ?>
	<table cellpadding="0"  align="center">
	<tr>
	<td align="center">
	<img src="<?php 
    echo Images_Path;
    ?>
/asterisk01.jpg" align="middle">
	</td>
	</tr>
	</table>
	<br>
	<center><h4><font color="#FF0000"><?php 
    echo $invocie_top_heading;
    ?>
&nbsp;<?php 
    echo $info_customer[0][1];
开发者ID:sayemk,项目名称:a2billing,代码行数:67,代码来源:invoice.php

示例9: form_input

?>
</div>
<div class="column span-8">
	<?php 
echo form_input('sum_value', set_value('sum_value', $ds->sum_value), 'id="sum_value" class="text" readonly="readonly" style="width: 50px;"');
?>
</div>

<div class="column span-4">
	<?php 
echo form_label(lang('CURENCY'), '_currencies_rid');
?>
</div>
<div class="column span-8 last">
	<?php 
echo form_dropdown('_currencies_rid', get_currencies(), set_value('_currencies_rid', $ds->_currencies_rid), 'id="_currencies_rid" readonly="readonly" class="text" ');
?>
</div>

<div class="column span-4">
	<?php 
echo form_label(lang('STATE'), '_account_states_rid');
?>
</div>
<div class="column span-8">
	<?php 
echo form_dropdown('_account_states_rid', get_states_list(), set_value('_account_states_ridd', $ds->_account_states_rid), 'id="_account_states_rid" readonly="readonly" class="text" ');
?>
</div>
<div class="column span-4">
	<?php 
开发者ID:vsanth,项目名称:travelcrm,代码行数:31,代码来源:details.php

示例10: render_field

 /**
  * Create the HTML interface for Currency field.
  *
  * @since 1.1.3
  *
  * @param array $field The $field being edited.
  */
 function render_field($field)
 {
     if (!is_array($field['value'])) {
         if ($field['value'] && is_string($field['value'])) {
             $field['value'] = explode(',', $field['value']);
         } elseif (!empty($field['value'])) {
             $field['value'] = array($field['value']);
         }
     }
     if (empty($field['value'])) {
         // add empty value (allows '' to be selected)
         $field['value'][''] = '';
     }
     // vars
     $atts = array('id' => $field['id'], 'class' => $field['class'], 'name' => $field['name'], 'data-multiple' => $field['multiple'], 'data-allow_null' => $field['allow_null']);
     // hidden input
     if ($field['multiple']) {
         acf_hidden_input(array('type' => 'hidden', 'name' => $field['name']));
     }
     // multiple
     if ($field['multiple']) {
         $atts['multiple'] = 'multiple';
         $atts['size'] = 5;
         $atts['name'] .= '[]';
     }
     // special atts
     foreach (array('readonly', 'disabled') as $k) {
         if (!empty($field[$k])) {
             $atts[$k] = $k;
         }
     }
     // html
     echo '<select ' . acf_esc_attr($atts) . '>';
     // null option
     if ($field['allow_null']) {
         echo '<option value="null">- ' . __("Select", 'acf') . ' -</option>';
     }
     // get currencies via WP Currencies
     $currencies = get_currencies();
     // print options
     foreach ($currencies as $currency => $data) {
         $data = (array) $data;
         $selected = in_array($currency, $field['value']) ? 'selected="selected"' : '';
         echo '<option value="' . $currency . '" ' . $selected . '>' . $currency . ' ' . $data['name'] . '</option>' . "\n";
     }
     echo '</select>';
 }
开发者ID:nekojira,项目名称:wp-currencies,代码行数:54,代码来源:acf-v5.php

示例11: currency_exists

/**
 * Check if a currency code is valid.
 *
 * Helper function to check whether a currency exists in database by its code.
 *
 * @since   1.2.0
 *
 * @param  string $currency_code A three-letter ISO currency code.
 * @return bool|null True if the currency exists, false if it is unrecognized. Null on error.
 */
function currency_exists($currency_code)
{
    $currencies = get_currencies();
    $codes = '';
    if ($currencies && is_array($currencies)) {
        foreach ($currencies as $key => $value) {
            $codes[] = $key;
        }
    }
    return $codes && is_array($codes) ? in_array(strtoupper($currency_code), (array) $codes) : null;
}
开发者ID:nekojira,项目名称:wp-currencies,代码行数:21,代码来源:functions.php

示例12: get_currencies

 /**
  * Get currency data API callback function.
  *
  * @since 1.4.0
  *
  * @return array Currencies data
  */
 public function get_currencies()
 {
     return get_currencies();
 }
开发者ID:nekojira,项目名称:wp-currencies,代码行数:11,代码来源:wp-api.php

示例13: __construct

 function __construct($type, $id_card = null, $lg = null, $msg = null, $title = null)
 {
     $DBHandle = Connection::GetDBHandler();
     if (!empty($type)) {
         $tmpl_table = new Table("cc_templatemail", "*");
         $tmpl_clause = " mailtype = '{$type}'";
         $order = null;
         $order_field = null;
         if (!empty($lg)) {
             $tmpl_clause .= " AND ( id_language = '{$lg}' OR  id_language = 'en' )";
             $order_field = 'id_language';
             if (strcasecmp($lg, 'en') < 0) {
                 $order = 'ASC';
             } else {
                 $order = 'DESC';
             }
         } elseif (!is_null($id_card) && is_numeric($id_card)) {
             $card_table = new Table("cc_card", "*, IF((typepaid=1) AND (creditlimit IS NOT NULL), credit + creditlimit, credit) AS real_credit");
             $card_clause = " id = " . $id_card;
             $result_card = $card_table->Get_list($DBHandle, $card_clause, 0);
             if (is_array($result_card) && sizeof($result_card) > 0) {
                 $card = $result_card[0];
             }
             $language = $card['language'];
             if (!empty($language)) {
                 $tmpl_clause .= " AND ( id_language = '{$language}' OR  id_language = 'en' )";
                 $order_field = 'id_language';
                 if (strcasecmp($language, 'en') < 0) {
                     $order = 'ASC';
                 } else {
                     $order = 'DESC';
                 }
             }
         }
         $result_tmpl = $tmpl_table->Get_list($DBHandle, $tmpl_clause, $order_field, $order);
         if (is_array($result_tmpl) && sizeof($result_tmpl) > 0) {
             $mail_tmpl = $result_tmpl[0];
             $this->message = $mail_tmpl['messagetext'];
             $this->title = $mail_tmpl['subject'];
             $this->from_email = $mail_tmpl['fromemail'];
             $this->from_name = $mail_tmpl['fromname'];
         } else {
             throw new A2bMailException("Template Type '{$type}' cannot be found into the database!");
         }
     } elseif (!empty($msg) || !empty($title)) {
         $this->message = $msg;
         $this->title = $title;
     } else {
         throw new A2bMailException("Error : no Type defined and neither message or subject is provided!");
     }
     if (!empty($this->message) || !empty($this->title)) {
         if (!is_null($id_card) && is_numeric($id_card)) {
             $this->id_card = $id_card;
             if (is_null($card)) {
                 $card_table = new Table("cc_card", "*, IF((typepaid=1) AND (creditlimit IS NOT NULL), credit + creditlimit, credit) AS real_credit");
                 $card_clause = " id = " . $id_card;
                 $result_card = $card_table->Get_list($DBHandle, $card_clause, 0);
                 if (is_array($result_card) && sizeof($result_card) > 0) {
                     $card = $result_card[0];
                 }
             }
             $credit = $card['real_credit'];
             $credit = round($credit, 3);
             $currency = $card['currency'];
             $currencies_list = get_currencies($DBHandle);
             if (!isset($currencies_list[strtoupper($currency)][2]) || !is_numeric($currencies_list[strtoupper($currency)][2])) {
                 $mycur = 1;
             } else {
                 $mycur = $currencies_list[strtoupper($currency)][2];
             }
             $credit_currency = $credit / $mycur;
             $credit_currency = round($credit_currency, 3);
             $this->to_email = $card['email'];
             $this->replaceInEmail(self::$CUSTOMER_CARDNUMBER_KEY, $card['username']);
             $this->replaceInEmail(self::$CUSTOMER_EMAIL_KEY, $card['email']);
             $this->replaceInEmail(self::$CUSTOMER_FIRSTNAME_KEY, $card['firstname']);
             $this->replaceInEmail(self::$CUSTOMER_LASTNAME_KEY, $card['lastname']);
             $this->replaceInEmail(self::$CUSTOMER_LOGIN, $card['useralias']);
             $this->replaceInEmail(self::$CUSTOMER_LOGINKEY, $card['loginkey']);
             $this->replaceInEmail(self::$CUSTOMER_PASSWORD_KEY, $card['uipass']);
             $this->replaceInEmail(self::$CUSTOMER_CREDIT_IN_OWN_CURRENCY_KEY, $credit_currency);
             $this->replaceInEmail(self::$CUSTOMER_CREDIT_BASE_CURRENCY_KEY, $credit);
             $this->replaceInEmail(self::$CUSTOMER_CURRENCY, $currency);
             $this->replaceInEmail(self::$CUSTOMER_CREDIT_NOTIFICATION, $card['credit_notification']);
         }
         $this->replaceInEmail(self::$SYSTEM_CURRENCY, BASE_CURRENCY);
     }
 }
开发者ID:hellbound,项目名称:a2billing-mod,代码行数:88,代码来源:Class.Mail.php

示例14: getOneFromConfig

 /**
  * @param string $key
  *
  * @return array
  */
 protected function getOneFromConfig($key)
 {
     $key = strtolower($key);
     return array_get(get_currencies(), 'iso.' . $key, null);
 }
开发者ID:arcanedev,项目名称:currency,代码行数:10,代码来源:Currency.php

示例15: display_2bill

function display_2bill($var, $currency = BASE_CURRENCY)
{
    global $currencies_list, $choose_currency;
    if (isset($choose_currency) && strlen($choose_currency) == 3) {
        $currency = $choose_currency;
    }
    if (!isset($currencies_list) || !is_array($currencies_list)) {
        $currencies_list = get_currencies();
    }
    $var = $var / $currencies_list[strtoupper($currency)][2];
    echo number_format($var, 3) . ' ' . strtoupper($currency);
}
开发者ID:saydulk,项目名称:a2billing,代码行数:12,代码来源:Misc.php


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