当前位置: 首页>>代码示例>>PHP>>正文


PHP MiscLib::getNumbers方法代码示例

本文整理汇总了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;
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:29,代码来源:ReceiptLib.php


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