本文整理汇总了PHP中percent_format函数的典型用法代码示例。如果您正苦于以下问题:PHP percent_format函数的具体用法?PHP percent_format怎么用?PHP percent_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了percent_format函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: end_table
end_table();
//------------------------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Sales Person"));
//------------------------------------------------------------------------------------------------
start_form();
if (isset($selected_id)) {
//editing an existing Sales-person
$sql = "SELECT * FROM salesman WHERE salesman_code='{$selected_id}'";
$result = db_query($sql, "could not get sales person");
$myrow = db_fetch($result);
$_POST['salesman_name'] = $myrow["salesman_name"];
$_POST['salesman_phone'] = $myrow["salesman_phone"];
$_POST['salesman_fax'] = $myrow["salesman_fax"];
$_POST['salesman_email'] = $myrow["salesman_email"];
$_POST['provision'] = percent_format($myrow["provision"]);
$_POST['break_pt'] = price_format($myrow["break_pt"]);
$_POST['provision2'] = percent_format($myrow["provision2"]);
hidden('selected_id', $selected_id);
}
start_table("{$table_style2} width=60%");
text_row_ex(tr("Sales person name:"), 'salesman_name', 30);
text_row_ex(tr("Telephone number:"), 'salesman_phone', 20);
text_row_ex(tr("Fax number:"), 'salesman_fax', 20);
text_row_ex(tr("Email:"), 'salesman_email', 40);
percent_row(tr("Provision"), 'provision');
amount_row(tr("Break Pt.:"), 'break_pt');
percent_row(tr("Provision") . " 2", 'provision2');
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
end_page();
示例2: customer_branches_list_row
if (list_updated('customer_id') || $new && list_updated('bank_account')) {
$_SESSION['alloc']->read();
$_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = '';
$Ajax->activate('alloc_tbl');
}
if (db_customer_has_branches($_POST['customer_id'])) {
customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true);
} else {
hidden('BranchID', ANY_NUMERIC);
}
read_customer_data();
set_global_customer($_POST['customer_id']);
if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) {
display_warning(_("This customer account is on hold."));
}
$display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%";
table_section(2);
if (!list_updated('bank_account')) {
$_POST['bank_account'] = get_default_customer_bank_account($_POST['customer_id']);
}
//Chaitanya : 13-OCT-2011 - Is AJAX call really needed ???
//bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true);
bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, false);
text_row(_("Reference:"), 'ref', null, 20, 40);
table_section(3);
date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true);
$comp_currency = get_company_currency();
$cust_currency = get_customer_currency($_POST['customer_id']);
$bank_currency = get_bank_account_currency($_POST['bank_account']);
if ($cust_currency != $bank_currency) {
exchange_rate_display($bank_currency, $cust_currency, $_POST['DateBanked'], $bank_currency == $comp_currency);
示例3: text_cells
if ($ln_itm->descr_editable) {
text_cells(null, 'Line' . $line . 'Desc', $ln_itm->item_description, 30, 50);
} else {
label_cell($ln_itm->item_description);
}
$dec = get_qty_dec($ln_itm->stock_id);
qty_cell($ln_itm->quantity, false, $dec);
label_cell($ln_itm->units);
qty_cell($ln_itm->qty_done, false, $dec);
if (isset($_POST['clear_quantity'])) {
$ln_itm->qty_dispatched = 0;
}
$_POST['Line' . $line] = $ln_itm->qty_dispatched;
/// clear post so value displayed in the fiel is the 'new' quantity
small_qty_cells(null, 'Line' . $line, qty_format($ln_itm->qty_dispatched, $ln_itm->stock_id, $dec), null, null, $dec);
$display_discount_percent = percent_format($ln_itm->discount_percent * 100) . "%";
$line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent);
amount_cell($ln_itm->price);
label_cell($ln_itm->tax_type_name);
label_cell($display_discount_percent, "nowrap align=right");
amount_cell($line_total);
end_row();
}
$_POST['ChargeFreightCost'] = get_post('ChargeFreightCost', price_format($_SESSION['Items']->freight_cost));
$colspan = 9;
start_row();
label_cell(_("Shipping Cost"), "colspan={$colspan} align=right");
small_amount_cells(null, 'ChargeFreightCost', $_SESSION['Items']->freight_cost);
end_row();
$inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
$display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost'));
示例4: percent_format
$_POST['creditors_act'] = $myrow["creditors_act"];
$_POST['freight_act'] = $myrow["freight_act"];
$_POST['pyt_discount_act'] = $myrow["pyt_discount_act"];
$_POST['exchange_diff_act'] = $myrow["exchange_diff_act"];
$_POST['bank_charge_act'] = $myrow["bank_charge_act"];
$_POST['default_sales_act'] = $myrow["default_sales_act"];
$_POST['default_sales_discount_act'] = $myrow["default_sales_discount_act"];
$_POST['default_prompt_payment_act'] = $myrow["default_prompt_payment_act"];
$_POST['default_inventory_act'] = $myrow["default_inventory_act"];
$_POST['default_cogs_act'] = $myrow["default_cogs_act"];
$_POST['default_adj_act'] = $myrow["default_adj_act"];
$_POST['default_inv_sales_act'] = $myrow['default_inv_sales_act'];
$_POST['default_assembly_act'] = $myrow['default_assembly_act'];
$_POST['allow_negative_stock'] = $myrow['allow_negative_stock'];
$_POST['po_over_receive'] = percent_format($myrow['po_over_receive']);
$_POST['po_over_charge'] = percent_format($myrow['po_over_charge']);
$_POST['past_due_days'] = $myrow['past_due_days'];
$_POST['grn_clearing_act'] = $myrow['grn_clearing_act'];
$_POST['default_credit_limit'] = $myrow['default_credit_limit'];
$_POST['legal_text'] = $myrow['legal_text'];
$_POST['accumulate_shipping'] = $myrow['accumulate_shipping'];
$_POST['default_workorder_required'] = $myrow['default_workorder_required'];
$_POST['default_dim_required'] = $myrow['default_dim_required'];
$_POST['default_delivery_required'] = $myrow['default_delivery_required'];
//---------------
table_section_title(_("General GL"));
text_row(_("Past Due Days Interval:"), 'past_due_days', $_POST['past_due_days'], 6, 6, '', "", _("days"));
gl_all_accounts_list_row(_("Retained Earnings:"), 'retained_earnings_act', $_POST['retained_earnings_act']);
gl_all_accounts_list_row(_("Profit/Loss Year:"), 'profit_loss_year_act', $_POST['profit_loss_year_act']);
gl_all_accounts_list_row(_("Exchange Variances Account:"), 'exchange_diff_act', $_POST['exchange_diff_act']);
gl_all_accounts_list_row(_("Bank Charges Account:"), 'bank_charge_act', $_POST['bank_charge_act']);
示例5: customer_settings
function customer_settings($selected_id)
{
global $SysPrefs, $path_to_root, $auto_create_branch;
if (!$selected_id) {
if (list_updated('customer_id') || !isset($_POST['CustName'])) {
$_POST['CustName'] = $_POST['cust_ref'] = $_POST['address'] = $_POST['tax_id'] = '';
$_POST['dimension_id'] = 0;
$_POST['dimension2_id'] = 0;
$_POST['sales_type'] = -1;
$_POST['curr_code'] = get_company_currency();
$_POST['credit_status'] = -1;
$_POST['payment_terms'] = $_POST['notes'] = '';
$_POST['discount'] = $_POST['pymt_discount'] = percent_format(0);
$_POST['credit_limit'] = price_format($SysPrefs->default_credit_limit());
}
} else {
$myrow = get_customer($selected_id);
$_POST['CustName'] = $myrow["name"];
$_POST['cust_ref'] = $myrow["debtor_ref"];
$_POST['address'] = $myrow["address"];
$_POST['tax_id'] = $myrow["tax_id"];
$_POST['dimension_id'] = $myrow["dimension_id"];
$_POST['dimension2_id'] = $myrow["dimension2_id"];
$_POST['sales_type'] = $myrow["sales_type"];
$_POST['curr_code'] = $myrow["curr_code"];
$_POST['credit_status'] = $myrow["credit_status"];
$_POST['payment_terms'] = $myrow["payment_terms"];
$_POST['discount'] = percent_format($myrow["discount"] * 100);
$_POST['pymt_discount'] = percent_format($myrow["pymt_discount"] * 100);
$_POST['credit_limit'] = price_format($myrow["credit_limit"]);
$_POST['notes'] = $myrow["notes"];
$_POST['inactive'] = $myrow["inactive"];
}
start_outer_table(TABLESTYLE2);
table_section(1);
table_section_title(_("Name and Address"));
text_row(_("Customer Name:"), 'CustName', $_POST['CustName'], 40, 80);
text_row(_("Customer Short Name:"), 'cust_ref', null, 30, 30);
textarea_row(_("Address:"), 'address', $_POST['address'], 35, 5);
text_row(_("GSTNo:"), 'tax_id', null, 40, 40);
if (!$selected_id || is_new_customer($selected_id)) {
currencies_list_row(_("Customer's Currency:"), 'curr_code', $_POST['curr_code']);
} else {
label_row(_("Customer's Currency:"), $_POST['curr_code']);
hidden('curr_code', $_POST['curr_code']);
}
sales_types_list_row(_("Sales Type/Price List:"), 'sales_type', $_POST['sales_type']);
if ($selected_id) {
record_status_list_row(_("Customer status:"), 'inactive');
} elseif (isset($auto_create_branch) && $auto_create_branch == 1) {
table_section_title(_("Branch"));
text_row(_("Phone:"), 'phone', null, 32, 30);
text_row(_("Secondary Phone Number:"), 'phone2', null, 32, 30);
text_row(_("Fax Number:"), 'fax', null, 32, 30);
email_row(_("E-mail:"), 'email', null, 35, 55);
sales_persons_list_row(_("Sales Person:"), 'salesman', null);
}
table_section(2);
table_section_title(_("Sales"));
percent_row(_("Discount Percent:"), 'discount', $_POST['discount']);
percent_row(_("Prompt Payment Discount Percent:"), 'pymt_discount', $_POST['pymt_discount']);
amount_row(_("Credit Limit:"), 'credit_limit', $_POST['credit_limit']);
payment_terms_list_row(_("Payment Terms:"), 'payment_terms', $_POST['payment_terms']);
credit_status_list_row(_("Credit Status:"), 'credit_status', $_POST['credit_status']);
$dim = get_company_pref('use_dimension');
if ($dim >= 1) {
dimensions_list_row(_("Dimension") . " 1:", 'dimension_id', $_POST['dimension_id'], true, " ", false, 1);
}
if ($dim > 1) {
dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', $_POST['dimension2_id'], true, " ", false, 2);
}
if ($dim < 1) {
hidden('dimension_id', 0);
}
if ($dim < 2) {
hidden('dimension2_id', 0);
}
if ($selected_id) {
start_row();
echo '<td class="label">' . _('Customer branches') . ':</td>';
hyperlink_params_td($path_to_root . "/sales/manage/customer_branches.php", '<b>' . (@$_REQUEST['popup'] ? _("Select or &Add") : _("&Add or Edit ")) . '</b>', "debtor_no=" . $selected_id . (@$_REQUEST['popup'] ? '&popup=1' : ''));
end_row();
}
textarea_row(_("General Notes:"), 'notes', null, 35, 5);
if (!$selected_id && isset($auto_create_branch) && $auto_create_branch == 1) {
table_section_title(_("Branch"));
locations_list_row(_("Default Inventory Location:"), 'location');
shippers_list_row(_("Default Shipping Company:"), 'ship_via');
sales_areas_list_row(_("Sales Area:"), 'area', null);
tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null);
}
end_outer_table(1);
div_start('controls');
if (!$selected_id) {
submit_center('submit', _("Add New Customer"), true, '', 'default');
} else {
submit_center_first('submit', _("Update Customer"), _('Update customer data'), @$_REQUEST['popup'] ? true : 'default');
submit_return('select', $selected_id, _("Select this customer and return to document entry."));
submit_center_last('delete', _("Delete Customer"), _('Delete customer data if have been never used'), true);
}
//.........这里部分代码省略.........
示例6: hidden
}
hidden('selected_id', $selected_id);
}
text_row_ex(tr("Description:"), 'name', 40);
yesno_list_row(tr("Tax Shipping:"), 'tax_shipping', null, "", "", true);
end_table();
display_note(tr("Select the taxes that are included in this group."), 1);
start_table($table_style2);
$th = array(tr("Tax"), tr("Default Rate (%)"), tr("Rate (%)"));
table_header($th);
for ($i = 0; $i < 5; $i++) {
start_row();
if (!isset($_POST['tax_type_id' . $i])) {
$_POST['tax_type_id' . $i] = 0;
}
tax_types_list_cells(null, 'tax_type_id' . $i, $_POST['tax_type_id' . $i], true, tr("None"), true);
if ($_POST['tax_type_id' . $i] != 0 && $_POST['tax_type_id' . $i] != reserved_words::get_all_numeric()) {
$default_rate = get_tax_type_default_rate($_POST['tax_type_id' . $i]);
label_cell(percent_format($default_rate), "nowrap align=right");
if (!isset($_POST['rate' . $i]) || $_POST['rate' . $i] == "") {
$_POST['rate' . $i] = percent_format($default_rate);
}
small_amount_cells(null, 'rate' . $i, $_POST['rate' . $i], null, null, user_percent_dec());
}
end_row();
}
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
//------------------------------------------------------------------------------------
end_page();
示例7: display_item_form
function display_item_form()
{
global $table_style2;
start_table($table_style2, 5, 7);
echo "<tr><td valign=top>";
// outer table
echo "<table>";
if (!isset($_POST['customer_id'])) {
$_POST['customer_id'] = get_global_customer(false);
}
if (!isset($_POST['DateBanked'])) {
$_POST['DateBanked'] = Today();
if (!is_date_in_fiscalyear($_POST['DateBanked'])) {
$_POST['DateBanked'] = end_fiscalyear();
}
}
customer_list_row(tr("From Customer:"), 'customer_id', null, false, true);
if (db_customer_has_branches($_POST['customer_id'])) {
customer_branches_list_row(tr("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true);
} else {
hidden('BranchID', reserved_words::get_any_numeric());
}
read_customer_data();
set_global_customer($_POST['customer_id']);
if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) {
echo "</table></table>";
display_note(tr("This customer account is on hold."), 0, 0, "class='redfb'");
} else {
$display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%";
amount_row(tr("Amount:"), 'amount');
amount_row(tr("Amount of Discount:"), 'discount');
label_row(tr("Customer prompt payment discount :"), $display_discount_percent);
date_row(tr("Date of Deposit:"), 'DateBanked');
echo "</table>";
echo "</td><td valign=top class='tableseparator'>";
// outer table
echo "<table>";
bank_accounts_list_row(tr("Into Bank Account:"), 'bank_account', null, true);
$cust_currency = get_customer_currency($_POST['customer_id']);
$bank_currency = get_bank_account_currency($_POST['bank_account']);
if ($cust_currency != $bank_currency) {
exchange_rate_display($cust_currency, $bank_currency, $_POST['DateBanked']);
}
bank_trans_types_list_row(tr("Type:"), 'ReceiptType', null);
text_row(tr("Reference:"), 'ref', null, 20, 40);
textarea_row(tr("Memo:"), 'memo_', null, 22, 4);
echo "</table>";
echo "</td></tr>";
end_table();
// outer table
if ($cust_currency != $bank_currency) {
display_note(tr("Amount and discount are in customer's currency."));
}
echo "<br>";
submit_center('AddPaymentItem', tr("Add Payment"));
}
echo "<br>";
}
示例8: array
$th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount %"), _("Total"));
table_header($th);
$k = 0;
//row colour counter
$sub_total = 0;
while ($myrow2 = db_fetch($result)) {
if ($myrow2["quantity"] == 0) {
continue;
}
alt_table_row_color($k);
$value = round2((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"], user_price_dec());
$sub_total += $value;
if ($myrow2["discount_percent"] == 0) {
$display_discount = "";
} else {
$display_discount = percent_format($myrow2["discount_percent"] * 100) . "%";
}
label_cell($myrow2["stock_id"]);
label_cell($myrow2["StockDescription"]);
qty_cell($myrow2["quantity"], false, get_qty_dec($myrow2["stock_id"]));
label_cell($myrow2["units"], "align=right");
amount_cell($myrow2["unit_price"]);
label_cell($display_discount, "nowrap align=right");
amount_cell($value);
end_row();
}
//end while there are line items to print out
$display_sub_tot = price_format($sub_total);
label_row(_("Sub-total"), $display_sub_tot, "colspan=6 align=right", "nowrap align=right width=15%");
} else {
display_note(_("There are no line items on this invoice."), 1, 2);
示例9: label_cell
label_cell($myrow["name"]);
label_cell(percent_format($myrow["rate"]), "align=right");
label_cell($myrow["sales_gl_code"] . " " . $myrow["SalesAccountName"]);
label_cell($myrow["purchasing_gl_code"] . " " . $myrow["PurchasingAccountName"]);
edit_link_cell("selected_id=" . $myrow["id"]);
delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1");
end_row();
}
end_table();
//-----------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Tax Type"));
//-----------------------------------------------------------------------------------
start_form();
start_table($table_style2);
if (isset($selected_id)) {
//editing an existing status code
$myrow = get_tax_type($selected_id);
$_POST['name'] = $myrow["name"];
$_POST['rate'] = percent_format($myrow["rate"]);
$_POST['sales_gl_code'] = $myrow["sales_gl_code"];
$_POST['purchasing_gl_code'] = $myrow["purchasing_gl_code"];
hidden('selected_id', $selected_id);
}
text_row_ex(tr("Description:"), 'name', 50);
small_amount_row(tr("Default Rate:"), 'rate', '', "", "%", user_percent_dec());
gl_all_accounts_list_row(tr("Sales GL Account:"), 'sales_gl_code', null);
gl_all_accounts_list_row(tr("Purchasing GL Account:"), 'purchasing_gl_code', null);
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
end_page();
示例10: actionAnggaranRealisasi
public function actionAnggaranRealisasi()
{
if (Yii::app()->request->isAjaxRequest) {
return;
}
if (isset($_POST) && !empty($_POST)) {
$format = $_POST['format'];
$bulan = $_POST['periode_bulan'];
$tahun = $_POST['periode_tahun'];
$periode = period2date($bulan, $tahun);
$start_date = $periode['start'];
$end_date = $periode['end'];
$start = 1;
$file_name = 'AnggaranRealisasi';
$worksheet_name = 'AnggaranRealisasi';
$objPHPExcel = new PHPExcel();
$this->header($objPHPExcel, $start, $worksheet_name, "LAPORAN ANGGARAN VERSUS REALISASI");
$objPHPExcel->setActiveSheetIndex(0)->mergeCells("A{$start}:G{$start}")->setCellValue("A{$start}", "PERIODE: " . date2longperiode($start_date, 'MMMM yyyy'))->getStyle("A{$start}")->getFont()->setSize(12)->setBold(true);
$objPHPExcel->getActiveSheet()->setTitle($worksheet_name);
$start++;
$start++;
$start_body = $start;
$objPHPExcel->setActiveSheetIndex(0)->setCellValue("A{$start}", "Nama Rekening")->setCellValue("B{$start}", "Anggaran")->setCellValue("C{$start}", "Realisasi")->setCellValue("D{$start}", "%")->setCellValue("E{$start}", "Surplus(Defisit)")->getStyle("A{$start}:E{$start}")->getFont()->setBold(true);
$start++;
$rows = Pah::get_chart_master_beban();
$total_anggaran = 0;
$total_realisasi = 0;
foreach ($rows as $row) {
$anggaran = Pah::get_anggaran_by_code($bulan, $tahun, $row['account_code']);
$realisasi = Pah::get_realisasi_by_code($start_date, $end_date, $row['account_code']);
if ($anggaran == 0 && $realisasi == 0) {
continue;
}
$total_anggaran += $anggaran;
$total_realisasi += $realisasi;
$selisih = $anggaran - $realisasi;
if ($anggaran != 0) {
$persen = $realisasi / $anggaran;
}
$anggaran_format = $format == 'excel' ? $anggaran : acc_format($anggaran);
$realisasi_format = $format == 'excel' ? $realisasi : acc_format($realisasi);
$selisih_format = $format == 'excel' ? $selisih : acc_format($selisih);
if ($anggaran != 0) {
$persen_format = $format == 'excel' ? $persen : percent_format($persen, 2);
} else {
$persen_format = '#DEF';
}
$objPHPExcel->setActiveSheetIndex(0)->setCellValue("A{$start}", $row['account_name'])->setCellValue("B{$start}", $anggaran_format)->setCellValue("C{$start}", $realisasi_format)->setCellValue("D{$start}", $persen_format)->setCellValue("E{$start}", $selisih_format);
$start++;
}
$total_selisih = $total_anggaran - $total_realisasi;
$total_persen = $total_realisasi / $total_anggaran;
$total_anggaran_format = $format == 'excel' ? $total_anggaran : acc_format($total_anggaran);
$total_realisasi_format = $format == 'excel' ? $total_realisasi : acc_format($total_realisasi);
$total_selisih_format = $format == 'excel' ? $total_selisih : acc_format($total_selisih);
$total_persen_format = $format == 'excel' ? $total_persen : percent_format($total_persen, 2);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue("A{$start}", 'Total')->setCellValue("B{$start}", $total_anggaran_format)->setCellValue("C{$start}", $total_realisasi_format)->setCellValue("D{$start}", $total_persen_format)->setCellValue("E{$start}", $total_selisih_format);
$start++;
$end_body = $start - 1;
$styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN)));
$objPHPExcel->setActiveSheetIndex(0)->getStyle("A{$start_body}:E{$end_body}")->applyFromArray($styleArray);
$start_row = $start_body + 1;
if ($format == 'excel') {
$objPHPExcel->setActiveSheetIndex(0)->getStyle("B{$start_row}:E{$end_body}")->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_ACCOUNTING);
$objPHPExcel->setActiveSheetIndex(0)->getStyle("D{$start_row}:D{$end_body}")->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00);
} else {
$objPHPExcel->setActiveSheetIndex(0)->getStyle("B{$start_body}:E{$end_body}")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
}
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension("A")->setAutoSize(true);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension("B")->setAutoSize(true);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension("C")->setAutoSize(true);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension("D")->setAutoSize(true);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension("E")->setAutoSize(true);
$this->footer($objPHPExcel, $start, $file_name, $format, "Laporan Beban Aktivitas per Anak");
Yii::app()->end();
}
}
示例11: db_query
} else {
$sql = "SELECT * FROM debtors_master WHERE debtor_no = '" . $_POST['customer_id'] . "'";
$result = db_query($sql, "check failed");
$myrow = db_fetch($result);
$_POST['CustName'] = $myrow["name"];
$_POST['address'] = $myrow["address"];
$_POST['tax_id'] = $myrow["tax_id"];
$_POST['email'] = $myrow["email"];
$_POST['dimension_id'] = $myrow["dimension_id"];
$_POST['dimension2_id'] = $myrow["dimension2_id"];
$_POST['sales_type'] = $myrow["sales_type"];
$_POST['curr_code'] = $myrow["curr_code"];
$_POST['credit_status'] = $myrow["credit_status"];
$_POST['payment_terms'] = $myrow["payment_terms"];
$_POST['discount'] = percent_format($myrow["discount"] * 100);
$_POST['pymt_discount'] = percent_format($myrow["pymt_discount"] * 100);
$_POST['credit_limit'] = price_format($myrow["credit_limit"]);
}
text_row(tr("Customer Name:"), 'CustName', $_POST['CustName'], 40, 40);
textarea_row(tr("Address:"), 'address', $_POST['address'], 35, 5);
text_row(tr("Email:"), 'email', null, 40, 40);
text_row(tr("GSTNo:"), 'tax_id', null, 40, 40);
// Sherifoz 23.09.03 currency can't be changed if editing
if (isset($_POST['New'])) {
currencies_list_row(tr("Customer's Currency:"), 'curr_code', $_POST['curr_code']);
} else {
label_row(tr("Customer's Currency:"), $_POST['curr_code']);
hidden('curr_code', $_POST['curr_code']);
}
end_table();
echo "</td><td class='tableseparator'>";
示例12: get_item_tax_type_exemptions
$exemptions = get_item_tax_type_exemptions($selected_id);
if (db_num_rows($exemptions) > 0) {
while ($exmp = db_fetch($exemptions)) {
$_POST['ExemptTax' . $exmp["tax_type_id"]] = 1;
}
}
}
hidden('selected_id', $selected_id);
}
text_row_ex(_("Description:"), 'name', 50);
yesno_list_row(_("Is Fully Tax-exempt:"), 'exempt', null, "", "", true);
end_table(1);
if (!isset($_POST['exempt']) || $_POST['exempt'] == 0) {
display_note(_("Select which taxes this item tax type is exempt from."), 0, 1);
start_table(TABLESTYLE2);
$th = array(_("Tax Name"), _("Rate"), _("Is exempt"));
table_header($th);
$tax_types = get_all_tax_types_simple();
while ($myrow = db_fetch($tax_types)) {
alt_table_row_color($k);
label_cell($myrow["name"]);
label_cell(percent_format($myrow["rate"]) . " %", "nowrap align=right");
check_cells("", 'ExemptTax' . $myrow["id"], null);
end_row();
}
end_table(1);
}
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
//------------------------------------------------------------------------------------
end_page();
示例13: get_salesman
$_POST['salesman_email'] = "";
if ($selected_id != -1) {
if ($Mode == 'Edit') {
//editing an existing Sales-person
$myrow = get_salesman($selected_id);
$_POST['salesman_name'] = $myrow["salesman_name"];
$_POST['salesman_phone'] = $myrow["salesman_phone"];
$_POST['salesman_fax'] = $myrow["salesman_fax"];
$_POST['salesman_email'] = $myrow["salesman_email"];
$_POST['provision'] = percent_format($myrow["provision"]);
$_POST['break_pt'] = price_format($myrow["break_pt"]);
$_POST['provision2'] = percent_format($myrow["provision2"]);
}
hidden('selected_id', $selected_id);
} elseif ($Mode != 'ADD_ITEM') {
$_POST['provision'] = percent_format(0);
$_POST['break_pt'] = price_format(0);
$_POST['provision2'] = percent_format(0);
}
start_table(TABLESTYLE2);
text_row_ex(_("Sales person name:"), 'salesman_name', 30);
text_row_ex(_("Telephone number:"), 'salesman_phone', 20);
text_row_ex(_("Fax number:"), 'salesman_fax', 20);
email_row_ex(_("E-mail:"), 'salesman_email', 40);
percent_row(_("Provision") . ':', 'provision');
amount_row(_("Break Pt.:"), 'break_pt');
percent_row(_("Provision") . " 2:", 'provision2');
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();
示例14: percent_cell
function percent_cell($label, $bold = false, $id = null)
{
if ($bold) {
label_cell("<b>" . percent_format($label) . "</b>", "nowrap align=right", $id);
} else {
label_cell(percent_format($label), "nowrap align=right", $id);
}
}