hi!! i have o problem and i don't know how to fix it.
Top Pilots All Time section its fine and works perfect
but in the month stats , is count all the pireps with rejected and i dont want this.
one more thing in the month stats, is show me only one pilot !!
I find this code to forum for current moth stats (Miles Flown) and its work perfect.
<tbody>
<?php
$dbm="SELECT t1.pilotid,t1.distance,t2.firstname,t2.lastname FROM
(SELECT
pilotid, sum(distance) as distance
FROM phpvms_pireps
WHERE date_format(submitdate, '%Y-%m') = date_format(now(), '%Y-%m') AND accepted = 1
GROUP BY pilotid) t1
LEFT JOIN phpvms_pilots t2 ON t1.pilotid = t2.pilotid
ORDER BY distance DESC LIMIT 10";
$bstm = DB::get_results($dbm);
foreach ($bstm as $btm)
{
if($bstm == '')
{
?>
<tr><td align="center" colspan="2">No Records yet!</td></tr>
<?php } else { ?>
<tr><td><?php echo $btm->lastname ;?></td><td align="center"><?php echo $btm->distance ;?> NM</td></tr>
<?php } } ?>
</tbody>
Can anybody help me with other two stats ?
current moth stats (Flights Flown) and current moth stats (Hours Flown) with this code ??
Because this code is count only the accept pireps and show me 5 pilots, no only one and its work perfect for me.
thanks!!