$sql = "select p.name as name, sum(time_to_sec(l.duration)) as time from tt_log l
inner join tt_projects p on (p.id = l.project_id)
where l.status = 1 and l.duration > 0 and l.user_id = $user_id $q_period group by l.project_id";
$sql = "select p.name as name, sum(time_to_sec(l.duration)) as time from tt_log l
inner join tt_projects p on (p.id = l.project_id)
where l.status = 1 and l.duration > 0 and l.user_id = $user_id $q_period group by l.project_id";