Jump to content

Summation of PIREP Revenue


Parkho

Recommended Posts

  • Moderators

Hi there,

I'm trying to get sum of revenue for a pilot's all PIREPS, so here is the function:

public static function totalrev($pilotid)
{
 $sql = 'SELECT pilotid, SUM(revenue) FROM '.TABLE_PREFIX.'pireps
 WHERE pilotid='.intval($pilotid).'
 GROUP by '.$pilotid ;

 return DB::get_results($sql);
}

And I have the following in my .tpl file:

$pilotid = Auth::$userinfo->pilotid ;
$row = PIREPData::totalrev($pilotid);
echo FinanceData::formatMoney($row);

And I get nothing. please help me find out where I'm wrong.

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...