本文整理匯總了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']++;
}
}
}