本文整理汇总了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;
}
}
}
}
示例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']++;
}
}
}
}
示例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']++;
}
}
}