本文整理汇总了PHP中getCurrency函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrency函数的具体用法?PHP getCurrency怎么用?PHP getCurrency使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrency函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: payeer_link
function payeer_link($params)
{
global $_LANG;
if (isset($params['convertto'])) {
$params['curr'] = getCurrency(0, $params['convertto']);
}
$m_url = $params['payeer_url'];
$m_shop = $params['payeer_shop'];
$m_orderid = $params['invoiceid'];
$m_amount = $params['amount'];
$m_curr = $params['curr']['code'];
$m_desc = base64_encode($params['payeer_comment']);
$m_key = $params['payeer_secret_key'];
$arHash = array($m_shop, $m_orderid, $m_amount, $m_curr, $m_desc, $m_key);
$sign = strtoupper(hash('sha256', implode(':', $arHash)));
$code = '
<form id = "form_payment_payeer" method="GET" action="' . $m_url . '">
<input type="hidden" name="m_shop" value="' . $m_shop . '">
<input type="hidden" name="m_orderid" value="' . $m_orderid . '">
<input type="hidden" name="m_amount" value="' . $m_amount . '">
<input type="hidden" name="m_curr" value="' . $m_curr . '">
<input type="hidden" name="m_desc" value="' . $m_desc . '">
<input type="hidden" name="m_sign" value="' . $sign . '">
<input type="submit" name="m_process" value="' . $_LANG['invoicespaynow'] . '" />
</form>
';
return $code;
}
示例2: widget_open_invoices
function widget_open_invoices($vars)
{
global $_ADMINLANG, $currency;
$title = $_ADMINLANG['home']['openinvoices'];
if (!function_exists("getGatewaysArray")) {
require ROOTDIR . "/includes/gatewayfunctions.php";
}
$gatewaysarray = getGatewaysArray();
$content = '<table class="table table-condensed">
<tr style="background-color:#efefef;font-weight:bold;text-align:center"><td>' . $_ADMINLANG['fields']['invoicenum'] . '</td><td>' . $_ADMINLANG['fields']['clientname'] . '</td><td>' . $_ADMINLANG['fields']['invoicedate'] . '</td><td>' . $_ADMINLANG['fields']['duedate'] . '</td><td>' . $_ADMINLANG['fields']['totaldue'] . '</td><td>' . $_ADMINLANG['fields']['paymentmethod'] . '</td><td width="20"></td></tr>
';
$id = '';
$query = "SELECT tblinvoices.*,tblinvoices.total-COALESCE((SELECT SUM(amountin) FROM tblaccounts WHERE tblaccounts.invoiceid=tblinvoices.id),0) AS invoicebalance,tblclients.firstname,tblclients.lastname FROM tblinvoices INNER JOIN tblclients ON tblclients.id=tblinvoices.userid WHERE tblinvoices.status='Unpaid' ORDER BY duedate,date ASC LIMIT 0,5";
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$id = $data["id"];
$invoicenum = $data["invoicenum"];
$userid = $data["userid"];
$firstname = $data["firstname"];
$lastname = $data["lastname"];
$date = $data["date"];
$duedate = $data["duedate"];
$total = $data["total"];
$invoicebalance = $data["invoicebalance"];
$paymentmethod = $data["paymentmethod"];
$paymentmethod = $gatewaysarray[$paymentmethod];
$date = fromMySQLDate($date);
$duedate = fromMySQLDate($duedate);
$currency = getCurrency($userid);
if (!$invoicenum) {
$invoicenum = $id;
}
$content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="invoices.php?action=edit&id=' . $id . '">' . $invoicenum . '</a></td><td>' . $firstname . ' ' . $lastname . '</td><td>' . $date . '</td><td>' . $duedate . '</td><td>' . formatCurrency($total) . '</td><td>' . $paymentmethod . '</td><td><a href="invoices.php?action=edit&id=' . $id . '"><img src="images/edit.gif" border="0" /></a></td></tr>';
}
if (!$id) {
$content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">' . $_ADMINLANG['global']['norecordsfound'] . '</td></tr>';
}
$content .= '</table>
<div class="widget-footer">
<a href="invoices.php?status=Unpaid" class="btn btn-info btn-sm">' . $_ADMINLANG['home']['viewall'] . ' »</a>
</div>';
return array('title' => $title, 'content' => $content);
}
示例3: chartdata_income
function chartdata_income()
{
global $currency;
$currency = getCurrency();
$chartdata = array();
$chartdata['cols'][] = array('label' => 'Day', 'type' => 'string');
$chartdata['cols'][] = array('label' => 'Income', 'type' => 'number');
$chartdata['cols'][] = array('label' => 'Expenditure/Refunds', 'type' => 'number');
for ($i = 14; $i >= 0; $i--) {
$date = mktime(0, 0, 0, date("m"), date("d") - $i, date("Y"));
$data = get_query_vals("tblaccounts", "SUM(amountin/rate),SUM(amountout/rate)", "date LIKE '" . date("Y-m-d", $date) . "%'");
if (!$data[0]) {
$data[0] = 0;
}
if (!$data[1]) {
$data[1] = 0;
}
$chartdata['rows'][] = array('c' => array(array('v' => date("dS", $date)), array('v' => (int) $data[0], 'f' => formatCurrency($data[0])), array('v' => (int) $data[1], 'f' => formatCurrency($data[1]))));
}
return $chartdata;
}
示例4: tcoconvertcurrency
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
**/
function tcoconvertcurrency($amount, $currency, $invoiceid)
{
$result = select_query("tblcurrencies", "id", array("code" => $currency));
$data = mysql_fetch_array($result);
$currencyid = $data['id'];
if (!$currencyid) {
logTransaction($GATEWAY['name'], $_POST, "Unrecognised Currency");
exit;
}
$result = select_query("tblinvoices", "userid,total", array("id" => $invoiceid));
$data = mysql_fetch_array($result);
$userid = $data['userid'];
$total = $data['total'];
$currency = getCurrency($userid);
if ($currencyid != $currency['id']) {
$amount = convertCurrency($amount, $currencyid, $currency['id']);
if ($total < $amount + 1 && $amount - 1 < $total) {
$amount = $total;
}
}
return $amount;
}
示例5: die
die("This file cannot be accessed directly");
}
$reportdata["title"] = "Direct Debit Processing";
$reportdata["description"] = "This report displays all Unpaid invoices assigned to the Direct Debit payment method and the associated bank account details stored for their owners ready for processing";
$reportdata["tableheadings"] = array("Invoice ID", "Client Name", "Invoice Date", "Due Date", "Subtotal", "Tax", "Credit", "Total", "Bank Name", "Bank Account Type", "Bank Code", "Bank Account Number");
$query = "SELECT tblinvoices.*,tblclients.firstname,tblclients.lastname,tblclients.bankname,tblclients.banktype,tblclients.bankcode,tblclients.bankacct FROM tblinvoices INNER JOIN tblclients ON tblclients.id=tblinvoices.userid WHERE tblinvoices.paymentmethod='directdebit' AND tblinvoices.status='Unpaid' ORDER BY duedate ASC";
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$id = $data["id"];
$userid = $data["userid"];
$client = $data["firstname"] . " " . $data["lastname"];
$date = $data["date"];
$duedate = $data["duedate"];
$subtotal = $data["subtotal"];
$credit = $data["credit"];
$tax = $data["tax"] + $data["tax2"];
$total = $data["total"];
$bankname = $data["bankname"];
$banktype = $data["banktype"];
$bankcode = $data["bankcode"];
$bankacct = $data["bankacct"];
$currency = getCurrency($userid);
$date = fromMySQLDate($date);
$duedate = fromMySQLDate($duedate);
$subtotal = formatCurrency($subtotal);
$credit = formatCurrency($credit);
$tax = formatCurrency($tax);
$total = formatCurrency($total);
$reportdata["tablevalues"][] = array('<a href="invoices.php?action=edit&id=' . $id . '">' . $id . '</a>', $client, $date, $duedate, $subtotal, $tax, $credit, $total, $bankname, $banktype, $bankcode, $bankacct);
}
$reportdata["footertext"] = "";
示例6: die
die("This file cannot be accessed directly");
}
$reportdata["title"] = "Affiliates Overview";
$reportdata["description"] = "An overview of affiliates for the current year";
$reportdata["tableheadings"] = array('Affiliate ID', 'Affiliate Name', 'Visitors', 'Pending Commissions', 'Available to Withdraw', 'Withdrawn Amount', 'YTD Total Commissions Paid');
$result = select_query("tblaffiliates", "tblaffiliates.id,tblaffiliates.clientid,tblaffiliates.visitors,tblaffiliates.balance,tblaffiliates.withdrawn,tblclients.firstname,tblclients.lastname,tblclients.companyname", "", "visitors", "DESC", "", "tblclients ON tblclients.id=tblaffiliates.clientid");
while ($data = mysql_fetch_array($result)) {
$affid = $data['id'];
$clientid = $data['clientid'];
$visitors = $data['visitors'];
$balance = $data['balance'];
$withdrawn = $data['withdrawn'];
$firstname = $data['firstname'];
$lastname = $data['lastname'];
$companyname = $data['companyname'];
$name = $firstname . ' ' . $lastname;
if ($companyname) {
$name .= ' (' . $companyname . ')';
}
$result2 = select_query("tblaffiliatespending", "COUNT(*),SUM(tblaffiliatespending.amount)", array("affiliateid" => $affid), "clearingdate", "DESC", "", "tblaffiliatesaccounts ON tblaffiliatesaccounts.id=tblaffiliatespending.affaccid INNER JOIN tblhosting ON tblhosting.id=tblaffiliatesaccounts.relid INNER JOIN tblproducts ON tblproducts.id=tblhosting.packageid INNER JOIN tblclients ON tblclients.id=tblhosting.userid");
$data = mysql_fetch_array($result2);
$pendingcommissions = $data[0];
$pendingcommissionsamount = $data[1];
$result2 = select_query("tblaffiliateshistory", "SUM(amount)", "affiliateid={$affid} AND date LIKE '" . date("Y") . "-%'");
$data = mysql_fetch_array($result2);
$ytdtotal = $data[0];
$currency = getCurrency($clientid);
$pendingcommissionsamount = formatCurrency($pendingcommissionsamount);
$ytdtotal = formatCurrency($ytdtotal);
$reportdata["tablevalues"][] = array('<a href="affiliates.php?action=edit&id=' . $affid . '">' . $affid . '</a>', $name, $visitors, $pendingcommissionsamount, $balance, $withdrawn, $ytdtotal);
}
示例7: tco_reoccuring_request
function tco_reoccuring_request()
{
global $whmcs;
$whmcs->load_function("gateway");
$whmcs->load_function("client");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("tco");
$invoiceid = $description = (int) $_POST['invoiceid'];
$vendorid = $GATEWAY['vendornumber'];
$apiusername = $GATEWAY['apiusername'];
$apipassword = $GATEWAY['apipassword'];
$demomode = $GATEWAY['demomode'];
$recurrings = getRecurringBillingValues($invoiceid);
if (!$recurrings) {
$url = "../../viewinvoice.php?id=" . $invoiceid;
header("Location:" . $url);
exit;
}
$primaryserviceid = $recurrings['primaryserviceid'];
$first_payment_amount = $recurrings['firstpaymentamount'] ? $recurrings['firstpaymentamount'] : $recurrings['recurringamount'];
$recurring_amount = $recurrings['recurringamount'];
if ($recurrings['recurringcycleunits'] == "Months") {
$billing_cycle = $recurrings['recurringcycleperiod'] . " Month";
} else {
if ($recurrings['recurringcycleunits'] == "Years") {
$billing_cycle = $recurrings['recurringcycleperiod'] . " Year";
}
}
$billing_duration = "Forever";
$startup_fee = $first_payment_amount - $recurring_amount;
$url = "https://www.2checkout.com/api/products/create_product";
$name = "Recurring Subscription for Invoice #" . $invoiceid;
if ($demomode = "on") {
$query_string = "name=" . $name . "&price=" . $recurring_amount . "&startup_fee=" . $startup_fee . "&demo=Y&recurring=1&recurrence=" . $billing_cycle . "&duration=" . $billing_duration . "&description=" . $description;
} else {
$query_string = "name=" . $name . "&price=" . $recurring_amount . "&startup_fee=" . $startup_fee . "&recurring=1&recurrence=" . $billing_cycle . "&duration=" . $billing_duration . "&description=" . $description;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, $apiusername . ":" . $apipassword);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
$response = curl_exec($ch);
curl_close($ch);
if (!function_exists("json_decode")) {
exit("JSON Module Required in PHP Build for 2CheckOut Gateway");
}
$response = json_decode($response, true);
if (!count($response['errors']) && $response['response_code'] == "OK") {
logTransaction("2Checkout Recurring", print_r($response, true), "Ok");
$product_id = $response['product_id'];
$assigned_product_id = $response['assigned_product_id'];
$purchaseroutine = !$GATEWAY['purchaseroutine'] ? "s" : "";
$result = select_query("tblinvoices", "userid", array("id" => $invoiceid));
$data = mysql_fetch_array($result);
$userid = $data[0];
$clientsdetails = getClientsDetails($userid);
$currency = getCurrency($userid);
global $CONFIG;
$lang = $clientsdetails['language'];
if (!$lang) {
$lang = $CONFIG['Language'];
}
$lang = strtolower($lang);
if ($lang == "chinese") {
$lang = "zh";
} else {
if ($lang == "danish") {
$lang = "da";
} else {
if ($lang == "dutch") {
$lang = "nl";
} else {
if ($lang == "french") {
$lang = "fr";
} else {
if ($lang == "german") {
$lang = "gr";
} else {
if ($lang == "greek") {
$lang = "el";
} else {
if ($lang == "italian") {
$lang = "it";
} else {
if ($lang == "japanese") {
$lang = "jp";
} else {
if ($lang == "norwegian") {
$lang = "no";
} else {
if ($lang == "portuguese") {
$lang = "pt";
//.........这里部分代码省略.........
示例8: getBalanceFormatted
public function getBalanceFormatted()
{
global $currency;
$userid = $this->getData("userid");
$currency = getCurrency($userid);
$balance = $this->getData("balance");
return "<span class=\"" . (0 < $balance ? "textred" : "textgreen") . "\">" . formatCurrency($balance) . "</span>";
}
示例9: trim
}
$filename = trim($filename);
$filename = preg_replace("/[^a-zA-Z0-9-_. ]/", "", $filename);
mt_srand(time());
$rand = mt_rand(100000, 999999);
$newfilename = $rand . "_" . $filename;
move_uploaded_file($_FILES['attachments']['tmp_name'][$num], $projectsdir . $newfilename);
$attachments[] = $newfilename;
update_query("mod_project", array("attachments" => implode(",", $attachments)), array("id" => $projectid));
project_management_log($projectid, $vars['_lang']['clientaddedattachment'] . " " . $filename);
}
}
redir("m=project_management&a=view&id=" . $projectid);
}
global $currency;
$currency = getCurrency($_SESSION['uid']);
$tplvars['project'] = array("id" => $data['id'], "title" => $data['title'], "adminid" => $data['adminid'], "adminname" => get_query_val("tbladmins", "CONCAT(firstname,' ',lastname)", array("id" => $data['adminid'])), "created" => fromMySQLDate($data['created'], 0, 1), "duedate" => fromMySQLDate($data['duedate'], 0, 1), "duein" => project_management_daysleft($data['duedate']), "lastmodified" => fromMySQLDate($data['lastmodified'], 0, 1), "totaltime" => $totaltime, "status" => $data['status']);
if (!$tplvars['project']['adminname']) {
$tplvars['project']['adminname'] = "None";
}
$ticketids = $data['ticketids'];
$invoiceids = $data['invoiceids'];
$attachments = $data['attachments'];
$ticketinvoicelinks = $tickets = $invoices = $attachmentsarray = array();
$ticketids = explode(",", $ticketids);
foreach ($ticketids as $ticketnum) {
if ($ticketnum) {
$result = select_query("tbltickets", "id,tid,c,title,status,lastreply", array("tid" => $ticketnum));
$data = mysql_fetch_array($result);
$ticketid = $data['id'];
if ($ticketid) {
示例10: getAdminHomeStats
function getAdminHomeStats($type = "")
{
global $currency;
$stats = array();
$currency = getCurrency(0, 1);
if (!$type || $type == "income") {
$result = full_query("SELECT SUM((amountin-fees-amountout)/rate) FROM tblaccounts WHERE date LIKE '" . date("Y-m-d") . "%'");
$data = mysql_fetch_array($result);
$todaysincome = formatCurrency($data[0]);
$stats['income']['today'] = $todaysincome;
$result = full_query("SELECT SUM((amountin-fees-amountout)/rate) FROM tblaccounts WHERE date LIKE '" . date("Y-m-") . "%'");
$data = mysql_fetch_array($result);
$todaysincome = formatCurrency($data[0]);
$stats['income']['thismonth'] = $todaysincome;
$result = full_query("SELECT SUM((amountin-fees-amountout)/rate) FROM tblaccounts WHERE date LIKE '" . date("Y-") . "%'");
$data = mysql_fetch_array($result);
$todaysincome = formatCurrency($data[0]);
$stats['income']['thisyear'] = $todaysincome;
if ($type == "income") {
return $stats;
}
}
$result = full_query("SELECT SUM(total)-COALESCE(SUM((SELECT SUM(amountin) FROM tblaccounts WHERE tblaccounts.invoiceid=tblinvoices.id)),0) FROM tblinvoices WHERE tblinvoices.status='Unpaid' AND duedate<'" . date("Ymd") . "'");
$data = mysql_fetch_array($result);
$overdueinvoices = $data[0];
$stats['invoices']['overduebalance'] = $data[1];
$result = full_query("SELECT COUNT(*) FROM tblcancelrequests INNER JOIN tblhosting ON tblhosting.id=tblcancelrequests.relid WHERE (tblhosting.domainstatus!='Cancelled' AND tblhosting.domainstatus!='Terminated')");
$data = mysql_fetch_array($result);
$stats['cancellations']['pending'] = $data[0];
$stats['orders']['today']['active'] = $stats['orders']['today']['fraud'] = $stats['orders']['today']['pending'] = $stats['orders']['today']['cancelled'] = 0;
$query = "SELECT status,COUNT(*) FROM tblorders WHERE date LIKE '" . date("Y-m-d") . "%' GROUP BY status";
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$stats['orders']['today'][strtolower($data[0])] = $data[1];
}
$stats['orders']['today']['total'] = $stats['orders']['today']['active'] + $stats['orders']['today']['fraud'] + $stats['orders']['today']['pending'] + $stats['orders']['today']['cancelled'];
$stats['orders']['yesterday']['active'] = $stats['orders']['yesterday']['fraud'] = $stats['orders']['yesterday']['pending'] = $stats['orders']['yesterday']['cancelled'] = 0;
$query = "SELECT status,COUNT(*) FROM tblorders WHERE date LIKE '" . date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y"))) . "%' GROUP BY status";
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$stats['orders']['yesterday'][strtolower($data[0])] = $data[1];
}
$stats['orders']['yesterday']['total'] = $stats['orders']['yesterday']['active'] + $stats['orders']['yesterday']['fraud'] + $stats['orders']['yesterday']['pending'] + $stats['orders']['yesterday']['cancelled'];
$query = "SELECT COUNT(*) FROM tblorders WHERE date LIKE '" . date("Y-m-") . "%'";
$result = full_query($query);
$data = mysql_fetch_array($result);
$stats['orders']['thismonth']['total'] = $data[0];
$query = "SELECT COUNT(*) FROM tblorders WHERE date LIKE '" . date("Y-") . "%'";
$result = full_query($query);
$data = mysql_fetch_array($result);
$stats['orders']['thisyear']['total'] = $data[0];
global $disable_admin_ticket_page_counts;
if (!$disable_admin_ticket_page_counts) {
$allactive = $awaitingreply = 0;
$ticketcounts = array();
$query = "SELECT tblticketstatuses.title,(SELECT COUNT(*) FROM tbltickets WHERE tbltickets.status=tblticketstatuses.title),showactive,showawaiting FROM tblticketstatuses ORDER BY sortorder ASC";
$result = full_query($query);
while ($data = mysql_fetch_array($result)) {
$stats['tickets'][preg_replace("/[^a-z0-9]/", "", strtolower($data[0]))] = $data[1];
if ($data['showactive']) {
$allactive += $data[1];
}
if ($data['showawaiting']) {
$awaitingreply += $data[1];
}
}
$result = select_query("tbltickets", "COUNT(*)", "status!='Closed' AND flag='" . (int) $_SESSION['adminid'] . "'");
$data = mysql_fetch_array($result);
$flaggedtickets = $data[0];
$stats['tickets']['allactive'] = $allactive;
$stats['tickets']['awaitingreply'] = $awaitingreply;
$stats['tickets']['flaggedtickets'] = $flaggedtickets;
}
$query = "SELECT COUNT(*) FROM tbltodolist WHERE status!='Completed' AND status!='Postponed' AND duedate<='" . date("Y-m-d") . "'";
$result = full_query($query);
$data = mysql_fetch_array($result);
$stats['todoitems']['due'] = $data[0];
$query = "SELECT COUNT(*) FROM tblnetworkissues WHERE status!='Scheduled' AND status!='Resolved'";
$result = full_query($query);
$data = mysql_fetch_array($result);
$stats['networkissues']['open'] = $data[0];
$result = select_query("tblbillableitems", "COUNT(*)", array("invoicecount" => "0"));
$data = mysql_fetch_array($result);
$stats['billableitems']['uninvoiced'] = $data[0];
$result = select_query("tblquotes", "COUNT(*)", array("validuntil" => array("sqltype" => ">", "value" => date("Ymd"))));
$data = mysql_fetch_array($result);
$stats['quotes']['valid'] = $data[0];
return $stats;
}
示例11: widget_income_forecast
function widget_income_forecast($vars)
{
global $whmcs, $_ADMINLANG, $currency, $currencytotal, $data;
$title = $_ADMINLANG['home']['incomeforecast'];
function ah_formatstat($billingcycle, $stat)
{
global $data, $currency, $currencytotal;
$value = array_key_exists($billingcycle, $data) ? $data[$billingcycle][$stat] : '';
if (!$value) {
$value = 0;
}
if ($stat == "sum") {
if ($billingcycle == "Monthly") {
$currencytotal += $value * 12;
} elseif ($billingcycle == "Quarterly") {
$currencytotal += $value * 4;
} elseif ($billingcycle == "Semi-Annually") {
$currencytotal += $value * 2;
} elseif ($billingcycle == "Annually") {
$currencytotal += $value;
} elseif ($billingcycle == "Biennially") {
$currencytotal += $value / 2;
} elseif ($billingcycle == "Triennially") {
$currencytotal += $value / 3;
}
$value = formatCurrency($value);
}
return $value;
}
$incomestats = array();
$result = select_query("tblhosting,tblclients", "currency,billingcycle,COUNT(*),SUM(amount)", "tblclients.id = tblhosting.userid AND (domainstatus = 'Active' OR domainstatus = 'Suspended') GROUP BY currency, billingcycle");
while ($data = mysql_fetch_array($result)) {
$incomestats[$data['currency']][$data['billingcycle']]["count"] = $data[2];
$incomestats[$data['currency']][$data['billingcycle']]["sum"] = $data[3];
}
$result = select_query("tblhostingaddons,tblhosting,tblclients", "currency,tblhostingaddons.billingcycle,COUNT(*),SUM(recurring)", "tblhostingaddons.hostingid=tblhosting.id AND tblclients.id=tblhosting.userid AND (tblhostingaddons.status='Active' OR tblhostingaddons.status='Suspended') GROUP BY currency, tblhostingaddons.billingcycle");
while ($data = mysql_fetch_array($result)) {
if (isset($incomestats[$data['currency']][$data['billingcycle']]["count"])) {
$incomestats[$data['currency']][$data['billingcycle']]["count"] += $data[2];
} else {
$incomestats[$data['currency']][$data['billingcycle']]["count"] = $data[2];
}
if (isset($incomestats[$data['currency']][$data['billingcycle']]["sum"])) {
$incomestats[$data['currency']][$data['billingcycle']]["sum"] += $data[3];
} else {
$incomestats[$data['currency']][$data['billingcycle']]["sum"] = $data[3];
}
}
$result = select_query("tbldomains,tblclients", "currency,COUNT(*),SUM(recurringamount/registrationperiod)", "tblclients.id=tbldomains.userid AND tbldomains.status='Active' GROUP BY currency");
while ($data = mysql_fetch_array($result)) {
if (isset($incomestats[$data['currency']]["Annually"]["count"])) {
$incomestats[$data['currency']]["Annually"]["count"] += $data[1];
} else {
$incomestats[$data['currency']]["Annually"]["count"] = $data[1];
}
if (isset($incomestats[$data['currency']]["Annually"]["sum"])) {
$incomestats[$data['currency']]["Annually"]["sum"] += $data[2];
} else {
$incomestats[$data['currency']]["Annually"]["sum"] = $data[2];
}
}
$content = '';
if (count($incomestats)) {
$content = '<div class="row">';
foreach ($incomestats as $currency => $data) {
$currency = getCurrency("", $currency);
$currencytotal = 0;
$content .= '<div class="' . (count($incomestats) > 1 ? 'col-md-6' : '') . ' text-center">' . "<span class=\"textred\"><b>{$currency['code']} " . $_ADMINLANG['currencies']['currency'] . "</b></span><br />\n " . $_ADMINLANG['billingcycles']['monthly'] . ": " . ah_formatstat('Monthly', 'sum') . " (" . ah_formatstat('Monthly', 'count') . ")<br />\n " . $_ADMINLANG['billingcycles']['quarterly'] . ": " . ah_formatstat('Quarterly', 'sum') . " (" . ah_formatstat('Quarterly', 'count') . ")<br />\n " . $_ADMINLANG['billingcycles']['semiannually'] . ": " . ah_formatstat('Semi-Annually', 'sum') . " (" . ah_formatstat('Semi-Annually', 'count') . ")<br />\n " . $_ADMINLANG['billingcycles']['annually'] . ": " . ah_formatstat('Annually', 'sum') . " (" . ah_formatstat('Annually', 'count') . ")<br />\n " . $_ADMINLANG['billingcycles']['biennially'] . ": " . ah_formatstat('Biennially', 'sum') . " (" . ah_formatstat('Biennially', 'count') . ")<br />\n " . $_ADMINLANG['billingcycles']['triennially'] . ": " . ah_formatstat('Triennially', 'sum') . " (" . ah_formatstat('Triennially', 'count') . ")<br />\n <span class=\"textgreen\"><b>" . $_ADMINLANG['billing']['annualestimate'] . ": " . formatCurrency($currencytotal) . "</b></span></div>";
}
$content .= '</div>';
} else {
$content = '<div align="center">No Active or Suspended Products/Services Found to build Forecast</div>';
}
$content = '<div id="incomeforecast">' . $content . '</div>';
return array('title' => $title, 'content' => $content);
}
示例12: array
}
$gatewaysarray = array();
$result = select_query("tblpaymentgateways", "gateway", array("setting" => "name"));
while ($data = mysql_fetch_array($result)) {
$gatewaysarray[] = $data['gateway'];
}
if (!in_array($paymentmethod, $gatewaysarray)) {
$apiresults = array("result" => "error", "message" => "Invalid Payment Method. Valid options include " . implode(",", $gatewaysarray));
return null;
}
if ($clientip) {
$remote_ip = $clientip;
}
$_SESSION['uid'] = $_POST['clientid'];
global $currency;
$currency = getCurrency($_POST['clientid']);
$_SESSION['cart'] = array();
if (is_array($pid)) {
foreach ($pid as $i => $prodid) {
if ($prodid) {
$proddomain = $domain[$i];
$prodbillingcycle = $billingcycle[$i];
$configoptionsarray = array();
$customfieldsarray = array();
$domainfieldsarray = array();
$addonsarray = array();
if ($addons[$i]) {
$addonsarray = explode(",", $addons[$i]);
}
if ($configoptions[$i]) {
$configoptionsarray = unserialize(base64_decode($configoptions[$i]));
示例13: hook_stregistrar_OrderDomainPricingOverride
function hook_stregistrar_OrderDomainPricingOverride($params)
{
$domain = explode('.', $params['domain']);
$sld = $domain[0];
$tld = '.' . $domain[1];
$config = __getSTRegistrarModuleConfig();
$premiumFee = 0;
if (strlen($sld) == 2) {
$premiumFee = $config['twoLetterFee'];
} elseif (strlen($sld) == 1) {
$premiumFee = $config['oneLetterFee'];
}
$currency = getCurrency($_SESSION['uid']);
if (($regularPrice = __getDomainRegistrationPrice($tld, $params['regperiod'], $currency['id'])) === false) {
die;
return false;
}
$total = $regularPrice + $premiumFee * $currency['rate'];
ob_clean();
return $total;
}
示例14: sprintf
$filter_base = sprintf("sort=%d&filter[start_date]=%s&filter[end_date]=%s&filter[textsearch]=%s&filter[amount]=%s&view=%s", $_GET['sort'], $filter['start_date'], $filter['end_date'], isset($filter['textsearch']) ? $filter['textsearch'] : '', isset($filter['amount']) ? $filter['amount'] : '', $view);
$result = WFO::SQL($q);
$total_shown = 0;
$count = 1;
$prev_date = "";
$cur_date = $ts_start_date;
while ($tr = mysql_fetch_object($result)) {
//id des factures liées
$id_invoices = array();
$result_invoices = mysql_query("SELECT id_invoice as id , num_facture , ref_contrat " . "FROM webfinance_transaction_invoice AS wf_tr_inv LEFT JOIN webfinance_invoices AS wf_inv ON (wf_tr_inv.id_invoice = wf_inv.id_facture) " . "WHERE wf_tr_inv.id_transaction=" . $tr->id) or wf_mysqldie();
while ($invoice_obj = mysql_fetch_object($result_invoices)) {
$id_invoices[] = $invoice_obj;
}
mysql_free_result($result_invoices);
//currency
list($currency, $ex) = getCurrency($tr->id_account);
if (empty($tr->exchange_rate)) {
$tr->exchange_rate = 1;
}
//s�parer les mois
$current_month = ucfirst(strftime("%B %Y", $tr->ts_date));
if (!empty($prev_date)) {
if (date("m", $prev_date) != date("m", $tr->ts_date)) {
echo "<tr class=\"row_even\"><td colspan='8' align='center'><b>{$current_month}</b></td></tr>";
}
} else {
echo "<tr class=\"row_even\"><td colspan='8' align='center'><b>{$current_month}</b></td></tr>";
$cur_date = $tr->ts_date;
}
$prev_date = $tr->ts_date;
$total_shown += $tr->amount / $tr->exchange_rate;
示例15: select_query
// Get transaction
$transactionQuery = select_query('gateway_mollie', '', array('paymentid' => $_POST['id']), null, null, 1);
if (mysql_num_rows($transactionQuery) != 1) {
logTransaction('mollieunknown', $_POST, 'Callback - Failure 2 (Transaction not found)');
header('HTTP/1.1 500 Transaction not found');
exit;
}
$transaction = mysql_fetch_assoc($transactionQuery);
$_GATEWAY = getGatewayVariables('mollie' . $transaction['method']);
if ($transaction['status'] != 'open') {
logTransaction($_GATEWAY['paymentmethod'], array_merge($transaction, $_POST), 'Callback - Failure 3 (Transaction not open)');
header('HTTP/1.1 500 Transaction not open');
exit;
}
// Get user and transaction currencies
$userCurrency = getCurrency($transaction['userid']);
$transactionCurrency = select_query('tblcurrencies', '', array('id' => $transaction['currencyid']));
$transactionCurrency = mysql_fetch_assoc($transactionCurrency);
// Check payment
$mollie = new Mollie_API_Client();
$mollie->setApiKey($_GATEWAY['key']);
$payment = $mollie->payments->get($_POST['id']);
if ($payment->isPaid()) {
// Add conversion, when there is need to. WHMCS only supports currencies per user. WHY?!
if ($transactionCurrency['id'] != $userCurrency['id']) {
$transaction['amount'] = convertCurrency($transaction['amount'], $transaction['currencyid'], $userCurrency['id']);
}
// Check invoice
$invoiceid = checkCbInvoiceID($transaction['invoiceid'], $_GATEWAY['paymentmethod']);
checkCbTransID($transaction['paymentid']);
// Add invoice