示例#1
0
			<center>
			<br/>
			<?php 
$stat = new CostsStatistics();
try {
    $total_cost = $stat->getTotalSpent();
} catch (StatisticException $e) {
    $total_cost = "ERROR {$e}";
}
try {
    $total_credits = $stat->getTotalSpentCredits();
} catch (StatisticException $e) {
    $total_credits = "ERROR {$e}";
}
try {
    $avg_call_cost = $stat->getAverageCallCost();
} catch (StatisticException $e) {
    $avg_call_cost = "ERROR {$e}";
}
?>

			Total spent on calls: <b><?php 
echo $total_cost;
?>
</b> | Total on credits: <b><?php 
echo $total_credits;
?>
</b> | Average call cost: <b><?php 
echo $avg_call_cost;
?>
</b><br/><br/>