View Single Post
Old 28th September 2010, 15:31
till till is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts

As far as I can see, $soma and $soma_nao that you pass are arrays and not values, but you can set only values for a template variable. So the lines:

$sql_comissao = "SELECT SUM(valor_contrato) FROM indicacao";
$sql_nao_comissao = "SELECT SUM(valor_comissao) FROM indicacao";

$soma = $app->db->queryOneRecord($sql_comissao);
$soma_nao = $app->db->queryOneRecord($sql_nao_comissao);

$rec['total_valor_comissionado'] = $soma;
$rec['total_valor_nao_comissionado'] = $soma_nao;

should be:

$sql_comissao = "SELECT SUM(valor_contrato) as soma FROM indicacao";
$sql_nao_comissao = "SELECT SUM(valor_comissao) as soma_nao FROM indicacao";

$soma = $app->db->queryOneRecord($sql_comissao);
$soma_nao = $app->db->queryOneRecord($sql_nao_comissao);

$rec['total_valor_comissionado'] = $soma['soma'];
$rec['total_valor_nao_comissionado'] = $soma_nao['soma_nao'];
Till Brehm
Get ISPConfig support and the ISPConfig 3 manual from
Reply With Quote