本文整理汇总了PHP中MiscLib::getNumbers方法的典型用法代码示例。如果您正苦于以下问题:PHP MiscLib::getNumbers方法的具体用法?PHP MiscLib::getNumbers怎么用?PHP MiscLib::getNumbers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MiscLib
的用法示例。
在下文中一共展示了MiscLib::getNumbers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: chargeBalance
public static function chargeBalance($receipt, $program = "charge", $trans_num = '')
{
PrehLib::chargeOK();
$labels = array();
$labels['charge'] = array("Current IOU Balance:", 1);
$labels['debit'] = array("Debit available:", -1);
$db = Database::tDataConnect();
list($emp, $reg, $trans) = explode('-', $trans_num, 3);
$ar_depts = MiscLib::getNumbers(CoreLocal::get('ArDepartments'));
$checkQ = "SELECT trans_id \n FROM localtranstoday \n WHERE \n emp_no=" . (int) $emp . "\n AND register_no=" . (int) $reg . "\n AND trans_no=" . (int) $trans;
if (count($ar_depts) == 0) {
$checkQ .= " AND trans_subtype='MI'";
} else {
$checkQ .= " AND (trans_subtype='MI' OR department IN (";
foreach ($ar_depts as $ar_dept) {
$checkQ .= $ar_dept . ',';
}
$checkQ = substr($checkQ, 0, strlen($checkQ) - 1) . '))';
}
$checkR = $db->query($checkQ);
$num_rows = $db->num_rows($checkR);
$currActivity = CoreLocal::get("memChargeTotal");
$currBalance = CoreLocal::get("balance") - $currActivity;
if (($num_rows > 0 || $currBalance != 0) && CoreLocal::get("memberID") != CoreLocal::get('defaultNonMem')) {
$chargeString = $labels["{$program}"][0] . " \$" . sprintf("%.2f", $labels["{$program}"][1] * $currBalance);
$receipt = $receipt . "\n\n" . self::biggerFont(self::centerBig($chargeString)) . "\n";
}
return $receipt;
}