View Single Post
  #24  
Old 27th September 2010, 16:29
bruno_floyd bruno_floyd is offline
Member
 
Join Date: Aug 2010
Posts: 73
Thanks: 1
Thanked 2 Times in 2 Posts
Default

I tried this:

Code:
]
 public function prepareDataRow($rec) {

        global $app;

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

        $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; 
		
		print_r($rec);
	
        parent::prepareDataRow($rec);
	}
but nothing is shown. Is it supposed to print?
Is right to put the variable inside the loop? Cause this field I'm trying to get is a single SUM value from one field of my DB...

Code:
<td class="tbl_col_total_valor_comissionado"><a href="#" onClick="loadContent('indicacao/indicacao_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="total_valor_comissionado"}</a></td>

Last edited by bruno_floyd; 27th September 2010 at 16:33.
Reply With Quote