Jump to content
Kyle

vFleetTracker_v1.3

Kyle

WARNING: This module is no longer supported from the developer as the developer is shifting their focus on phpVMS v4 Addons.

Message added by Kyle

Recommended Posts

Kyle    400

vFleetTracker_V1.1

This module allows you and your virtual pilots to veiw the VA's fleet information such as it's location, flights flown with the aircraft or schedules that are made with the aircraft.

Created Under: http://creativecommo...s/by-nc-sa/3.0/

Completed By: Vansers

Screenshot of Module:

post-402-0-39741000-1347021326_thumb.jpg

post-402-0-57023800-1347021337_thumb.jpg

How To Install:

1) Download the file that is attached here...

2) Unzip the file...

3) Upload the files same as the structure as your phpvms files.

Enjoy the Module!

A simple URL Link to the module.

<a href="<?php echo url('/vFleetTracker/'); ?>">Fleet Tracker</a>

Version 1.0 - September 07 2012

  • First Release

Version 1.1 - September 08 2012

  • Fixed Total Flight Counts
  • Changed code to if cargo aircraft, then show cargo count...ETC. If not, then passengers.

Version 1.1A - October 04 2014

  • Added support for .php template files.

Download From GitHub - TPL Version | PHP Version

If you have any questions, please post in this topic!

  • Like 3

Share this post


Link to post
Share on other sites
Kyle    400

can it be set to show only actually enabled fleet aircrafts?

Let me get that fixed tonight. ;)

Share this post


Link to post
Share on other sites
Txmmy83    29

Also I Would find it usefull to be ordered by Aircraft registration if possible

One Thing that caught my attention is that the Mod Makes no difference between PAX/Cargo Show it As Passengers carried

Share this post


Link to post
Share on other sites
Kyle    400

Also I Would find it usefull to be ordered by Aircraft registration if possible

One Thing that caught my attention is that the Mod Makes no difference between PAX/Cargo Show it As Passengers carried

I'll look into it the options to sort the aircraft, and I'll see what I can make out with between the PAX and Cargo.

Share this post


Link to post
Share on other sites
mseiwald    104

hey kyle,

thanks a lot for this great module ;)

i have a small problem with the flights count.... it shows on all aircraft either 0 or 1. Everything else works great.

kind regards

Manuel

Share this post


Link to post
Share on other sites
Txmmy83    29

hey kyle,

thanks a lot for this great module ;)

i have a small problem with the flights count.... it shows on all aircraft either 0 or 1. Everything else works great.

kind regards

Manuel

kyle,

I have that query on my front page

<tt>Total Cargo Carried: </tt><?php
$query="SELECT SUM(`load`) as totalfreight FROM `phpvms_pireps` WHERE `flighttype`='C'";
$result=DB::get_results($query);
echo $result[0]->totalfreight; ?> <?php echo Kgs; ?>

maybe we can modify that to show only Cargo of a specific Plane?

can confirm Manuels problem as i have the same with the flight count

best regards,

Thomas

Share this post


Link to post
Share on other sites
Kyle    400

hey kyle,

thanks a lot for this great module ;)

i have a small problem with the flights count.... it shows on all aircraft either 0 or 1. Everything else works great.

kind regards

Manuel

Manuel, fixed. An error in SQL Query

kyle,

I have that query on my front page

<tt>Total Cargo Carried: </tt><?php
$query="SELECT SUM(`load`) as totalfreight FROM `phpvms_pireps` WHERE `flighttype`='C'";
$result=DB::get_results($query);
echo $result[0]->totalfreight; ?> <?php echo Kgs; ?>

maybe we can modify that to show only Cargo of a specific Plane?

can confirm Manuels problem as i have the same with the flight count

best regards,

Thomas

I have made a little change to detect if the aircraft is used by cargo flights, so if you have cargo with the aircraft, then it will say. Total Cargo: 345...

Share this post


Link to post
Share on other sites
mseiwald    104

hi kyle that works perfect now....i`m having a problem now with the latest flights. Flight count shows only 5 for that aircraft I`m looking at for example. 5 Flights is correct. However the Last 15 flights table and the Map are showing the last 15 flights for my VA...regardless if they were flown with that aircraft or not?!? hehe ;)

best regards

Manuel

Share this post


Link to post
Share on other sites
mseiwald    104

fixed it by changing the code to

public static function getLastNumFlightsAircraft($id, $count = "5")
{
return DB::get_results("SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate,
 dep.name as depname, dep.lat AS deplat, dep.lng AS deplng,
 arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng	
FROM ".TABLE_PREFIX."pireps p
LEFT JOIN ".TABLE_PREFIX."airports AS dep ON dep.icao = p.depicao
LEFT JOIN ".TABLE_PREFIX."airports AS arr ON arr.icao = p.arricao
WHERE aircraft = {$id} AND accepted = 1
ORDER BY submitdate DESC LIMIT {$count}");
}

it was missing the

WHERE aircraft = {$id} AND accepted = 1

Share this post


Link to post
Share on other sites
Txmmy83    29

found out another thing it now differences between Cargo and Passengers ok but writes out Cargo Carried to the Passenger and Passenger Carried to the Cargo Loads ;)

seems easy to fix ;)

<?php if(count(vFleetTrackData::CargoAircraft($aircraft->id)) > 0)
{
?>
<strong>Total Passengers Carried: </strong><?php echo vFleetTrackData::countPassengers($aircraft->id);?>
<br />
<?php
}
else
{
?>
<strong>Total Cargo Carried: </strong><?php echo vFleetTrackData::countPassengers($aircraft->id);?>
<br />
<?php
}
?>

think it is only replacing the text between the strong tag

Share this post


Link to post
Share on other sites
Txmmy83    29

tweak to get only fleet aircrafts that are enabled and ordered by tail registration :)

class vFleetTrackData extends CodonData
{
public static function getAllAircraft()
{
return DB::get_results("SELECT * FROM ".TABLE_PREFIX."aircraft WHERE enabled=1 ORDER BY registration");
}

Share this post


Link to post
Share on other sites
mseiwald    104
found out another thing it now differences between Cargo and Passengers ok but writes out Cargo Carried to the Passenger and Passenger Carried to the Cargo Loads ;)seems easy to fix ;)
[b]Total Passengers Carried: [/b]
[b]Total Cargo Carried: [/b]

think it is only replacing the text between the strong tag

I just renamed the functions in vFleetTrackData.class.php switched passengers with cargo there...that way in the tpl file it is named correct... Where you call Cargo you have Cargo in the table. Both seem to work fine ;)

Share this post


Link to post
Share on other sites
Nighthawk    12

In the "latest Flights" table, how can i add a coloumn "Pilot" of the recent flight. i know the commands <td> and so on. i tried i can get the pilot id, but how can i convert it to the name of the Pilot?

Share this post


Link to post
Share on other sites
MBrown    34

Hi Kyle, keep getting a 404 on the download link and even your profile on github. Help please?!

Share this post


Link to post
Share on other sites
servetas    2300

Hello Kyle,

Can you please check the problem i have on this module? There is a problem with the Total Hours Count on the table for the SX-GRA and SX-GRB. I am using version 1.0 but i can't find anywhere the version 1.1... Thanks in advance!

Share this post


Link to post
Share on other sites
Kyle    400

Hello Kyle,

Can you please check the problem i have on this module? There is a problem with the Total Hours Count on the table for the SX-GRA and SX-GRB. I am using version 1.0 but i can't find anywhere the version 1.1... Thanks in advance!

I don't know where I lost the version 1.1 after something happened to my Github Account before that time. I'll try to look for it in my old hard drive if I still have the old Operating Systems..

However. you can fix this by rounding off the numbers like this...

<?php echo round(vFleetTrackData::countHours($aircraft->id), 2);?>

Then it would return an example number such as 234.53, not long numbers.

Cheers! ;)

Share this post


Link to post
Share on other sites
servetas    2300

The problem is not the long hours :). In reality, these two aicrafts have total hours of flying 838.59 and 628.59 respectively.

Share this post


Link to post
Share on other sites
Kyle    400

I'm not sure if that's unusual for you, but I'm guessing, something with the aircraft on the PIREP report may have been entered the hours too much or rejected PIREPs. I have this query set to count aircraft with only approved flights..

public static function countHours($id)
{
 $query = "SELECT SUM(flighttime) as time FROM ".TABLE_PREFIX."pireps WHERE aircraft = {$id} AND accepted = 1";
 $result = DB::get_row($query);
 return $result->time;
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×