<?php

function get_total_points($team)
{
    $dao = new Dao();
    $points = 0;
    foreach ($dao->get_score_team($team) as $row) {
        $points += $row['points'];
    }
    return $points;
}

$scoreTam = get_total_points('tam');
$scorePek = get_total_points('pek');
