$product_line[$j]["name"] = $product_name[$i]; $product_line[$j]["spec"] = $serial_no[$i]; $product_line[$j]["code"] = $productcode[$i]; $product_line[$j]["imagename"] = $imagename[$i]; $product_line[$j]["unit"] = $usageunit[$i]; $product_line[$j]["qty"] = $qty[$i] . $usageunit[$i]; $product_line[$j]["num"] = $qty[$i]; $product_line[$j]["price"] = $list_price[$i]; $product_line[$j]["total"] = $prod_total[$i]; $product_line[$j]["description"] = $prod_description[$i]; $product_focus = null; } $price_total = ec_number_format($focus->column_fields["total"]); $TOTAL = $price_total; //金额 $TOTAL_BIG = toCNcap($price_total); //大写金额 $TOTAL_BIG = iconv_ec("GBK", "UTF-8", $TOTAL_BIG); } $MODULE_LABEL = $app_strings["Memdays"]; $TBS = new clsTinyButStrong(); $TBS->NoErr = true; // no more error message displayed. // Load the template if (isset($module_enable_product) && $module_enable_product) { $TBS->LoadTemplate('modules/Memdays/' . $templatefile . '.html', 'UTF-8'); $TBS->MergeBlock('product', $product_line); } else { $TBS->LoadTemplate('modules/Memdays/' . $templatefile . '.html', 'UTF-8'); } // Final merge and download file
function margin($param) { $id = $param['id']; $margin = 0; $margin_dx = '零'; $CI =& get_instance(); $CI->load->model('loan_model', 'loan'); $where = array('id' => $id); $loan = $CI->loan->getWidgetRow($where); $plate_no = $loan['plate_no']; $loan_amount = $loan['loan_amount']; $plate_no_pre = mb_substr($plate_no, 0, 2); $plate_pre_arr = array('川A', '渝A', '渝B', '渝C', '渝D'); if (in_array($plate_no_pre, $plate_pre_arr)) { $margin = $loan_amount * 0.03; $margin_dx = toCNcap($margin); } return array('margin' => $margin, 'margin_dx' => $margin_dx); }