Jump to content
Message added by Kyle

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

Recommended Posts

  • Moderators
Posted

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
Posted

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

  • Moderators
Posted

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.

Posted

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

Posted

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

  • Moderators
Posted

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...

Posted

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

Posted

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

Posted

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

Posted

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");
}

Posted
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 ;)
Posted

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?

  • 1 month later...
  • 3 weeks later...
  • 1 month later...
  • Moderators
Posted

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!

  • Moderators
Posted

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! ;)

  • Moderators
Posted

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;
}

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...