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

PHP format_amount函数代码示例

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

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



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

示例1: form

 public function form($id = NULL)
 {
     if ($this->input->post('btn_cancel')) {
         redirect('payments');
     }
     if ($this->mdl_payments->run_validation()) {
         $id = $this->mdl_payments->save($id);
         redirect('payments');
     }
     if (!$this->input->post('btn_submit')) {
         $prep_form = $this->mdl_payments->prep_form($id);
         if ($id and !$prep_form) {
             show_404();
         }
     }
     $this->load->model('invoices/mdl_invoices');
     $this->load->model('payment_methods/mdl_payment_methods');
     $open_invoices = $this->mdl_invoices->where('ip_invoice_amounts.invoice_balance >', 0)->get()->result();
     $amounts = array();
     $invoice_payment_methods = array();
     foreach ($open_invoices as $open_invoice) {
         $amounts['invoice' . $open_invoice->invoice_id] = format_amount($open_invoice->invoice_balance);
         $invoice_payment_methods['invoice' . $open_invoice->invoice_id] = $open_invoice->payment_method;
     }
     $this->layout->set(array('payment_id' => $id, 'payment_methods' => $this->mdl_payment_methods->get()->result(), 'open_invoices' => $open_invoices, 'amounts' => json_encode($amounts), 'invoice_payment_methods' => json_encode($invoice_payment_methods)));
     if ($id) {
         $this->layout->set('payment', $this->mdl_payments->where('ip_payments.payment_id', $id)->get()->row());
     }
     $this->layout->buffer('content', 'payments/form');
     $this->layout->render();
 }
开发者ID:lukasz-schab,项目名称:DeskdooInvoices,代码行数:31,代码来源:payments.php


示例2: get_total_amount_of

 private function get_total_amount_of($type, $date)
 {
     $mysqli = Connector::get_connection();
     $query_result = $mysqli->query("SELECT sum(amount) FROM {$type}s  WHERE date = '{$date}' AND user_id = {$_SESSION['id_user']}");
     $result = $query_result->fetch_assoc();
     return format_amount($result['sum(amount)']);
     $mysqli->close();
 }
开发者ID:andriykonoz,项目名称:cashTracer,代码行数:8,代码来源:model_statistic.php


示例3: testFormatAmount

 public function testFormatAmount()
 {
     $this->assertEquals(format_amount(123.45), '123,45', 'pos: 1');
     $this->assertEquals(format_amount(123), '123,00', 'pos: 2');
     $this->assertEquals(format_amount(5678), '5 678,00', 'pos: 3');
     $this->assertEquals(format_amount(-123.1), '-123,10', 'pos: 4');
     $this->assertEquals(format_amount('3456.1'), '3 456,10', 'pos: 5');
 }
开发者ID:lukasz-schab,项目名称:DeskdooInvoices,代码行数:8,代码来源:NumberHelperTest.php


示例4: process_item_selections

 public function process_item_selections()
 {
     $this->load->model('mdl_item_lookups');
     $items = $this->mdl_item_lookups->where_in('item_lookup_id', $this->input->post('item_lookup_ids'))->get()->result();
     foreach ($items as $item) {
         $item->item_price = format_amount($item->item_price);
     }
     echo json_encode($items);
 }
开发者ID:Thewafflication,项目名称:InvoicePlane,代码行数:9,代码来源:ajax.php


示例5: process_product_selections

 public function process_product_selections()
 {
     $this->load->model('mdl_products');
     $products = $this->mdl_products->where_in('product_id', $this->input->post('product_ids'))->get()->result();
     foreach ($products as $product) {
         $product->product_price = format_amount($product->product_price);
     }
     echo json_encode($products);
 }
开发者ID:lukasz-schab,项目名称:DeskdooInvoices,代码行数:9,代码来源:ajax.php


示例6: prep_form

 public function prep_form($id = NULL)
 {
     $return = FALSE;
     if ($id) {
         $return = parent::prep_form($id);
         $this->set_form_value('item_price', format_amount($this->form_value('item_price')));
     }
     return $return;
 }
开发者ID:webesen,项目名称:InvoicePlane,代码行数:9,代码来源:mdl_item_lookups.php


示例7: form

 public function form($id = null)
 {
     if ($this->input->post('btn_cancel')) {
         redirect('payments');
     }
     if ($this->mdl_payments->run_validation()) {
         $id = $this->mdl_payments->save($id);
         $this->load->model('custom_fields/mdl_payment_custom');
         $this->mdl_payment_custom->save_custom($id, $this->input->post('custom'));
         redirect('payments');
     }
     if (!$this->input->post('btn_submit')) {
         $prep_form = $this->mdl_payments->prep_form($id);
         if ($id and !$prep_form) {
             show_404();
         }
         $this->load->model('custom_fields/mdl_payment_custom');
         $payment_custom = $this->mdl_payment_custom->where('payment_id', $id)->get();
         if ($payment_custom->num_rows()) {
             $payment_custom = $payment_custom->row();
             unset($payment_custom->payment_id, $payment_custom->payment_custom_id);
             foreach ($payment_custom as $key => $val) {
                 $this->mdl_payments->set_form_value('custom[' . $key . ']', $val);
             }
         }
     } else {
         if ($this->input->post('custom')) {
             foreach ($this->input->post('custom') as $key => $val) {
                 $this->mdl_payments->set_form_value('custom[' . $key . ']', $val);
             }
         }
     }
     $this->load->model('invoices/mdl_invoices');
     $this->load->model('payment_methods/mdl_payment_methods');
     $this->load->model('custom_fields/mdl_custom_fields');
     $open_invoices = $this->mdl_invoices->where('ip_invoice_amounts.invoice_balance >', 0)->get()->result();
     $amounts = array();
     $invoice_payment_methods = array();
     foreach ($open_invoices as $open_invoice) {
         $amounts['invoice' . $open_invoice->invoice_id] = format_amount($open_invoice->invoice_balance);
         $invoice_payment_methods['invoice' . $open_invoice->invoice_id] = $open_invoice->payment_method;
     }
     $this->layout->set(array('payment_id' => $id, 'payment_methods' => $this->mdl_payment_methods->get()->result(), 'open_invoices' => $open_invoices, 'custom_fields' => $this->mdl_custom_fields->by_table('ip_payment_custom')->get()->result(), 'amounts' => json_encode($amounts), 'invoice_payment_methods' => json_encode($invoice_payment_methods)));
     if ($id) {
         $this->layout->set('payment', $this->mdl_payments->where('ip_payments.payment_id', $id)->get()->row());
     }
     $this->layout->buffer('content', 'payments/form');
     $this->layout->render();
 }
开发者ID:Thewafflication,项目名称:InvoicePlane,代码行数:49,代码来源:payments.php


示例8: affichage_histo

function affichage_histo($user)
{
    $histo = get_histo($user);
    $return = "<table id='historique' class='table table-striped'>";
    foreach ($histo as $elt) {
        $return .= '<tr>';
        if ($elt['type'] == "DEPENSE") {
            $return .= '<td>' . date('d/m/y H:i', $elt[0]) . '</td><td>' . $elt[1] . ' (' . $elt[4] . ')</td><td><span class="label label-important"> <i class="icon-minus icon-white"></i> ' . format_amount($elt[6]) . ' €</span></td>';
        } else {
            $return .= '<td>' . date('d/m/y H:i', $elt[0]) . '</td><td>Rechargement</td><td><span class="label label-success"> <i class="icon-plus icon-white"></i> ' . format_amount($elt[5]) . ' €</span></td>';
        }
        $return .= "</tr>";
    }
    $return .= "</table>";
    $return .= '<div class="pagination pagination-centered"><ul id="paging"></ul></div>';
    return $return;
}
开发者ID:buckutt,项目名称:Archives,代码行数:17,代码来源:sadmin.php


示例9: date_from_mysql

					<input type="text" name="payment_date" id="payment_date" value="<?php 
echo date_from_mysql($this->mdl_payments->form_value('payment_date'));
?>
" readonly>
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php 
echo lang('amount');
?>
: </label>
				<div class="controls">
					<input type="text" name="payment_amount" id="payment_amount" value="<?php 
echo format_amount($this->mdl_payments->form_value('payment_amount'));
?>
">
				</div>
			</div>

			<div class="control-group">

				<label class="control-label"><?php 
echo lang('payment_method');
?>
: </label>
				<div class="controls">
					<select name="payment_method_id">
						<option value="0"></option>
						<?php 
开发者ID:yalmasri,项目名称:fusioninvoice,代码行数:31,代码来源:form.php


示例10: format_date

        echo format_date($invoice['invoice_date_created']);
        ?>
</td>
                        <td><a href="<?php 
        echo site_url('clients/editclient/' . $invoice['client_id']);
        ?>
"><?php 
        echo ucwords($invoice['client_name']);
        ?>
</a></td>
                        <td class="text-right invoice_amt"><?php 
        echo format_amount($invoice['invoice_amount']);
        ?>
</td>
                        <td class="text-right amt_paid"><?php 
        echo format_amount($invoice['total_paid']);
        ?>
</td>
						<td style="width:32%">
						<a href="<?php 
        echo site_url('invoices/edit/' . $invoice['invoice_id']);
        ?>
" class="btn btn-xs btn-primary"><i class="fa fa-check"> Edit </i></a>
						<a href="javascript:;" onclick="enterPayment('<?php 
        echo $invoice['invoice_id'];
        ?>
')" class="btn btn-success btn-xs"><i class="fa fa-usd"> Enter Payment </i></a>
						<a href="javascript:;" class="btn btn-info btn-xs" onclick="viewInvoice('<?php 
        echo $invoice['invoice_id'];
        ?>
')"><i class="fa fa-search"> Preview </i></a>
开发者ID:anji12172,项目名称:finalProject,代码行数:31,代码来源:invoices.php


示例11: format_amount

        ?>
</td>
		<td class="text-right"><?php 
        echo format_amount($payment['payment_amount']);
        ?>
</td>
	  </tr>
	<?php 
        $total = $total + $payment['payment_amount'];
    }
    ?>
	<tr class="table_header">
	<td>TOTAL </td>
	<td></td>
	<td></td>
	<td class="text-right"><?php 
    echo format_amount($total);
    ?>
</td>
	</tr>
<?php 
} else {
    ?>
<tr class="no-cell-border transaction-row">
<td colspan="7"> There are no records to display at the moment.</td>
</tr>
<?php 
}
?>
</tbody>
</table>
开发者ID:anji12172,项目名称:finalProject,代码行数:31,代码来源:payments_summary.php


示例12: array

    $items_array = array();
    if ($row['invoiceId'] != '0') {
        $fromInvoice = 'Yes';
    } else {
        $fromInvoice = 'No';
    }
    if ($row['paymentAmount'] != '') {
        $paymentAmount = $curSym . format_amount($row['paymentAmount'], 2);
    } else {
        $paymentAmount = '';
    }
    if ($row['additionalFee'] != '') {
        $additionalFee = $curSym . format_amount($row['additionalFee'], 2);
    } else {
        $additionalFee = '';
    }
    $lineTotal = $curSym . format_amount($row['paymentAmount'] + $row['additionalFee'], 2);
    $items_array[] = clean($row['projectName']);
    $items_array[] = clean($row['theClient']);
    $items_array[] = clean($row['theAdmin']);
    $items_array[] = $row['paymentDate'];
    $items_array[] = clean($row['paymentFor']);
    $items_array[] = clean($row['paidBy']);
    $items_array[] = $fromInvoice;
    $items_array[] = $paymentAmount;
    $items_array[] = $additionalFee;
    $items_array[] = $lineTotal;
    $items_array[] = clean($row['paymentNotes']);
    // Output the Data to the CSV
    fputcsv($output, $items_array);
}
开发者ID:shameemreza,项目名称:clientmanagement,代码行数:31,代码来源:allPaymentsExport.php


示例13: while

					<th><?php 
    echo $dateCreatedTableHead;
    ?>
</th>
					<th><?php 
    echo $dateDueText;
    ?>
</th>
					<th><?php 
    echo $statusText;
    ?>
</th>
				</tr>
				<?php 
    while ($row = mysqli_fetch_assoc($res)) {
        $projectFee = $curSym . format_amount($row['projectFee'], 2);
        if ($row['archiveProj'] == '1') {
            $archived = '<strong class="text-danger">' . $closedArchivedText . '</strong>';
        } else {
            $archived = $activeProjectText;
        }
        ?>
					<tr>
						<td data-th="<?php 
        echo $projectText;
        ?>
">
							<span data-toggle="tooltip" data-placement="right" title="<?php 
        echo $viewProject;
        ?>
">
开发者ID:shameemreza,项目名称:clientmanagement,代码行数:31,代码来源:projectReport.php


示例14: decryptIt

    $clientAddress = '';
}
if ($row['clientPhone'] != '') {
    $clientPhone = decryptIt($row['clientPhone']);
} else {
    $clientPhone = '';
}
// Format the Amounts
$paymentAmount = $curSym . format_amount($row['paymentAmount'], 2);
if ($row['additionalFee'] != '') {
    $additionalFee = $curSym . format_amount($row['additionalFee'], 2);
} else {
    $additionalFee = $noneText;
}
$total = $row['paymentAmount'] + $row['additionalFee'];
$totalPaid = $curSym . format_amount($total, 2);
// Get Site Alert Data
$alert = "SELECT\n                    isActive,\n                    invoicePrint,\n                    alertText,\n\t\t\t\t\tUNIX_TIMESTAMP(alertDate) AS orderDate,\n\t\t\t\t\talertExpires\n                FROM\n                    sitealerts\n                WHERE\n\t\t\t\t\tinvoicePrint = 1\n\t\t\t\tORDER BY\n\t\t\t\t\torderDate DESC";
$alertres = mysqli_query($mysqli, $alert) or die('-2' . mysqli_error());
include 'includes/navigation.php';
if ($row['clientId'] != $clientId) {
    ?>
	<div class="content">
		<h3><?php 
    echo $accessErrorHeader;
    ?>
</h3>
		<div class="alertMsg danger">
			<i class="fa fa-warning"></i> <?php 
    echo $permissionDenied;
    ?>
开发者ID:shameemreza,项目名称:clientmanagement,代码行数:31,代码来源:receipt.php


示例15: mysqli_query

        // Get the Invoice Total
        $x = "SELECT\n\t\t\t\t\t\t\t\t\titemAmount,\n\t\t\t\t\t\t\t\t\titemqty\n\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\tinvitems\n\t\t\t\t\t\t\t\tWHERE invoiceId = " . $row['invoiceId'];
        $y = mysqli_query($mysqli, $x) or die('-3' . mysqli_error());
        $lineTotal = 0;
        while ($z = mysqli_fetch_assoc($y)) {
            $lineItem = $z['itemAmount'] * $z['itemqty'];
            $lineTotal += $lineItem;
        }
        $lineTotal = $curSym . format_amount($lineTotal, 2);
        // Get the Payment data
        $paid = "SELECT\n\t\t\t\t\t\t\t\t\tinvoiceId,\n\t\t\t\t\t\t\t\t\tpaymentAmount,\n\t\t\t\t\t\t\t\t\tadditionalFee\n\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\tprojectpayments\n\t\t\t\t\t\t\t\tWHERE invoiceId = " . $row['invoiceId'];
        $results = mysqli_query($mysqli, $paid) or die('-2' . mysqli_error());
        $cols = mysqli_fetch_assoc($results);
        $invAmountPaid = $curSym . format_amount($cols['paymentAmount'] + $cols['additionalFee'], 2);
        if ($cols['additionalFee'] != '') {
            $additionalFee = $curSym . format_amount($cols['additionalFee'], 2);
        } else {
            $additionalFee = '';
        }
        ?>
					<tr>
						<td data-th="<?php 
        echo $invoiceTableHead;
        ?>
">
							<span data-toggle="tooltip" data-placement="right" title="View Invoice">
								<a href="index.php?action=viewInvoice&invoiceId=<?php 
        echo $row['invoiceId'];
        ?>
"><?php 
        echo clean($row['invoiceTitle']);
开发者ID:shameemreza,项目名称:clientmanagement,代码行数:31,代码来源:paidInvoicesReport.php


示例16: lang

    if ($invoice->is_read_only == 1) {
        echo 'disabled="disabled"';
    }
    ?>
>
                    </div>
                </td>
                <td class="td-amount ">
                    <div class="input-group">
                        <span class="input-group-addon"><?php 
    echo lang('item_discount');
    ?>
</span>
                        <input type="text" name="item_discount_amount" class="input-sm form-control amount"
                               value="<?php 
    echo format_amount($item->item_discount_amount);
    ?>
"
                               data-toggle="tooltip" data-placement="bottom"
                               title="<?php 
    echo $this->mdl_settings->setting('currency_symbol') . ' ' . lang('per_item');
    ?>
"
                            <?php 
    if ($invoice->is_read_only == 1) {
        echo 'disabled="disabled"';
    }
    ?>
>
                    </div>
                </td>
开发者ID:quantumsized,项目名称:InvoicePlane,代码行数:31,代码来源:partial_item_table.php


示例17: format_round_amount

/**
 * pZ: format_round_amount
 *
 * @param $amount
 *
 * @return float|null
 */
function format_round_amount($amount)
{
    $amount_round = floor($amount);
    if ($amount_round == $amount) {
        return $amount_round;
    }
    return format_amount($amount);
}
开发者ID:lukasz-schab,项目名称:DeskdooInvoices,代码行数:15,代码来源:number_helper.php


示例18: date

        echo date('d/m/Y', strtotime($quote['date_created']));
        ?>
</td>
	<td><?php 
        echo date('d/m/Y', strtotime($quote['valid_until']));
        ?>
</td>
	<td><a href="<?php 
        echo site_url('clients/editclient/' . $quote['client_id']);
        ?>
"><?php 
        echo ucwords($quote['client_name']);
        ?>
</a></td>
	<td class="text-right"><?php 
        echo format_amount($quote['quote_amount']);
        ?>
</td>
	<td style="width:25%">
	<a href="<?php 
        echo site_url('quotes/edit/' . $quote['quote_id']);
        ?>
" class="btn btn-xs btn-primary"><i class="fa fa-check"> Edit </i></a>
	<a href="javascript:;" class="btn btn-info btn-xs" onclick="viewQuote('<?php 
        echo $quote['quote_id'];
        ?>
')"><i class="fa fa-search"> Preview </i></a>
	<a href="<?php 
        echo site_url('quotes/viewpdf/' . $quote['quote_id']);
        ?>
" class="btn btn-warning btn-xs">Download pdf </a>
开发者ID:anji12172,项目名称:finalProject,代码行数:31,代码来源:filtered_quotes.php


示例19: format_amount

?>
</label></td></tr>
	<tr><td colspan="6" class="text-right no-border">INVOICE DISCOUNT : </td><td class="text-right no-border"><label><?php 
echo format_amount($invoice_details['invoice_details']->invoice_discount);
?>
</label></td></tr>
	<tr><td colspan="6" class="text-right no-border">NEW SUB TOTAL : </td><td class="text-right"><label><?php 
echo format_amount($invoice_details['invoice_totals']['sub_total'] - $invoice_details['invoice_details']->invoice_discount);
?>
</label></td></tr>
	<tr><td colspan="6" class="text-right no-border">AMOUNT PAID : </td><td class="text-right no-border invoice_amount_paid"><label><?php 
echo format_amount($invoice_details['invoice_totals']['amount_paid']);
?>
</label></td></tr>
	<tr><td colspan="6" class="text-right no-border">AMOUNT DUE : </td><td class="text-right invoice_amount_due"><label><?php 
echo format_amount($invoice_details['invoice_totals']['amount_due']);
?>
</label></td>
	</tr>
<tr class="table_header"><td colspan="7"></td></tr>
<tr><td colspan="7">
<h4>Invoice Terms </h4>
<?php 
echo $invoice_details['invoice_details']->invoice_terms;
?>
<hr/>
</td></tr>
</div>
</div>
</div>
</div>
开发者ID:anji12172,项目名称:finalProject,代码行数:31,代码来源:previewinvoice.php


示例20: foreach

<?php 
// First loop through data: calculate totals
$defaultTotal = 0.0;
$budgetTotal = 0.0;
// Need the abs_total to calculate row percentages
foreach ($budget_list as $account_data) {
    // account_list (account_name, account_total, account_id)
    $defaultTotal += $account_data[1];
    $budgetTotal += $account_data[2];
}
// Second loop: display data
//	foreach ($account_list as $account_data)
foreach ($budget_list as $account_id => $budget_data) {
    $accountName = htmlspecialchars($budget_data[0]);
    $defaultBudget = format_amount($budget_data[1]);
    $budgetAmount = format_amount($budget_data[2]);
    $budgetStyle = '';
    if ($defaultBudget != $budgetAmount) {
        // This month's budget is not the default
        $budgetStyle = 'color: red;"';
    }
    $budgetId = $budget_data[3];
    $accountDescr = htmlspecialchars($budget_data[4]);
    $budgetComment = htmlspecialchars($budget_data[5]);
    $newBudget = $budgetAmount;
    if ($budgetAmount == null) {
        // Apply default to budget when undefined
        $newBudget = $defaultBudget;
    }
    echo "\t<tr> \n" . "\t\t<input type='hidden' name='accountIds[]' value='{$account_id}' />" . "\t\t<input type='hidden' name='budgetIds[]' value='{$budgetId}' />" . "\t\t<td title=\"{$accountDescr}\">{$accountName}</td> \n" . "\t\t<td><input type='text' name='defaultBudgets[]' " . "maxlength='9' value='{$defaultBudget}' size='10' /></td> \n" . "\t\t<td style='text-align: right; {$budgetStyle}'>{$budgetAmount}</td> \n" . "\t\t<td><input type='text' name='budgetAmounts[]' " . "maxlength='9' value='{$newBudget}' size='10' /></td> \n" . "\t\t<td><input style='text-align: left;' type='text' name='budgetComments[]' " . "maxlength='100' size='50' value=\"{$budgetComment}\" /></td> \n" . "\t</tr> \n\n";
}
开发者ID:fedoracooper,项目名称:cooper-accounting-php,代码行数:31,代码来源:edit_budgets.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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