本文整理汇总了PHP中dollar_format函数的典型用法代码示例。如果您正苦于以下问题:PHP dollar_format函数的具体用法?PHP dollar_format怎么用?PHP dollar_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dollar_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
</tr>
<?php
}
?>
<?php
$rows = count($breakdown_result);
$html['clicks'] = BTHtml::encode($stats_total['clicks']);
$html['leads'] = BTHtml::encode($stats_total['leads']);
$html['conv'] = BTHtml::encode(calculate_conv($stats_total['clicks'], $stats_total['leads']) . '%');
$html['payout'] = BTHtml::encode(dollar_format(calculate_payout($stats_total['leads'], $stats_total['income'])));
$html['epc'] = BTHtml::encode(dollar_format(calculate_epc($stats_total['clicks'], $stats_total['income'])));
$html['cpc'] = BTHtml::encode(dollar_format(calculate_cpc($stats_total['clicks'], $stats_total['cost'])));
$html['income'] = BTHtml::encode(dollar_format($stats_total['income']));
$html['cost'] = BTHtml::encode(dollar_format($stats_total['cost']));
$html['net'] = BTHtml::encode(dollar_format(calculate_net($stats_total['income'], $stats_total['cost'])));
$html['roi'] = BTHtml::encode(calculate_roi($stats_total['income'], $stats_total['cost']) . '%');
?>
</tbody>
<?php
$stat_html = ob_get_contents();
ob_end_clean();
?>
<tfoot>
<tr>
<td><strong>Totals for report</strong></td>
<td><strong><?php
示例2: mysql_real_escape_string
$mysql['user_id'] = mysql_real_escape_string($_SESSION['user_id']);
$user_sql = "SELECT user_pref_breakdown, user_pref_show, user_cpc_or_cpv FROM 202_users_pref WHERE user_id=" . $mysql['user_id'];
$user_result = _mysql_query($user_sql, $dbGlobalLink);
//($user_sql);
$user_row = mysql_fetch_assoc($user_result);
$breakdown = $user_row['user_pref_breakdown'];
if ($user_row['user_cpc_or_cpv'] == 'cpv') {
$cpv = true;
} else {
$cpv = false;
}
//keywords already set in the table, just just download them
if (empty($mysql['order'])) {
$mysql['order'] = ' ORDER BY sort_referer_clicks DESC';
}
$db_table = '202_sort_referers';
$query = query('SELECT * FROM 202_sort_referers LEFT JOIN 202_site_domains ON (202_sort_referers.referer_id=202_site_domains.site_domain_id)', $db_table, false, false, false, $mysql['order'], false, false, true);
$keyword_sql = $query['click_sql'];
$keyword_result = mysql_query($keyword_sql) or record_mysql_error($keyword_sql);
header("Content-type: application/octet-stream");
# replace excelfile.xls with whatever you want the filename to default to
header("Content-Disposition: attachment; filename=T202_referers_" . time() . ".xls");
header("Pragma: no-cache");
header("Expires: 0");
echo "Refering Domain" . "\t" . "Clicks" . "\t" . "Leads" . "\t" . "S/U" . "\t" . "Payout" . "\t" . "EPC" . "\t" . "Avg CPC" . "\t" . "Income" . "\t" . "Cost" . "\t" . "Net" . "\t" . "ROI" . "\n";
while ($keyword_row = mysql_fetch_array($keyword_result, MYSQL_ASSOC)) {
if (!$keyword_row['site_domain_host']) {
$keyword_row['site_domain_host'] = '[no referer]';
}
echo $keyword_row['site_domain_host'] . "\t" . $keyword_row['sort_referer_clicks'] . "\t" . $keyword_row['sort_referer_leads'] . "\t" . $keyword_row['sort_referer_su_ratio'] . '%' . "\t" . dollar_format($keyword_row['sort_referer_payout']) . "\t" . dollar_format($keyword_row['sort_referer_epc']) . "\t" . dollar_format($keyword_row['sort_referer_avg_cpc'], $cpv) . "\t" . dollar_format($keyword_row['sort_referer_income']) . "\t" . dollar_format($keyword_row['sort_referer_cost'], $cpv) . "\t" . dollar_format($keyword_row['sort_referer_net'], $cpv) . "\t" . $keyword_row['sort_referer_roi'] . '%' . "\n";
}
示例3: dollar_format
$ctr_ratio = @round($click_throughs / $clicks * 100, 2);
//cost
$cost = 0;
$cost = $click_row['cost'];
//avg cpc and cost
$avg_cpc = 0;
$avg_cpc = $click_row['avg_cpc'];
//leads
$leads = 0;
$leads = $click_row['leads'];
//signup ratio
$su_ratio - 0;
$su_ratio = @round($leads / $clicks * 100, 2);
//current payout
$payout = 0;
$payout = $click_row['payout'];
//income
$income = 0;
$income = $click_row['income'];
//grab the EPC
$epc = 0;
$epc = @round($income / $clicks, 2);
//net income
$net = 0;
$net = $income - $cost;
//roi
$roi = 0;
$roi = @round($net / $cost * 100);
echo $html['browser_name'] . "\t" . $clicks . "\t" . $click_throughs . "\t" . $ctr_ratio . "\t" . $leads . "\t" . $su_ratio . '%' . "\t" . dollar_format($payout) . "\t" . dollar_format($epc) . "\t" . dollar_format($avg_cpc, $cpv) . "\t" . dollar_format($income) . "\t" . dollar_format($cost, $cpv) . "\t" . dollar_format($net, $cpv) . "\t" . $roi . '%' . "\n";
}
}
示例4: dollar_format
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="txtMaxPrice" class="control-label">Max. Price</label>
<select name="txtMaxPrice" id="txtMaxPrice" class="form-control">
<option value="">Any Maximum Price</option>
<?php
$min = 2500;
$max = 200000;
for ($i = $max; $i >= $min; $i -= 500) {
?>
<option value="<?php
echo dollar_format($i);
?>
"><?php
echo dollar_format($i);
?>
</option>
<?php
}
?>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
示例5: htmlentities
$html['ip'] = htmlentities($ip_row['ip_address'], ENT_QUOTES, 'UTF-8');
//shorten ip
if (strlen($html['ip']) > 25) {
$html['ip'] = substr($html['ip'], 0, 25) . '...';
}
}
error_reporting(0);
$html['sort_ip_clicks'] = htmlentities($ip_row['sort_ip_clicks'], ENT_QUOTES, 'UTF-8');
$html['sort_ip_leads'] = htmlentities($ip_row['sort_ip_leads'], ENT_QUOTES, 'UTF-8');
$html['sort_ip_su_ratio'] = htmlentities($ip_row['sort_ip_su_ratio'] . '%', ENT_QUOTES, 'UTF-8');
$html['sort_ip_payout'] = htmlentities(dollar_format($ip_row['sort_ip_payout']), ENT_QUOTES, 'UTF-8');
$html['sort_ip_epc'] = htmlentities(dollar_format($ip_row['sort_ip_epc']), ENT_QUOTES, 'UTF-8');
$html['sort_ip_avg_cpc'] = htmlentities(dollar_format($ip_row['sort_ip_avg_cpc'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_ip_income'] = htmlentities(dollar_format($ip_row['sort_ip_income']), ENT_QUOTES, 'UTF-8');
$html['sort_ip_cost'] = htmlentities(dollar_format($ip_row['sort_ip_cost'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_ip_net'] = htmlentities(dollar_format($ip_row['sort_ip_net'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_ip_roi'] = htmlentities($ip_row['sort_ip_roi'] . '%', ENT_QUOTES, 'UTF-8');
error_reporting(6135);
?>
<tr>
<td class="m-row2 m-row2-fade" ><?php
printf('<a target="_new" href="http://ws.arin.net/whois/?queryinput=%s">ARIN</a> / <a target="_new" href="http://www.db.ripe.net/whois?searchtext=%s">RIPE</a>', $html['ip'], $html['ip']);
?>
:: <?php
echo $html['ip'];
?>
</td>
<td class="m-row1"><?php
echo $html['sort_ip_clicks'];
示例6: error_reporting
<?php
}
?>
<?php
error_reporting(0);
$rows = mysql_num_rows($breakdown_result);
$html['clicks'] = htmlentities($stats_total['clicks'], ENT_QUOTES, 'UTF-8');
$html['leads'] = htmlentities($stats_total['leads'], ENT_QUOTES, 'UTF-8');
$html['su_ratio'] = htmlentities(round($stats_total['leads'] / $stats_total['clicks'] * 100, 2) . '%', ENT_QUOTES, 'UTF-8');
$html['payout'] = htmlentities(dollar_format($stats_total['payout'] / $rows), ENT_QUOTES, 'UTF-8');
$html['epc'] = htmlentities(dollar_format($stats_total['income'] / $stats_total['clicks']), ENT_QUOTES, 'UTF-8');
$html['cpc'] = htmlentities(dollar_format($stats_total['cost'] / $stats_total['clicks'], $cpv), ENT_QUOTES, 'UTF-8');
$html['income'] = htmlentities(dollar_format($stats_total['income']), ENT_QUOTES, 'UTF-8');
$html['cost'] = htmlentities(dollar_format($stats_total['cost'], $cpv), ENT_QUOTES, 'UTF-8');
$html['net'] = htmlentities(dollar_format($stats_total['income'] - $stats_total['cost'], $cpv), ENT_QUOTES, 'UTF-8');
$html['roi'] = htmlentities(round(($stats_total['income'] - $stats_total['cost']) / $stats_total['cost'] * 100) . '%', ENT_QUOTES, 'UTF-8');
error_reporting(6135);
?>
<tr>
<td class="m-row2 m-row-bottom"><strong>Totals for report</strong></td>
<td class="m-row1 m-row-bottom"><strong><?php
echo $html['clicks'];
?>
</strong></td>
<td class="m-row1 m-row-bottom"><strong><?php
echo $html['leads'];
?>
</strong></td>
<td class="m-row1 m-row-bottom"><strong><?php
示例7: displayValue
public static function displayValue($value = null, $wrap_class = null) {
return dollar_format($value, $wrap_class);
}
示例8: htmlentities
$html['text_ad'] = htmlentities($text_ad_row['text_ad_name'], ENT_QUOTES, 'UTF-8');
//shorten text_ad
/*if (strlen($html['text_ad']) > 25) {
$html['text_ad'] = substr($html['text_ad'],0,25) . '...';
}*/
}
error_reporting(0);
$html['sort_text_ad_clicks'] = htmlentities($text_ad_row['sort_text_ad_clicks'], ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_leads'] = htmlentities($text_ad_row['sort_text_ad_leads'], ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_su_ratio'] = htmlentities($text_ad_row['sort_text_ad_su_ratio'] . '%', ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_payout'] = htmlentities(dollar_format($text_ad_row['sort_text_ad_payout']), ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_epc'] = htmlentities(dollar_format($text_ad_row['sort_text_ad_epc']), ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_avg_cpc'] = htmlentities(dollar_format($text_ad_row['sort_text_ad_avg_cpc'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_income'] = htmlentities(dollar_format($text_ad_row['sort_text_ad_income']), ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_cost'] = htmlentities(dollar_format($text_ad_row['sort_text_ad_cost'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_net'] = htmlentities(dollar_format($text_ad_row['sort_text_ad_net'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_text_ad_roi'] = htmlentities($text_ad_row['sort_text_ad_roi'] . '%', ENT_QUOTES, 'UTF-8');
error_reporting(6135);
?>
<tr>
<td class="m-row2 m-row2-fade" ><?php
echo $html['text_ad'];
?>
</td>
<td class="m-row1"><?php
echo $html['sort_text_ad_clicks'];
?>
</td>
<td class="m-row1"><?php
示例9: reportQuery
//.........这里部分代码省略.........
}
//If referers report type
if ($type == "referers") {
$click_sql .= "AND 2l." . $select_id . "='" . $report_row[$select_id] . "'";
//If landing pages report type
} elseif ($type == "landing_pages") {
$click_sql .= "AND 2c." . $select_id . "='" . $report_row[$select_id] . "'\n\t\t\t\t\t \t\t\t\t GROUP BY 2c." . $select_id;
} else {
$click_sql .= "AND 2ca." . $select_id . "='" . $report_row[$select_id] . "'";
}
$click_result = $db->query($click_sql);
$click_row = $click_result->fetch_assoc();
$country_code = '';
//get the stats
$clicks = 0;
$clicks = $click_row['clicks'];
$total_clicks = $total_clicks + $clicks;
$click_throughs = 0;
$click_throughs = $click_row['click_throughs'];
$total_click_throughs = $total_click_throughs + $click_throughs;
//ctr rate
$ctr_ratio = 0;
$ctr_ratio = @round($click_throughs / $clicks * 100, 2);
$total_ctr_ratio = @round($total_click_throughs / $total_clicks * 100, 2);
//avg cpc and cost
$avg_cpc = 0;
$avg_cpc = $click_row['avg_cpc'];
$cost = 0;
$cost = $clicks * $avg_cpc;
$total_cost = $total_cost + $cost;
$total_avg_cpc = @round($total_cost / $total_clicks, 5);
//leads
$leads = 0;
$leads = $click_row['leads'];
$total_leads = $total_leads + $leads;
//signup ratio
$su_ratio - 0;
$su_ratio = @round($leads / $clicks * 100, 2);
$total_su_ratio = @round($total_leads / $total_clicks * 100, 2);
//current payout
$payout = 0;
$payout = $report_row['click_payout'];
$total_payout = $total_payout + $payout;
//income
$income = 0;
$income = $click_row['income'];
$total_income = $total_income + $income;
//grab the EPC
$epc = 0;
$epc = @round($income / $clicks, 2);
$total_epc = @@round($total_income / $total_clicks, 2);
//net income
$net = 0;
$net = $income - $cost;
$total_net = $total_income - $total_cost;
//roi
$roi = 0;
$roi = @round($net / $cost * 100);
$total_roi = @round($total_net / $total_cost);
if ($name == "keyword") {
if (!$report_row['keyword']) {
$report_row[$name] = "[no keyword]";
}
}
if ($name == "text_ad_name") {
if (!$report_row['text_ad_name']) {
$report_row[$name] = "[no text ad]";
}
}
if ($name == "referer") {
if (!$report_row['site_domain_host']) {
$report_row[$name] = "[no referer]";
} else {
$report_row[$name] = $report_row['site_domain_host'];
}
}
if ($type == "locations_country") {
$type = "countries";
}
if ($type == "locations_city") {
$type = "cities";
}
if ($type == "locations_isp") {
$type = "carriers";
}
if ($type == "landing_pages") {
if (!$report_row['landing_page_nickname']) {
$report_row[$name] = "[direct link]";
} else {
$report_row[$name] = $report_row['landing_page_nickname'];
}
}
$data[] = array($name => $report_row[$name], "clicks" => $clicks, "click_throughs" => $click_throughs, "lp_ctr" => $ctr_ratio . "%", "leads" => $leads, "su_ratio" => $su_ratio . "%", "payout" => dollar_format($payout), "epc" => dollar_format($epc), "avg_cpc" => "\$" . $avg_cpc, "income" => dollar_format($income), "cost" => dollar_format($cost), "net" => dollar_format($net), "roi" => $roi . "%");
}
$totals = array("clicks" => $total_clicks, "click_throughs" => $total_click_throughs, "lp_ctr" => $total_ctr_ratio . "%", "leads" => $total_leads, "su_ratio" => $total_su_ratio . "%", "payout" => dollar_format($total_payout / $rows), "epc" => dollar_format($total_epc), "avg_cpc" => dollar_format($total_avg_cpc), "income" => dollar_format($total_income), "cost" => dollar_format($total_cost), "net" => dollar_format($total_net), "roi" => $total_roi . "%");
} else {
$totals = array();
}
return array("date_range" => $date, $type => $data, "totals" => $totals);
}
示例10: displayValue
/** See docs for dollar_format for $opts */
public static function displayValue($value = null, $opts = null)
{
return dollar_format($value, $opts);
}
示例11: mysql_real_escape_string
$mysql['user_id'] = mysql_real_escape_string($_SESSION['user_id']);
$user_sql = "SELECT user_pref_breakdown, user_pref_show, user_cpc_or_cpv FROM 202_users_pref WHERE user_id=" . $mysql['user_id'];
$user_result = _mysql_query($user_sql, $dbGlobalLink);
//($user_sql);
$user_row = mysql_fetch_assoc($user_result);
$breakdown = $user_row['user_pref_breakdown'];
if ($user_row['user_cpc_or_cpv'] == 'cpv') {
$cpv = true;
} else {
$cpv = false;
}
//ips already set in the table, just just download them
if (empty($mysql['order'])) {
$mysql['order'] = ' ORDER BY sort_ip_clicks DESC';
}
$db_table = '202_sort_ips';
$query = query('SELECT * FROM 202_sort_ips LEFT JOIN 202_ips USING (ip_id)', $db_table, false, false, false, $mysql['order'], false, false, true);
$ip_sql = $query['click_sql'];
$ip_result = mysql_query($ip_sql) or record_mysql_error($ip_sql);
header("Content-type: application/octet-stream");
# replace excelfile.xls with whatever you want the filename to default to
header("Content-Disposition: attachment; filename=XT_ips_" . time() . ".xls");
header("Pragma: no-cache");
header("Expires: 0");
echo "ip" . "\t" . "Clicks" . "\t" . "Leads" . "\t" . "S/U" . "\t" . "Payout" . "\t" . "EPC" . "\t" . "Avg CPC" . "\t" . "Income" . "\t" . "Cost" . "\t" . "Net" . "\t" . "ROI" . "\n";
while ($ip_row = mysql_fetch_array($ip_result, MYSQL_ASSOC)) {
if (!$ip_row['ip_address']) {
$ip_row['ip_address'] = '[no ip]';
}
echo $ip_row['ip_address'] . "\t" . $ip_row['sort_ip_clicks'] . "\t" . $ip_row['sort_ip_leads'] . "\t" . $ip_row['sort_ip_su_ratio'] . '%' . "\t" . dollar_format($ip_row['sort_ip_payout']) . "\t" . dollar_format($ip_row['sort_ip_epc']) . "\t" . dollar_format($ip_row['sort_ip_avg_cpc'], $cpv) . "\t" . dollar_format($ip_row['sort_ip_income']) . "\t" . dollar_format($ip_row['sort_ip_cost'], $cpv) . "\t" . dollar_format($ip_row['sort_ip_net'], $cpv) . "\t" . $ip_row['sort_ip_roi'] . '%' . "\n";
}
示例12: formatColumnValue
function formatColumnValue($col, $value)
{
switch ($col) {
case 'click_through_rates':
case 'conv':
case 'roi':
$value = number_format($value, 2, '.', '') . '%';
break;
case 'payout':
case 'income':
case 'net':
case 'epc':
case 'cpc':
case 'avg_cpc':
case 'cost':
$value = dollar_format($value);
}
return $value;
}
示例13: d_f
/** Displays a number as dollar format - or if array arg, totals the numeric
* values of the array and retuns them as a $ formatted string
* @param numeric|numeric array $num - the value or array of values to represent
* @param int|string|array $opts:
* if int - precision $prec.
* If string - $wrap_class: enclose results in div w. class; negative in "$wrap_class negative-dollar-value"
* If boolean true - $wrap_class: enclose results in div w. class 'dollar-format'; negative in "$wrap_class negative-value"
* If array, look for those keys, & 'hide0' as well, for multiple options
* @return string - dollar formatted
*/
function d_f($num, $opts = 0, $hide0 = false) {
return dollar_format($num, $opts, $hide0);
}
示例14: htmlentities
$html['keyword'] = htmlentities($keyword_row['keyword'], ENT_QUOTES, 'UTF-8');
//shorten keyword
/*if (strlen($html['keyword']) > 25) {
$html['keyword'] = substr($html['keyword'],0,25) . '...';
}*/
}
error_reporting(0);
$html['sort_keyword_clicks'] = htmlentities($keyword_row['sort_keyword_clicks'], ENT_QUOTES, 'UTF-8');
$html['sort_keyword_leads'] = htmlentities($keyword_row['sort_keyword_leads'], ENT_QUOTES, 'UTF-8');
$html['sort_keyword_su_ratio'] = htmlentities($keyword_row['sort_keyword_su_ratio'] . '%', ENT_QUOTES, 'UTF-8');
$html['sort_keyword_payout'] = htmlentities(dollar_format($keyword_row['sort_keyword_payout']), ENT_QUOTES, 'UTF-8');
$html['sort_keyword_epc'] = htmlentities(dollar_format($keyword_row['sort_keyword_epc']), ENT_QUOTES, 'UTF-8');
$html['sort_keyword_avg_cpc'] = htmlentities(dollar_format($keyword_row['sort_keyword_avg_cpc'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_keyword_income'] = htmlentities(dollar_format($keyword_row['sort_keyword_income']), ENT_QUOTES, 'UTF-8');
$html['sort_keyword_cost'] = htmlentities(dollar_format($keyword_row['sort_keyword_cost'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_keyword_net'] = htmlentities(dollar_format($keyword_row['sort_keyword_net'], $cpv), ENT_QUOTES, 'UTF-8');
$html['sort_keyword_roi'] = htmlentities($keyword_row['sort_keyword_roi'] . '%', ENT_QUOTES, 'UTF-8');
error_reporting(6135);
?>
<tr>
<td class="m-row2 m-row2-fade" ><?php
echo $html['keyword'];
?>
</td>
<td class="m-row1"><?php
echo $html['sort_keyword_clicks'];
?>
</td>
<td class="m-row1"><?php
示例15: dollar_format
$ctr_ratio = @round($click_throughs / $clicks * 100, 2);
//cost
$cost = 0;
$cost = $click_row['cost'];
//avg cpc and cost
$avg_cpc = 0;
$avg_cpc = $click_row['avg_cpc'];
//leads
$leads = 0;
$leads = $click_row['leads'];
//signup ratio
$su_ratio - 0;
$su_ratio = @round($leads / $clicks * 100, 2);
//current payout
$payout = 0;
$payout = $click_row['payout'];
//income
$income = 0;
$income = $click_row['income'];
//grab the EPC
$epc = 0;
$epc = @round($income / $clicks, 2);
//net income
$net = 0;
$net = $income - $cost;
//roi
$roi = 0;
$roi = @round($net / $cost * 100);
echo $click_row['city_name'] . "\t" . $click_row['country_code'] . "\t" . $clicks . "\t" . $click_throughs . "\t" . $ctr_ratio . "\t" . $leads . "\t" . $su_ratio . '%' . "\t" . dollar_format($payout) . "\t" . dollar_format($epc) . "\t" . dollar_format($avg_cpc, $cpv) . "\t" . dollar_format($income) . "\t" . dollar_format($cost, $cpv) . "\t" . dollar_format($net, $cpv) . "\t" . $roi . '%' . "\n";
}
}