Code Snippet

What is the php code for showing how many active flight there are in number format

EX : 3 Active Flights

You would need a function to count ACARS data in ACARS data table like this:

public static function countactiveflights()
{
$sql="SELECT * FROM phpvms_acarsdata WHERE lastupdate = date(now())";
$count = DB::get_results($sql);
return count($count);
}

Now place this in “OperationsData.class.php” at the bottom before the closing bracket. Then you would call the function like this:

<table>
<tr>
<td>Active Flights:</td>
<td><?php echo OperationsData::countactiveflights(); ?> Active flights </td>
</tr>
</table>

not working anymore when switched to 5.5

 

\<?php echo ACARSData::getLiveFlightCount(); ?\>

 

On 7/11/2018 at 3:34 PM, shakamonkey88 said:

<?php echo ACARSData::getLiveFlightCount(); ?>

 

Thanks, shakamonkey88

works great !