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

PHP formatCurrency函数代码示例

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

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



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

示例1: setvar

 function setvar($key, $value, $formatCurrency = false)
 {
     if ($formatCurrency) {
         $value = formatCurrency($value);
     }
     $this->tpl->set_var($key, html_entity_to_alpha($value));
 }
开发者ID:armic,项目名称:erpts,代码行数:7,代码来源:PrintMergedReceiptDetailsPDF.php


示例2: renderColumn

 public static function renderColumn(CAppUI $AppUI, $fieldName, $row)
 {
     switch ($fieldName) {
         case 'project_creator':
         case 'project_owner':
             $s .= '<td nowrap="nowrap">';
             $s .= w2PgetUsernameFromID($row[$fieldName]);
             $s .= '</td>';
             break;
         case 'project_target_budget':
         case 'project_actual_budget':
             $s .= '<td>';
             $s .= $w2Pconfig['currency_symbol'];
             $s .= formatCurrency($row[$fieldName], $AppUI->getPref('CURRENCYFORM'));
             $s .= '</td>';
             break;
         case 'project_url':
         case 'project_demo_url':
             $s .= '<td>';
             $s .= w2p_url($row[$fieldName]);
             $s .= '</td>';
             break;
         case 'project_start_date':
         case 'project_end_date':
             $df = $AppUI->getPref('SHDATEFORMAT');
             $myDate = intval($row[$fieldName]) ? new w2p_Utilities_Date($row[$fieldName]) : null;
             $s .= '<td nowrap="nowrap" class="center">' . ($myDate ? $myDate->format($df) : '-') . '</td>';
             break;
         default:
             $s .= '<td nowrap="nowrap" class="center">';
             $s .= htmlspecialchars($row[$fieldName], ENT_QUOTES);
             $s .= '</td>';
     }
     return $s;
 }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:35,代码来源:HTMLHelper.class.php


示例3: ah_formatstat

 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;
 }
开发者ID:MarcelaGotta,项目名称:Webty,代码行数:25,代码来源:income_forecast.php


示例4: parseValue

 public function parseValue($type, $item)
 {
     foreach ($item as $field => $value) {
         switch ($field) {
             case 'defaultPrice':
                 $parsed[$field] = formatCurrency($value);
                 break;
             default:
                 $parsed[$field] = $value;
         }
         if (isset($parsed[$field]) && $field != 'defaultPrice') {
             $parsed[$field] = htmlspecialchars($parsed[$field], ENT_QUOTES | ENT_HTML5, 'UTF-8');
         }
     }
     return $parsed;
 }
开发者ID:jewelhuq,项目名称:erp,代码行数:16,代码来源:Product.php


示例5: 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'] . ' &raquo;</a>
</div>';
    return array('title' => $title, 'content' => $content);
}
开发者ID:MarcelaGotta,项目名称:Webty,代码行数:43,代码来源:open_invoices.php


示例6: parseValue

 public function parseValue($type, $item)
 {
     foreach ($item as $field => $value) {
         switch ($field) {
             case 'discountType':
                 $parsed[$field] = $value == 'C' ? 'Cash' : 'Percentage';
                 break;
             case 'discountAmount':
                 $parsed[$field] = $item['discountType'] == 'C' ? formatCurrency($value) : $value + 0 . '%';
                 break;
             default:
                 $parsed[$field] = $value;
         }
         if (isset($parsed[$field]) && ($field != 'discountAmount' || $field == 'discountAmount' && $item['discountType'] != 'C')) {
             $parsed[$field] = htmlspecialchars($parsed[$field], ENT_QUOTES | ENT_HTML5, 'UTF-8');
         }
     }
     return $parsed;
 }
开发者ID:jewelhuq,项目名称:erp,代码行数:19,代码来源:Discount.php


示例7: compoundInterest

function compoundInterest($investment, $interest_rate, $years, $compound_monthly = false)
{
    // calculate the future value
    $is_compounded_monthly = '';
    $future_value = $investment;
    for ($i = 1; $i <= $years; $i++) {
        if ($compound_monthly) {
            $future_value = $future_value * pow(1 + $interest_rate / (100 * 12), 12);
            $is_compounded_monthly = "Yes";
        } else {
            $future_value = $future_value + $future_value * $interest_rate * 0.01;
            $is_compounded_monthly = "No";
        }
    }
    // apply currency and percent formatting
    $investment_f = formatCurrency($investment);
    $yearly_rate_f = formatPercentage($interest_rate);
    $future_value_f = formatCurrency($future_value);
    include 'display_results.php';
}
开发者ID:proberts42,项目名称:paulrroberts,代码行数:20,代码来源:calculations.php


示例8: 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;
}
开发者ID:MarcelaGotta,项目名称:Webty,代码行数:21,代码来源:income_overview.php


示例9: Main


//.........这里部分代码省略.........
                                         }
                                         $this->tpl->set_var("idle", $this->formArray["idle"]);
                                     }
                                 }
                                 // grab DueRecords from tdID
                                 $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object");
                                 $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => "");
                                 if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) {
                                     if ($this->formArray["rptopID"] != "") {
                                         $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>.";
                                     } else {
                                         $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list.";
                                     }
                                     exit($redirectMessage);
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         if ($this->formArray["rptopID"] != "") {
                                             $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>.";
                                         } else {
                                             $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list.";
                                         }
                                         exit($redirectMessage);
                                     } else {
                                         $dueRecords = new DueRecords();
                                         $dueRecords->parseDomDocument($domDoc);
                                         foreach ($dueRecords->getArrayList() as $due) {
                                             foreach ($due as $dueKey => $dueValue) {
                                                 switch ($dueKey) {
                                                     case "dueType":
                                                         if ($dueValue == "Annual") {
                                                             $this->formArray["totalTaxDue"] += $due->getTaxDue();
                                                         }
                                                         $dueArrayList[$dueValue] = $due;
                                                         $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax()));
                                                         $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax()));
                                                         $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax()));
                                                         $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue()));
                                                         $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate())));
                                                         $dueDateYear = date("Y", strtotime($due->getDueDate()));
                                                         $this->tdRecord["year"] = $dueDateYear;
                                                         break;
                                                 }
                                             }
                                         }
                                         $treasurySettings = new TreasurySettings();
                                         $treasurySettings->selectRecord();
                                         // initialize discountPeriod and discountPercentage for earlyPaymentDiscount
                                         $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%");
                                         $this->tpl->set_var("discountPeriod", "January 01, " . $dueDateYear . " - " . date("F d, Y", strtotime($dueDateYear . "-" . $treasurySettings->getDiscountPeriod())));
                                         $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage();
                                         $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod();
                                         $this->formArray["discountPeriod_End"] = strtotime($dueDateYear . "-" . $this->formArray["discountPeriod"]);
                                         $this->formArray["discountPeriod_Start"] = strtotime($dueDateYear . "-01-01");
                                         // initialize advancedDiscountPercentage for advancedPayment
                                         $this->tpl->set_var("advancedDiscountPercentage", $treasurySettings->getAdvancedDiscountPercentage() . "%");
                                         $this->formArray["advancedDiscountPercentage"] = $treasurySettings->getAdvancedDiscountPercentage();
                                         $this->tpl->set_var("q1AdvancedDiscountPercentage", $treasurySettings->getQ1AdvancedDiscountPercentage() . "%");
                                         $this->formArray["q1AdvancedDiscountPercentage"] = $treasurySettings->getQ1AdvancedDiscountPercentage();
                                         // initialize penaltyLUTArray
                                         $penaltyLUTArray = $treasurySettings->getPenaltyLUT();
                                         $this->penaltyLUTArray = $treasurySettings->getPenaltyLUT();
                                         foreach ($dueArrayList as $dKey => $due) {
                                             $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]);
                                             $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]);
                                             // compute earlyPaymentDiscount as of today
                                             // check if today is within the discountPeriod and compute Discount
开发者ID:armic,项目名称:erpts,代码行数:67,代码来源:StatementOfRealPropertyTaxPrint.php


示例10: formatCurrencyFigures

 function formatCurrencyFigures()
 {
     $suffixKey = 1;
     for ($suffixKey = 1; $suffixKey <= 11; $suffixKey++) {
         $this->formArray["paidBasic" . $suffixKey] = formatCurrency($this->formArray["paidBasic" . $suffixKey]);
         $this->formArray["discountBasic" . $suffixKey] = formatCurrency($this->formArray["discountBasic" . $suffixKey]);
         $this->formArray["priorBasic" . $suffixKey] = formatCurrency($this->formArray["priorBasic" . $suffixKey]);
         $this->formArray["penaltyBasic" . $suffixKey] = formatCurrency($this->formArray["penaltyBasic" . $suffixKey]);
         $this->formArray["priorPenaltyBasic" . $suffixKey] = formatCurrency($this->formArray["priorPenaltyBasic" . $suffixKey]);
         $this->formArray["totalNetBasic" . $suffixKey] = formatCurrency($this->formArray["totalNetBasic" . $suffixKey]);
         $this->formArray["paidSEF" . $suffixKey] = formatCurrency($this->formArray["paidSEF" . $suffixKey]);
         $this->formArray["discountSEF" . $suffixKey] = formatCurrency($this->formArray["discountSEF" . $suffixKey]);
         $this->formArray["priorSEF" . $suffixKey] = formatCurrency($this->formArray["priorSEF" . $suffixKey]);
         $this->formArray["penaltySEF" . $suffixKey] = formatCurrency($this->formArray["penaltySEF" . $suffixKey]);
         $this->formArray["priorPenaltySEF" . $suffixKey] = formatCurrency($this->formArray["priorPenaltySEF" . $suffixKey]);
         $this->formArray["totalNetSEF" . $suffixKey] = formatCurrency($this->formArray["totalNetSEF" . $suffixKey]);
         $this->formArray["paidIdle" . $suffixKey] = formatCurrency($this->formArray["paidIdle" . $suffixKey]);
         $this->formArray["priorIdle" . $suffixKey] = formatCurrency($this->formArray["priorIdle" . $suffixKey]);
         $this->formArray["penaltyIdle" . $suffixKey] = formatCurrency($this->formArray["penaltyIdle" . $suffixKey]);
         $this->formArray["totalIdle" . $suffixKey] = formatCurrency($this->formArray["totalIdle" . $suffixKey]);
         $this->formArray["specialLevy" . $suffixKey] = formatCurrency($this->formArray["specialLevy" . $suffixKey]);
         $this->formArray["totalNonCash" . $suffixKey] = formatCurrency($this->formArray["totalNonCash" . $suffixKey]);
         $this->formArray["grandTotalNetCol" . $suffixKey] = formatCurrency($this->formArray["grandTotalNetCol" . $suffixKey]);
     }
     $this->formArray["totalPaidBasic"] = formatCurrency($this->formArray["totalPaidBasic"]);
     $this->formArray["totalDiscountBasic"] = formatCurrency($this->formArray["totalDiscountBasic"]);
     $this->formArray["totalPriorBasic"] = formatCurrency($this->formArray["totalPriorBasic"]);
     $this->formArray["totalPenaltyBasic"] = formatCurrency($this->formArray["totalPenaltyBasic"]);
     $this->formArray["totalPriorPenaltyBasic"] = formatCurrency($this->formArray["totalPriorPenaltyBasic"]);
     $this->formArray["totalTotalNetBasic"] = formatCurrency($this->formArray["totalTotalNetBasic"]);
     $this->formArray["totalPaidSEF"] = formatCurrency($this->formArray["totalPaidSEF"]);
     $this->formArray["totalDiscountSEF"] = formatCurrency($this->formArray["totalDiscountSEF"]);
     $this->formArray["totalPriorSEF"] = formatCurrency($this->formArray["totalPriorSEF"]);
     $this->formArray["totalPenaltySEF"] = formatCurrency($this->formArray["totalPenaltySEF"]);
     $this->formArray["totalPriorPenaltySEF"] = formatCurrency($this->formArray["totalPriorPenaltySEF"]);
     $this->formArray["totalTotalNetSEF"] = formatCurrency($this->formArray["totalTotalNetSEF"]);
     $this->formArray["totalPaidIdle"] = formatCurrency($this->formArray["totalPaidIdle"]);
     $this->formArray["totalPriorIdle"] = formatCurrency($this->formArray["totalPriorIdle"]);
     $this->formArray["totalPenaltyIdle"] = formatCurrency($this->formArray["totalPenaltyIdle"]);
     $this->formArray["totalTotalIdle"] = formatCurrency($this->formArray["totalTotalIdle"]);
     $this->formArray["totalSpecialLevy"] = formatCurrency($this->formArray["totalSpecialLevy"]);
     $this->formArray["totalTotalNonCash"] = formatCurrency($this->formArray["totalTotalNonCash"]);
     $this->formArray["totalGrandTotalNetCol"] = formatCurrency($this->formArray["totalGrandTotalNetCol"]);
 }
开发者ID:armic,项目名称:erpts,代码行数:44,代码来源:ConsolidatedQuarterlyReportOnRPTCollectionsPrint.php


示例11: formatCurrency

    }
    if ($semiannually >= 0) {
        $output .= '<option value="semiannually">' . $_LANG['orderpaymentterm6month'] . ' - ' . formatCurrency($semiannually / 6) . '/mo';
        if ($ssetupfee != "0.00") {
            $output .= " + " . formatCurrency($ssetupfee) . " " . $_LANG['ordersetupfee'];
        }
        $output .= '</option>';
    }
    if ($quarterly >= 0) {
        $output .= '<option value="quarterly">' . $_LANG['orderpaymentterm3month'] . ' - ' . formatCurrency($quarterly / 3) . '/mo';
        if ($qsetupfee != "0.00") {
            $output .= " + " . formatCurrency($qsetupfee) . " " . $_LANG['ordersetupfee'];
        }
        $output .= '</option>';
    }
    if ($monthly >= 0) {
        $output .= '<option value="monthly">' . $_LANG['orderpaymenttermmonthly'] . ' - ' . formatCurrency($monthly) . '/mo';
        if ($msetupfee != "0.00") {
            $output .= " + " . formatCurrency($msetupfee) . " " . $_LANG['ordersetupfee'];
        }
        $output .= '</option>';
    }
    $output .= '</select>';
}
$output .= ' <input type="submit" value="' . $_LANG['domainordernow'] . '" /></form>';
widgetoutput($output);
function widgetoutput($value)
{
    echo "document.write('" . addslashes($value) . "');";
    exit;
}
开发者ID:carriercomm,项目名称:whmcs-5,代码行数:31,代码来源:productpricing.php


示例12: getTLDPriceList

function getTLDPriceList($tld, $display = "", $renewpricing = "", $userid = "")
{
    global $currency;
    if ($renewpricing == "renew") {
        $renewpricing = true;
    }
    $currency_id = $currency['id'];
    $result = select_query("tbldomainpricing", "id", array("extension" => $tld));
    $data = mysql_fetch_array($result);
    $id = $data['id'];
    if (!$userid && isset($_SESSION['uid'])) {
        $userid = $_SESSION['uid'];
    }
    $clientgroupid = $userid ? get_query_val("tblclients", "groupid", array("id" => $userid)) : "0";
    $checkfields = array("msetupfee", "qsetupfee", "ssetupfee", "asetupfee", "bsetupfee", "monthly", "quarterly", "semiannually", "annually", "biennially");
    if (!$renewpricing || $renewpricing === "transfer") {
        $data = get_query_vals("tblpricing", "", array("type" => "domainregister", "currency" => $currency_id, "relid" => $id, "tsetupfee" => $clientgroupid));
        if (!$data) {
            $data = get_query_vals("tblpricing", "", array("type" => "domainregister", "currency" => $currency_id, "relid" => $id, "tsetupfee" => "0"));
        }
        foreach ($checkfields as $k => $v) {
            $register[$k + 1] = $data[$v];
        }
        $data = get_query_vals("tblpricing", "", array("type" => "domaintransfer", "currency" => $currency_id, "relid" => $id, "tsetupfee" => $clientgroupid));
        if (!$data) {
            $data = get_query_vals("tblpricing", "", array("type" => "domaintransfer", "currency" => $currency_id, "relid" => $id, "tsetupfee" => "0"));
        }
        foreach ($checkfields as $k => $v) {
            $transfer[$k + 1] = $data[$v];
        }
    }
    if (!$renewpricing || $renewpricing !== "transfer") {
        $data = get_query_vals("tblpricing", "", array("type" => "domainrenew", "currency" => $currency_id, "relid" => $id, "tsetupfee" => $clientgroupid));
        if (!$data) {
            $data = get_query_vals("tblpricing", "", array("type" => "domainrenew", "currency" => $currency_id, "relid" => $id, "tsetupfee" => "0"));
        }
        foreach ($checkfields as $k => $v) {
            $renew[$k + 1] = $data[$v];
        }
    }
    $tldpricing = array();
    $years = 1;
    while ($years <= 10) {
        if ($renewpricing === "transfer") {
            if (0 < $register[$years] && 0 <= $transfer[$years]) {
                if ($display) {
                    $transfer[$years] = formatCurrency($transfer[$years]);
                }
                $tldpricing[$years]['transfer'] = $transfer[$years];
            }
        } else {
            if ($renewpricing) {
                if (0 < $renew[$years]) {
                    if ($display) {
                        $renew[$years] = formatCurrency($renew[$years]);
                    }
                    $tldpricing[$years]['renew'] = $renew[$years];
                }
            } else {
                if (0 < $register[$years]) {
                    if ($display) {
                        $register[$years] = formatCurrency($register[$years]);
                    }
                    $tldpricing[$years]['register'] = $register[$years];
                    if (0 <= $transfer[$years]) {
                        if ($display) {
                            $transfer[$years] = formatCurrency($transfer[$years]);
                        }
                        $tldpricing[$years]['transfer'] = $transfer[$years];
                    }
                    if (0 < $renew[$years]) {
                        if ($display) {
                            $renew[$years] = formatCurrency($renew[$years]);
                        }
                        $tldpricing[$years]['renew'] = $renew[$years];
                    }
                }
            }
        }
        $years += 1;
    }
    return $tldpricing;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:83,代码来源:domainfunctions.php


示例13: generatePDF

    public function generatePDF($id, $pdfID)
    {
        global $dbh;
        global $SETTINGS;
        $filename = 'Default';
        $html = '';
        if ($pdfID == 1) {
            //TODO: make this look a bit nicer
            //TODO: padding doesn't work in tables in tcpdf, another option might be dompdf (https://github.com/dompdf/dompdf)
            $filename = 'Invoice';
            $html = '<body style="font-size:1em;">
					<div style="width:640px; margin:0 auto;">
					<span style="font-weight:bold; font-size:1.5em;">' . $SETTINGS['companyName'] . '</span>
					<div style="border-bottom: 2px solid #E5E5E5; margin:5px 0;">&nbsp;</div><br>
					Thank you for your order.  Your invoice is below.<br><br>';
            //get order info
            $sth = $dbh->prepare('SELECT date
						FROM orders
						WHERE orderID = :orderID');
            $sth->execute([':orderID' => $id]);
            $row = $sth->fetch();
            $html .= '<b>Order ID:</b> ' . $id . '<br>
						<b>Order Date:</b> ' . formatDate($row['date']) . '<br><br>
						<table style="width:100%;">
							<thead>
								<tr style="font-weight:bold;">
									<th style="width:40%;">Item</th>
									<th style="text-align:center; width:20%;">Quantity</th>
									<th style="text-align:center; width:20%;">Unit Price</th>
									<th style="text-align:right; width:20%;">Item Total</th>
								</tr>
							</thead>
							<tbody>';
            //get line items
            $lineItemTable = self::getLineItemTable($id);
            foreach ($lineItemTable[0] as $line) {
                if ($line['type'] == 'service' || $line['type'] == 'product') {
                    $recurringStr = !is_null($line['recurring']) ? ' (occurs monthly on day ' . $line['recurring'][0] . ' from ' . formatDate($line['recurring'][1]) . ' to ' . formatDate($line['recurring'][2]) . ')' : '';
                    $dateStr = isset($line['date']) ? formatDate($line['date']) . ': ' : '';
                    $html .= '<tr><td style="width:40%;">' . $dateStr . $line['name'] . $recurringStr . '</td>';
                    $html .= '<td style="text-align:center; width:20%;">' . formatNumber($line['quantity']) . '</td>';
                    $html .= '<td style="text-align:center; width:20%;">' . formatCurrency($line['unitPrice']) . '</td>';
                    $html .= '<td style="text-align:right; width:20%;">' . formatCurrency($line['lineAmount']) . '</td></tr>';
                } elseif ($line['type'] == 'discount') {
                    $unitPrice = $line['discountType'] == 'C' ? formatCurrency(-$line['discountAmount']) : $line['discountAmount'] . '%';
                    $html .= '<tr><td>Discount: ' . $line['name'] . '</td><td></td>';
                    $html .= '<td style="text-align:center;">' . $unitPrice . '</td>';
                    $html .= '<td style="text-align:right;">' . formatCurrency(-$line['lineAmount']) . '</td></tr>';
                }
            }
            $html .= '</tbody>
						</table>';
            //find amount paid
            $sth = $dbh->prepare('SELECT SUM(paymentAmount)
							FROM orderPayments
							WHERE orderID = :orderID');
            $sth->execute([':orderID' => $id]);
            $row = $sth->fetch();
            $paidAmount = $row['SUM(paymentAmount)'];
            //print totals
            $html .= '<table style="width:100%; text-align:right;"><tbody>';
            $html .= '<tr><td>Total:</td><td>' . formatCurrency($lineItemTable[1]) . '</td></tr>';
            $html .= '<tr><td>Amount Paid:</td><td>' . formatCurrency($paidAmount, true) . '</td></tr>';
            $html .= '<tr style="font-weight: bold;"><td>Amount Due:</td><td>' . formatCurrency($lineItemTable[1] - $paidAmount, true) . '</td></tr>';
            $html .= '</tbody></table>
					</div>
				</body>
				';
        }
        return [$filename, $html];
    }
开发者ID:jewelhuq,项目名称:erp,代码行数:71,代码来源:Order.php


示例14: foreach

    ?>

    <?php 
    $this->widget('app.widgets.FlashMessages.FlashMessages');
    ?>

    <?php 
    echo CHtml::beginForm();
    ?>

        <?php 
    foreach ($gs['services_premium_cost'] as $row) {
        ?>

            <?php 
        $msg = Yii::t('main', '{n} день :cost|{n} дня :cost|{n} дней :cost|{n} дня :cost', array($row['days'], ':cost' => formatCurrency($row['cost'])));
        ?>
            
            <div class="button-group">
                <button type="submit" value="<?php 
        echo $row['days'];
        ?>
" class="button" name="period">
                    <span><?php 
        echo $msg;
        ?>
</span>
                </button>
            </div>

        <?php 
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:31,代码来源:premium.php


示例15: array

    // Verify user input for currency exists, is numeric, and as is a valid id
    $billingCycle = $whmcs->get_req_var('billingcycle');
    $currencyID = $whmcs->get_req_var('currency');
    if (!is_numeric($currencyID)) {
        $currency = array();
    } else {
        $currency = getCurrency('', $currencyID);
    }
    if (!$currency || !is_array($currency) || !isset($currency['id'])) {
        $currency = getCurrency();
    }
    $currencyID = $currency['id'];
    $result = select_query("tblpricing", "", array("type" => "product", "currency" => $currencyID, "relid" => $pid));
    $data = mysql_fetch_array($result);
    $price = $data[$billingCycle];
    $price = formatCurrency($price);
    widgetOutput($price);
} else {
    widgetOutput('Invalid get option. Valid options are "name", "description", "configoption", "orderurl" or "price"');
}
/**
 * The function to output the widget data to the browser in a javascript format.
 *
 * @throws WHMCS\Exception\ProgramExit
 * @param string $value the data to output
 */
function widgetOutput($value)
{
    echo "document.write('" . addslashes($value) . "');";
    throw new ProgramExit();
}
开发者ID:MarcelaGotta,项目名称:Webty,代码行数:31,代码来源:productsinfo.php


示例16: getCurrency

<style type="text/css">
table.domainpricing {
    width: 600px;
    background-color: #ccc;
}
table.domainpricing th {
    padding: 3px;
    background-color: #efefef;
    font-weight: bold;
}
table.domainpricing td {
    padding: 3px;
    background-color: #fff;
    text-align: center;
}
</style>
<script language="javascript" src="feeds/domainpricing.php"></script>
*/
$currency = $currency ? getCurrency('', $currency) : getCurrency();
$code = '<table cellspacing="1" cellpadding="0" class="domainpricing"><tr><th>TLD</th><th>Min. Years</th><th>Register</th><th>Transfer</th><th>Renew</th></tr>';
$freeamt = formatCurrency(0);
$tldslist = getTLDList();
foreach ($tldslist as $tld) {
    $tldpricing = getTLDPriceList($tld, true);
    $firstoption = current($tldpricing);
    $year = key($tldpricing);
    $transfer = $firstoption["transfer"] == $freeamt ? $_LANG['orderfree'] : $firstoption["transfer"];
    $code .= '<tr><td>' . $tld . '</td><td>' . $year . '</td><td>' . $firstoption["register"] . '</td><td>' . $transfer . '</td><td>' . $firstoption["renew"] . '</td></tr>';
}
$code .= '</table>';
echo "document.write('" . $code . "');";
开发者ID:carriercomm,项目名称:whmcs-5,代码行数:31,代码来源:domainpricing.php


示例17: Main


//.........这里部分代码省略.........
                             } else {
                                 $this->tpl->set_var("none", "none");
                             }
                             $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ','));
                             $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ','));
                             $this->tpl->set_var("taxableYear", $value->getTaxableYear());
                             // grab Dues of rptop to get totalTaxDue
                             $totalTaxDue = 0.0;
                             if (is_array($value->tdArray)) {
                                 foreach ($value->tdArray as $td) {
                                     $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object");
                                     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                     $afsXml = $AFSDetails->getAfs($td->getAfsID());
                                     $afsDomDoc = domxml_open_mem($afsXml);
                                     $afs = new AFS();
                                     $afs->parseDomDocument($afsDomDoc);
                                     if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) {
                                         $totalTaxDue = "uncalculated";
                                         break;
                                     } else {
                                         if (!($domDoc = domxml_open_mem($xmlStr))) {
                                             $totalTaxDue = "uncalculated";
                                         } else {
                                             $due = new Due();
                                             $due->parseDomDocument($domDoc);
                                             $totalTaxDue += $due->getTaxDue();
                                         }
                                     }
                                 }
                             } else {
                                 $totalTaxDue = "no TD's";
                             }
                             if (is_numeric($totalTaxDue)) {
                                 $totalTaxDue = formatCurrency($totalTaxDue);
                             }
                             $this->tpl->set_var("totalTaxDue", $totalTaxDue);
                             $this->setRPTOPListBlockPerms();
                             $this->tpl->parse("RPTOPListBlock", "RPTOPList", true);
                             $this->tpl->set_var("PersonListBlock", "");
                             $this->tpl->set_var("CompanyListBlock", "");
                         }
                     } else {
                         $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock");
                         $this->tpl->set_var("RPTOPListBlock", "huh");
                     }
                 }
             }
             break;
         case "cancel":
             header("location: CalculateRPTOP.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
             $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object");
             $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
             $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
             $this->tpl->set_var("NotFoundBlock", "");
             if (!($count = $RPTOPList->getRPTOPCount())) {
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_block("rptsTemplate", "PageNavigator" 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP formatData函数代码示例发布时间:2022-05-15
下一篇:
PHP formatCiscoHardware函数代码示例发布时间: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