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

PHP to_words函数代码示例

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

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



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

示例1: main_form

function main_form($x, $y, $data)
{
    global $pdf;
    global $_TITLE, $_LMARGIN, $_BMARGIN;
    $balance = $data['balance'] < 0 ? -$data['balance'] : $data['balance'];
    $font_size = 14;
    $lineh = 25;
    $x += $_LMARGIN;
    $y += $_BMARGIN;
    $y += 275;
    $pdf->addtext($x, $y, $font_size, $data['d_name']);
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, trim($data['d_zip'] . ' ' . $data['d_city'] . ' ' . $data['d_address']));
    $y -= $lineh;
    //    for($i=0; $i<26; $i++)
    //    {
    //	    $pdf->addtext($x+$i*14.6,$y,$font_size,$_ACCOUNT[$i]);
    //    }
    $pdf->addtext($x, $y, $font_size, bankaccount($data['id'], $data['account']));
    $y -= $lineh;
    $pdf->addtext($x + 220, $y, $font_size, sprintf('%.2f', $balance));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, trans('$a dollars $b cents', to_words(floor($balance)), to_words(round(($balance - floor($balance)) * 100))));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, truncate($data['customername']));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, truncate(trim($data['zip'] . ' ' . $data['city'] . ' ' . $data['address'])));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, $_TITLE);
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, trans('Customer ID: $a', sprintf('%04d', $data['id'])));
}
开发者ID:kornelek,项目名称:lms,代码行数:32,代码来源:transferforms2.php


示例2: main_form

 protected function main_form($x, $y)
 {
     $balance = $this->data['balance'] < 0 ? -$this->data['balance'] : $this->data['balance'];
     $font_size = 14;
     $lineh = 25;
     $x += ConfigHelper::getConfig('finances.leftmargin', 0, true);
     $y += ConfigHelper::getConfig('finances.bottommargin', 0, true);
     $y += 275;
     $this->backend->addText($x, $y, $font_size, $this->data['d_name']);
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trim($this->data['d_zip'] . ' ' . $this->data['d_city'] . ' ' . $this->data['d_address']));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, format_bankaccount(bankaccount($this->data['id'], $this->data['account'])));
     $y -= $lineh;
     $this->backend->addText($x + 220, $y, $font_size, sprintf('%.2f', $balance));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trans('$a dollars $b cents', to_words(floor($balance)), to_words(round(($balance - floor($balance)) * 100))));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, $this->truncate($this->data['customername']));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, $this->truncate(trim($this->data['zip'] . ' ' . $this->data['city'] . ' ' . $this->data['address'])));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, ConfigHelper::getConfig('finances.pay_title', trans('Not set')));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trans('Customer ID: $a', sprintf('%04d', $this->data['id'])));
 }
开发者ID:Akheon23,项目名称:lms,代码行数:26,代码来源:LMSEzpdfTransferForm.php


示例3: trim

$CURR = 'PLN';
// oznaczenie waluty
$SHORT_TO_WORDS = 0;
// 1 - krótki format kwoty słownej 'jed dwa trz 15/100'
// 0 - długi format kwoty słownej 'sto dwadzieścia trzy 15/100 zł'
/************** Koniec konfiguracji ****************/
$KWOTA = trim(isset($_GET['ILE']) ? $_GET['ILE'] : 0);
$USER_OD = trim(strip_tags(isset($_GET['OD']) ? $_GET['OD'] : ''));
$KWOTA_NR = str_replace(',', '.', $KWOTA);
// na wszelki wypadek
$KWOTA_GR = sprintf('%02d', round(($KWOTA_NR - floor($KWOTA_NR)) * 100));
if ($SHORT_TO_WORDS) {
    $KWOTA_ZL = to_words(floor($KWOTA_NR), 0, '', 1);
    $KWOTA_X = $KWOTA_ZL . ' ' . $KWOTA_GR . '/100';
} else {
    $KWOTA_ZL = to_words(floor($KWOTA_NR));
    $KWOTA_X = $KWOTA_ZL . ' ' . $KWOTA_GR . '/100 złotych';
}
?>

<HTML>
<HEAD>

<META http-equiv="Content-Type" content="text/html;charset=utf-8">
</HEAD>
<BODY>

<FORM><P style="font-family: Arial, Helvetica; font-size: 12pt; font-weight: bold;">W zależności od poczty/banku wpisz 1 lub 2 kopie. <input type="button" value="Drukuj" onClick="top.print();"></FORM>

<?php 
$SHIFT = 394;
开发者ID:Akheon23,项目名称:lms,代码行数:31,代码来源:druk.php


示例4: to_words

function to_words($num, $power = 0, $powsuffix = '', $short_version = 0)
{
    // Extracted from lang.lt.php by Piotr Klaban <makler at man dot torun dot pl>
    // from PEAR package Number_Words-0.15
    // added leading space trim's by alec
    $ret = '';
    $_sep = ' ';
    $_minus = 'minus';
    $_digits = array(0 => 'nulis', 'vienas', 'du', 'trys', 'keturi', 'penki', 'šeši', 'septyni', 'aštuoni', 'devyni');
    $_exponent = array(0 => array(''), 3 => array('tūkstantis', 'tūkstančiai', 'tūkstančių'), 6 => array('milijonas', 'milijonai', 'milijonų'), 9 => array('bilijonas', 'bilijonai', 'bilijonų'), 12 => array('trilijonas', 'trilijonai', 'trilijonų'), 15 => array('kvadrilijonas', 'kvadrilijonai', 'kvadrilijonų'), 18 => array('kvintilijonas', 'kvintilijonai', 'kvintilijonų'));
    if (substr($num, 0, 1) == '-') {
        $ret = $_minus;
        $num = substr($num, 1);
    }
    // strip excessive zero signs and spaces
    $num = trim($num);
    $num = preg_replace('/^0+/', '', $num);
    if (strlen($num) > 3) {
        $maxp = strlen($num) - 1;
        $curp = $maxp;
        for ($p = $maxp; $p > 0; --$p) {
            // power
            // check for highest power
            if (isset($_exponent[$p])) {
                // send substr from $curp to $p
                $snum = substr($num, $maxp - $curp, $curp - $p + 1);
                $snum = preg_replace('/^0+/', '', $snum);
                if ($snum !== '') {
                    $cursuffix = $_exponent[$power][count($_exponent[$power]) - 1];
                    if ($powsuffix != '') {
                        $cursuffix .= $_sep . $powsuffix;
                    }
                    $ret .= to_words($snum, $p, $cursuffix);
                }
                $curp = $p - 1;
                continue;
            }
        }
        $num = substr($num, $maxp - $curp, $curp - $p + 1);
        if ($num == 0) {
            return $ret;
        }
    } elseif ($num == 0 || $num == '') {
        return $_sep . $_digits[0];
    }
    $h = $t = $d = 0;
    switch (strlen($num)) {
        case 3:
            $h = (int) substr($num, -3, 1);
        case 2:
            $t = (int) substr($num, -2, 1);
        case 1:
            $d = (int) substr($num, -1, 1);
            break;
        case 0:
            return;
            break;
    }
    if ($h > 1) {
        $ret .= $_sep . $_digits[$h] . $_sep . 'šimtai';
    } elseif ($h) {
        $ret .= $_sep . 'šimtas';
    }
    // ten, twenty etc.
    switch ($t) {
        case 9:
            $ret .= $_sep . 'devyniasdešimt';
            break;
        case 8:
            $ret .= $_sep . 'aštuoniasdešimt';
            break;
        case 7:
            $ret .= $_sep . 'septyniasdešimt';
            break;
        case 6:
            $ret .= $_sep . 'šešiasdešimt';
            break;
        case 5:
            $ret .= $_sep . 'penkiasdešimt';
            break;
        case 4:
            $ret .= $_sep . 'keturiasdešimt';
            break;
        case 3:
            $ret .= $_sep . 'trisdešimt';
            break;
        case 2:
            $ret .= $_sep . 'dvidešimt';
            break;
        case 1:
            switch ($d) {
                case 0:
                    $ret .= $_sep . 'dešimt';
                    break;
                case 1:
                    $ret .= $_sep . 'vienuolika';
                    break;
                case 2:
                    $ret .= $_sep . 'dvylika';
                    break;
//.........这里部分代码省略.........
开发者ID:kornelek,项目名称:lms,代码行数:101,代码来源:ui.php


示例5: table


//.........这里部分代码省略.........
                     $this->Ln(1);
                     $this->SetDrawColor(136, 136, 136);
                 }
             }
             $font_style = '';
             if (@$config['cell_bold'] and @$params['bold']) {
                 $font_style .= 'B';
             }
             if (@$params['underline']) {
                 $font_style .= 'U';
             }
             $this->SetFont($this->FontFamily, $font_style, $this->FontSizePt);
             $this->SetTextColor($config['color'][0], $config['color'][1], $config['color'][2]);
             //                if (!isset($complited[$field])) {
             if (isset($params['value'])) {
                 if (!preg_match('~\\$row~', $params['value'])) {
                     $row[$field] = $params['value'];
                 } else {
                     eval('$row[$field] = ' . $params['value'] . ';');
                 }
             }
             if (isset($params['format'])) {
                 $string_code = str_replace('__VAL__', '$row[$field]', $params['format']) . ';';
                 eval('$value = ' . $string_code . ';');
             } else {
                 $value = isset($row[$field]) ? $row[$field] : '';
             }
             if (isset($params['exec'])) {
                 eval(str_replace('__VAL__', '$row[$field]', $params['exec']) . ';');
             }
             //                } else {
             //                    $value = $complited[$field];
             //                }
             if (in_array($field, $totals)) {
                 if (!isset($totals_val[$field])) {
                     $totals_val[$field] = 0;
                 }
                 $cur_total_val = isset($row[$field]) ? $row[$field] : $value;
                 if (!isset($config['totals_format'][$field])) {
                     $totals_val[$field] = $totals_val[$field] + $cur_total_val;
                 } else {
                     eval('$totals_val[$field] = ' . $config['totals_format'][$field] . ';');
                 }
             }
             $align = $params['align'] ? $params['align'] : $config['label_align'];
             if (!$config['multiline']) {
                 $this->Cell($params['width'], $config['cell_height'], $value, $config['border'], $k == $count_fields ? 1 : 0, $align);
             } else {
                 $this->MultilineCell($params['width'], array($config['cell_height'] - 0.5, $lineheight), $value, $config['border'], $k == $count_fields ? 1 : 0, $align);
             }
         }
     }
     if (!empty($totals_val)) {
         $this->Ln(1);
         $this->SetDrawColor(0, 0, 0);
         $this->SetFont($this->FontFamily, $config['label_bold'] ? 'B' : '', $this->FontSizePt);
         $this->SetTextColor($config['color'][0], $config['color'][1], $config['color'][2]);
         $totals_width = array();
         $count_fields = count($map);
         $map_keys = array_keys($map);
         foreach ($map as $field => $params) {
             if (!isset($current_field)) {
                 $current_field = $field;
             }
             if (!in_array($field, $totals)) {
                 if (!isset($totals_width[$current_field])) {
                     $totals_width[$current_field] = 0;
                 }
                 $totals_width[$current_field] += $map[$field]['width'];
             } else {
                 $cur_index = array_search($field, $map_keys);
                 $totals_width[$map_keys[$cur_index]] = $map[$field]['width'];
                 $current_field = @$map_keys[$cur_index + 1];
             }
         }
         $count_totals = count($totals_width);
         $ik = 0;
         foreach ($totals_width as $tf => $width) {
             $ik++;
             if (isset($map[$tf]['exec'])) {
                 eval(str_replace('__VAL__', '$row[$field]', $map[$tf]['exec']) . ';');
             }
             if ($ik == 1 and !isset($totals_val[$tf])) {
                 $txt = $config['totals_label'];
                 if (is_array($config['totals_towords'])) {
                     $txt .= ' ' . to_words($totals_val[$config['totals_towords'][0]], $config['totals_towords'][1]);
                 }
                 $align = $config['totals_label_align'];
             } else {
                 $txt = @$totals_val[$tf];
                 if (isset($map[$tf]['format']) && !isset($map[$tf]['skip_format_for_total'])) {
                     $string_code = str_replace('__VAL__', '$txt', $map[$tf]['format']) . ';';
                     eval('$txt = ' . $string_code . ';');
                 }
                 $align = @$map[$tf]['align'] ? $map[$tf]['align'] : $config['label_align'];
             }
             $this->Cell($width, $config['totals_height'], $txt, $config['border'], $ik == $count_totals ? 1 : 0, $align);
         }
     }
 }
开发者ID:Notan,项目名称:awery_pdf,代码行数:101,代码来源:AweryPdf.php


示例6: invoice_to_pay

 protected function invoice_to_pay()
 {
     $this->backend->Ln(-9);
     $this->backend->SetFont('arial', 'B', 14);
     if (isset($this->data['rebate'])) {
         $this->backend->writeHTMLCell(0, 0, '', '', trans('To repay:') . ' ' . moneyf($this->data['value']), 0, 1, 0, true, 'L');
     } else {
         $this->backend->writeHTMLCell(0, 0, '', '', trans('To pay:') . ' ' . moneyf($this->data['value']), 0, 1, 0, true, 'L');
     }
     $this->backend->SetFont('arial', '', 10);
     $this->backend->writeHTMLCell(0, 6, '', '', trans('In words:') . ' ' . trans('$a dollars $b cents', to_words(floor($this->data['value'])), to_words(round(($this->data['value'] - floor($this->data['value'])) * 100))), 0, 1, 0, true, 'L');
 }
开发者ID:pjona,项目名称:lms,代码行数:12,代码来源:LMSTcpdfInvoice.php


示例7: smarty_modifier_to_words

function smarty_modifier_to_words($num, $power = 0, $powsuffix = '', $short_version = 0)
{
    return to_words($num, $power, $powsuffix, $short_version);
}
开发者ID:Kliwer,项目名称:lms,代码行数:4,代码来源:modifier.to_words.php


示例8: invoice_to_pay

function invoice_to_pay($x, $y)
{
    global $pdf, $invoice;
    if (isset($invoice['rebate'])) {
        $y = $y - text_align_left($x, $y, 14, trans('To repay:') . ' ' . moneyf($invoice['value']));
    } else {
        $y = $y - text_align_left($x, $y, 14, trans('To pay:') . ' ' . moneyf($invoice['value']));
    }
    $y = $y - text_align_left($x, $y, 10, trans('In words:') . ' ' . trans('$a dollars $b cents', to_words(floor($invoice['value'])), to_words(round(($invoice['value'] - floor($invoice['value'])) * 100))));
    return $y;
}
开发者ID:krzysztofpuchala,项目名称:lms-1,代码行数:11,代码来源:invoice_ezpdf.inc.php


示例9: to_words

function to_words($num, $power = 0, $powsuffix = '', $short_version = 0)
{
    // Extracted from lang.pl.php by Piotr Klaban <makler at man dot torun dot pl>
    if ($short_version) {
        $patterns[0] = "/0/";
        $patterns[1] = "/1/";
        $patterns[2] = "/2/";
        $patterns[3] = "/3/";
        $patterns[4] = "/4/";
        $patterns[5] = "/5/";
        $patterns[6] = "/6/";
        $patterns[7] = "/7/";
        $patterns[8] = "/8/";
        $patterns[9] = "/9/";
        $replacements[0] = 'zer ';
        $replacements[1] = 'unu ';
        $replacements[2] = 'doi ';
        $replacements[3] = 'tre ';
        $replacements[4] = 'pat ';
        $replacements[5] = 'cin ';
        $replacements[6] = 'şas ';
        $replacements[7] = 'şap ';
        $replacements[8] = 'opt ';
        $replacements[9] = 'nou ';
        return trim(preg_replace($patterns, $replacements, $num));
    }
    $ret = '';
    $_sep = ' ';
    $_minus = 'minus';
    $_digits = array(0 => 'zero', 'unu', 'doi', 'trei', 'patru', 'cinci', 'şase', 'şapte', 'opt', 'nouă');
    $_exponent = array(0 => array(''), 3 => array('mii'), 6 => array('milioane'), 9 => array('bilioane'), 12 => array('trillioane'), 15 => array('quadrillion'), 18 => array('quintillion'), 21 => array('sextillion'), 24 => array('septillion'), 27 => array('octillion'), 30 => array('nonillion'), 33 => array('decillion'), 36 => array('undecillion'), 39 => array('duodecillion'), 42 => array('tredecillion'), 45 => array('quattuordecillion'), 48 => array('quindecillion'), 51 => array('sexdecillion'), 54 => array('septendecillion'), 57 => array('octodecillion'), 60 => array('novemdecillion'), 63 => array('vigintillion'), 66 => array('unvigintillion'), 69 => array('duovigintillion'), 72 => array('trevigintillion'), 75 => array('quattuorvigintillion'), 78 => array('quinvigintillion'), 81 => array('sexvigintillion'), 84 => array('septenvigintillion'), 87 => array('octovigintillion'), 90 => array('novemvigintillion'), 93 => array('trigintillion'), 96 => array('untrigintillion'), 99 => array('duotrigintillion'), 102 => array('trestrigintillion'), 105 => array('quattuortrigintillion'), 108 => array('quintrigintillion'), 111 => array('sextrigintillion'), 114 => array('septentrigintillion'), 117 => array('octotrigintillion'), 120 => array('novemtrigintillion'), 123 => array('quadragintillion'), 126 => array('unquadragintillion'), 129 => array('duoquadragintillion'), 132 => array('trequadragintillion'), 135 => array('quattuorquadragintillion'), 138 => array('quinquadragintillion'), 141 => array('sexquadragintillion'), 144 => array('septenquadragintillion'), 147 => array('octoquadragintillion'), 150 => array('novemquadragintillion'), 153 => array('quinquagintillion'), 156 => array('unquinquagintillion'), 159 => array('duoquinquagintillion'), 162 => array('trequinquagintillion'), 165 => array('quattuorquinquagintillion'), 168 => array('quinquinquagintillion'), 171 => array('sexquinquagintillion'), 174 => array('septenquinquagintillion'), 177 => array('octoquinquagintillion'), 180 => array('novemquinquagintillion'), 183 => array('sexagintillion'), 186 => array('unsexagintillion'), 189 => array('duosexagintillion'), 192 => array('tresexagintillion'), 195 => array('quattuorsexagintillion'), 198 => array('quinsexagintillion'), 201 => array('sexsexagintillion'), 204 => array('septensexagintillion'), 207 => array('octosexagintillion'), 210 => array('novemsexagintillion'), 213 => array('septuagintillion'), 216 => array('unseptuagintillion'), 219 => array('duoseptuagintillion'), 222 => array('treseptuagintillion'), 225 => array('quattuorseptuagintillion'), 228 => array('quinseptuagintillion'), 231 => array('sexseptuagintillion'), 234 => array('septenseptuagintillion'), 237 => array('octoseptuagintillion'), 240 => array('novemseptuagintillion'), 243 => array('octogintillion'), 246 => array('unoctogintillion'), 249 => array('duooctogintillion'), 252 => array('treoctogintillion'), 255 => array('quattuoroctogintillion'), 258 => array('quinoctogintillion'), 261 => array('sexoctogintillion'), 264 => array('septoctogintillion'), 267 => array('octooctogintillion'), 270 => array('novemoctogintillion'), 273 => array('nonagintillion'), 276 => array('unnonagintillion'), 279 => array('duononagintillion'), 282 => array('trenonagintillion'), 285 => array('quattuornonagintillion'), 288 => array('quinnonagintillion'), 291 => array('sexnonagintillion'), 294 => array('septennonagintillion'), 297 => array('octononagintillion'), 300 => array('novemnonagintillion'), 303 => array('centillion'), 309 => array('duocentillion'), 312 => array('trecentillion'), 366 => array('primo-vigesimo-centillion'), 402 => array('trestrigintacentillion'), 603 => array('ducentillion'), 624 => array('septenducentillion'), 2421 => array('sexoctingentillion'), 3003 => array('millillion'), 3000003 => array('milli-millillion'));
    if (substr($num, 0, 1) == '-') {
        $ret = $_sep . $_minus;
        $num = substr($num, 1);
    }
    // strip excessive zero signs and spaces
    $num = trim($num);
    $num = preg_replace('/^0+/', '', $num);
    if (strlen($num) > 3) {
        $maxp = strlen($num) - 1;
        $curp = $maxp;
        for ($p = $maxp; $p > 0; --$p) {
            // check for highest power
            if (isset($_exponent[$p])) {
                // send substr from $curp to $p
                $snum = substr($num, $maxp - $curp, $curp - $p + 1);
                $snum = preg_replace('/^0+/', '', $snum);
                if ($snum !== '') {
                    $cursuffix = $_exponent[$power][count($_exponent[$power]) - 1];
                    if ($powsuffix != '') {
                        $cursuffix .= $this->_sep . $powsuffix;
                    }
                    $ret .= to_words($snum, $p, $cursuffix);
                }
                $curp = $p - 1;
                continue;
            }
        }
        $num = substr($num, $maxp - $curp, $curp - $p + 1);
        $ret = trim($ret);
        if ($num == 0) {
            return $ret;
        }
    } elseif ($num == 0 || $num == '') {
        return $_digits[0];
    }
    $h = $t = $d = 0;
    switch (strlen($num)) {
        case 3:
            $h = (int) substr($num, -3, 1);
        case 2:
            $t = (int) substr($num, -2, 1);
        case 1:
            $d = (int) substr($num, -1, 1);
            break;
        case 0:
            return;
            break;
    }
    if ($h) {
        $ret .= $_sep . $_digits[$h] . $_sep . 'hundred';
        // in English only - add ' and' for [1-9]01..[1-9]99
        // (also for 1001..1099, 10001..10099 but it is harder)
        // for now it is switched off, maybe some language purists
        // can force me to enable it, or to remove it completely
        // if (($t + $d) > 0)
        //   $ret .= $_sep . 'and';
    }
    // ten, twenty etc.
    switch ($t) {
        case 9:
        case 8:
        case 7:
        case 5:
        case 4:
        case 3:
            $ret .= $_sep . $_digits[$t] . 'zeci';
            break;
        case 6:
            $ret .= $_sep . 'şaizeci';
//.........这里部分代码省略.........
开发者ID:repcio,项目名称:lms,代码行数:101,代码来源:ui.php


示例10: invoice_to_pay

function invoice_to_pay($x, $y)
{
    global $pdf, $invoice;
    $y = $y - text_align_left($x, $y, 14, iconv("UTF-8", "ISO-8859-2", trans('To pay:')) . ' ' . iconv("UTF-8", "ISO-8859-2", moneyf($invoice['total'])));
    $y = $y - text_align_left($x, $y, 10, iconv("UTF-8", "ISO-8859-2", trans('In words:')) . ' ' . iconv("UTF-8", "ISO-8859-2", trans('$a dollars $b cents', to_words(floor($invoice['total'])), to_words(round(($invoice['total'] - floor($invoice['total'])) * 100)))));
    return $y;
}
开发者ID:kornelek,项目名称:lms,代码行数:7,代码来源:invoice_pdf.php


示例11: receipt_data

 protected function receipt_data($x, $y)
 {
     $font_size = 12;
     $yy = $y;
     $xmax = $x + 420;
     $this->backend->line($x, $y, $xmax, $y);
     $y -= 8;
     $this->backend->text_align_center($x + 140, $y, 8, trans('For what'));
     $this->backend->text_align_center($x + 315, $y, 8, trans('Value'));
     $this->backend->text_align_center($x + 385, $y, 8, trans('Number'));
     $y -= 2;
     $this->backend->line($x, $y, $xmax, $y);
     $y -= $font_size;
     $i = 0;
     if ($this->data['contents']) {
         foreach ($this->data['contents'] as $item) {
             $i++;
             $this->backend->text_align_left($x + 2, $y, $font_size - 2, '<b>' . $i . '.</b>');
             $y = $this->backend->text_wrap($x + 15, $y, 270, $font_size - 2, $item['description'], '');
             $this->backend->text_align_right($x + 345, $y + $font_size, $font_size - 2, moneyf($item['value']));
         }
     }
     $y += $font_size / 2;
     $this->backend->line($x, $y, $xmax, $y);
     $y -= $font_size;
     $this->backend->text_align_right($x + 275, $y - 6, $font_size - 2, '<b>' . trans('Total:') . '</b>');
     $this->backend->text_align_right($x + 345, $y - 6, $font_size - 2, '<b>' . moneyf($this->data['total']) . '</b>');
     $y -= $this->backend->text_align_center($x + 385, $y, 8, 'Symbole');
     $y -= $this->backend->text_align_center($x + 385, $y, 8, 'PL. KAS. Nr');
     $this->backend->line($x, $yy, $x, $y);
     $this->backend->line($x + 280, $yy, $x + 280, $y);
     $this->backend->line($x + 350, $yy, $x + 350, $y);
     $this->backend->line($xmax, $yy, $xmax, $y);
     $this->backend->line($x, $y, $xmax, $y);
     $y -= 16;
     $this->backend->text_align_left($x + 2, $y, 8, trans('In words:'));
     $y = $this->backend->text_wrap($x + 40, $y, 300, $font_size - 2, trans('$a dollars $b cents', to_words(floor($this->data['total'])), to_words($this->data['totalg'])), '');
     $y -= 8;
     $y += $font_size / 2;
     $this->backend->line($x, $yy, $x, $y);
     $this->backend->line($x + 350, $yy, $x + 350, $y);
     $this->backend->line($xmax, $yy, $xmax, $y);
     $this->backend->line($x, $y, $xmax, $y);
     return $y;
 }
开发者ID:Akheon23,项目名称:lms,代码行数:45,代码来源:LMSEzpdfReceipt.php


示例12: invoice_to_pay

 protected function invoice_to_pay($x, $y)
 {
     if (isset($this->data['rebate'])) {
         $y = $y - $this->backend->text_align_left($x, $y, 14, trans('To repay:') . ' ' . moneyf($this->data['value']));
     } else {
         $y = $y - $this->backend->text_align_left($x, $y, 14, trans('To pay:') . ' ' . moneyf($this->data['value']));
     }
     $y = $y - $this->backend->text_align_left($x, $y, 10, trans('In words:') . ' ' . trans('$a dollars $b cents', to_words(floor($this->data['value'])), to_words(round(($this->data['value'] - floor($this->data['value'])) * 100))));
     return $y;
 }
开发者ID:prezeskk,项目名称:lms,代码行数:10,代码来源:LMSEzpdfInvoice.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP toba_dir函数代码示例发布时间:2022-05-23
下一篇:
PHP to_utf8_iconv函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap