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


PHP GetTotalsForTime函数代码示例

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


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

示例1: countTotals

function countTotals(&$totals, $totalsFields, $data)
{
    for ($i = 0; $i < count($totalsFields); $i++) {
        if ($totalsFields[$i]['totalsType'] == 'COUNT') {
            $totals[$totalsFields[$i]['fName']] += $data[$totalsFields[$i]['fName']] != "";
        } else {
            if ($totalsFields[$i]['viewFormat'] == "Time") {
                $time = GetTotalsForTime($data[$totalsFields[$i]['fName']]);
                $totals[$totalsFields[$i]['fName']] += $time[2] + $time[1] * 60 + $time[0] * 3600;
            } else {
                $totals[$totalsFields[$i]['fName']] += $data[$totalsFields[$i]['fName']] + 0;
            }
        }
    }
}
开发者ID:samsulpendis,项目名称:Instant_Appointment,代码行数:15,代码来源:Anomalies_export.php

示例2: countTotals

function countTotals(&$totals, $totalsFields, $data)
{
    for ($i = 0; $i < count($totalsFields); $i++) {
        if ($totalsFields[$i]['totalsType'] == 'COUNT') {
            $totals[$totalsFields[$i]['fName']]["value"] += $data[$totalsFields[$i]['fName']] != "";
        } else {
            if ($totalsFields[$i]['viewFormat'] == "Time") {
                $time = GetTotalsForTime($data[$totalsFields[$i]['fName']]);
                $totals[$totalsFields[$i]['fName']]["value"] += $time[2] + $time[1] * 60 + $time[0] * 3600;
            } else {
                $totals[$totalsFields[$i]['fName']]["value"] += $data[$totalsFields[$i]['fName']] + 0;
            }
        }
        if ($totalsFields[$i]['totalsType'] == 'AVERAGE') {
            if (!is_null($data[$totalsFields[$i]['fName']]) && $data[$totalsFields[$i]['fName']] !== "") {
                $totals[$totalsFields[$i]['fName']]['numRows']++;
            }
        }
    }
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:20,代码来源:pad_pad_daftar_hist_export.php

示例3: countTotals

	/**
	 * Counts totals, depending on theirs type
	 *
	 * @param array $totals
	 * @param array $data
	 */
	function countTotals(&$totals, &$data) 
	{
		for($i = 0; $i < count($this->totalsFields); $i ++)
		{
			if($this->totalsFields[$i]['totalsType'] == 'COUNT')
			{
				if(0 != strlen($data[$this->totalsFields[$i]['fName']]))
					$totals[$this->totalsFields[$i]['fName']]++;
			}
			else if($this->totalsFields[$i]['viewFormat'] == "Time") 
			{
				$time = GetTotalsForTime($data[$this->totalsFields[$i]['fName']]);
				$totals[$this->totalsFields[$i]['fName']] += $time[2]+$time[1]*60 + $time[0]*3600;
			}
			else
				$totals[$this->totalsFields[$i]['fName']]+=($data[$this->totalsFields[$i]['fName']]+ 0);
		
			if($this->totalsFields[$i]['totalsType'] == 'AVERAGE')
			{
				if(!is_null($data[$this->totalsFields[$i]['fName']]) && $data[$this->totalsFields[$i]['fName']]!=="")
					$this->totalsFields[$i]['numRows']++;
			}
		}
	}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:30,代码来源:listpage.php


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