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

Well I added and i still can't get a value...

my whole indicacao_list.php its like this:
Code:
<?php

require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');

//* Path to the list definition file
$list_def_file = "list/indicacao.list.php";

//* Check permissions for module
$app->auth->check_module_permissions('indicacao');

//* Loading the class
$app->uses('listform_actions');

class list_action extends listform_actions {

    public function prepareDataRow($rec) {

        global $app, $sql_comissao, $sql_nao_comissao;

        $sql_comissao = "SELECT SUM(valor_comissao) FROM indicacao WHERE status = '0' AND indicou_id = " . $_SESSION['s']['user']['userid'];
        $sql_nao_comissao = "SELECT SUM(valor_comissao) FROM indicacao WHERE status = '1' AND indicou_id = " . $_SESSION['s']['user']['userid'];

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

        $app->tpl->setVar('total_valor_comissionado', $soma);
        $app->tpl->setVar('total_valor_nao_comissionado', $soma_nao);

        parent::prepareDataRow($rec);
    }

}

//* Optional limit
//$app->listform_actions->SQLExtWhere = "indicado_id = ".$_SESSION['s']['user']['userid'];
//* Start the form rendering and action ahndling
$app->listform_actions->onLoad();
?>
And I use the 2 variables I created, on my indicacao_list.htm as I showed you... {tmpl_var name="total_valor_comissionado"} , {tmpl_var name="total_valor_nao_comissionado"}

Is there anything missing?
Reply With Quote