data_ga->get( 'ga:' . $profileId, $data_da, $data_a, $metric, $dimension); } else { $results = $analytics->data_ga->get( 'ga:' . $profileId, $data_da, $data_a, $metric, array("filters" => "ga:pagePath=@id_stat=" . $AUTH[id])); } if (count($results->getRows()) > 0) { $rows = $results->getRows(); if($dimension) return $rows; else return $rows[0][0]; } else { return null; } } function getTimeFormat($tempo){ $secondi = $tempo % 60; $tempo = ($tempo - $secondi) / 60; // in minuti $minuti = $tempo % 60; $tempo = ($tempo - $minuti) / 60; // in ore $ore = $tempo % 24; $secondi = $secondi < 10 ? "0$secondi" : $secondi; $minuti = $minuti < 10 ? "0$minuti" : $minuti; $ore = $ore < 10 ? "0$ore" : $ore; return "$ore:$minuti:$secondi"; } ?>