當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。