HI
How can I show Fleet by airlines ?
HI
How can I show Fleet by airlines ?
I really like this feature, but I wanted all of my fleet to be shown in the fleet page. As the code is set, planes will only appear once they have accrued flight time. As my VA is brand new, there are quite a lot of aircraft with no hours logged that won’t show up in the fleet page. So I took the liberty of amending the SQL query in the /core/modules/fleet/fleet.php page:
Original SQL:
$sql = 'SELECT a.*, a.name AS aircraft,
COUNT(p.pirepid) AS routesflown,
SUM(p.distance) AS distance,
SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
AVG(p.distance) AS averagedistance,
AVG(p.flighttime) as averagetime
FROM '.TABLE_PREFIX.'aircraft a
INNER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
GROUP BY a.registration';
By changing the join function, I can now show all of the fleet, regardless of whether it has logged any flight time:
Amended Code:
$sql = 'SELECT a.*, a.name AS aircraft,
COUNT(p.pirepid) AS routesflown,
SUM(p.distance) AS distance,
SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
AVG(p.distance) AS averagedistance,
AVG(p.flighttime) as averagetime
FROM '.TABLE_PREFIX.'aircraft a
LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
GROUP BY a.registration';
Cheers,
Stu
Thanks for this!
Thanks for this!
No worries
Nevermind I figured that out but the image is not showing up. I put an image url attached to the fleet aircraft through the admin. When i open the fleet page image is not there. If i copy the image url from the missing image location it is the same url as the fleet page. what am i doing wrong?
I had the same problem. The code used to call the image is wrong. On the fleet_table.tpl change the following.
<img src="<?php echo $aircraft->imageurl; ?>">
to
<img src="<?php echo $aircraft->imagelink; ?>">
That should work for you.
FLEET TABLE 2.0 BETA - FINAL PUBLIC RELEASE
Here is the BETA of Fleet Table 2.0
NEW FEATURES:
Added download link
Image fixes
SQL Updated
and more!
It is attached.
NOTE: This is only a BETA release and many things may not work yet.
NOTE2: I’m gonna be away from Monday 22nd to Friday 27th (i think).
[FleetTable2BETA.zip](< base_url >/applications/core/interface/file/attachment.php?id=137)
Hello !!
I have a preoblem !! Where I have to put aircraft images ? I tired to ../images/aircraft, but didnit work !! I make mistake ??
Please help !!
Hello !!
I have a preoblem !! Where I have to put aircraft images ? I tired to ../images/aircraft, but didnit work !! I make mistake ??
Please help !!
You upload the images to your server then you go to Airline Operations –> Add and Edit Fleet .
From there you click on the aircraft you want to add a picture to and the add the full URL to the “Link to Aircraft Image” field. The module will then display the image.
Hope this helps!
You upload the images to your server then you go to Airline Operations –> Add and Edit Fleet .
From there you click on the aircraft you want to add a picture to and the add the full URL to the “Link to Aircraft Image” field. The module will then display the image.
Hope this helps!
Thanks so much…
Hello,
times someone could write an exact installation instruction for the fleet-site. I get it not to run.
Thanks and many greetings
Thomas
Hello,
times someone could write an exact installation instruction for the fleet-site. I get it not to run.
Thanks and many greetings
Thomas
Hi its on page 1 at the top, install is easy just follow the steps, then if you want to change things have a look at the rest of the posts
Thank you, who can read - is in the advantage
I had not followed point 3, this was my mistake.
Thomas
Would it be possible to display a table only for a certain aircraft? I would like to separate the different aircraft in different tables.
– http://flyvva.org/dev/index.php/fleet
Here is a mock-up of what I am trying to do… each blue dive is where a table for that aircraft will be.
Thanks,
Chad C.
Would it be possible to display a table only for a certain aircraft? I would like to separate the different aircraft in different tables.
– http://flyvva.org/dev/index.php/fleet
Here is a mock-up of what I am trying to do… each blue dive is where a table for that aircraft will be.
Thanks,
Chad C.
It might be easier just to do something like that by hand, instead of programatically. It would be alot of code to have it all done automagically.
Does the Fleet folder go into the Modules folder? I already have a default Fleet folder there.
You can rename the folder Fleet to FleetInfo and rename Fleet.php to FleetInfo.php
OR you can do some coding.
Open your default fleet folder, open fleet.php.
Add this code:
/**
Copyright Mitchell Williamson 2010
Fleet Table 2.0
*/
public function info()
{
$fleet = self::FleetInfo();
Template::Set('fleet', $fleet);
Template::Show('fleet_table.tpl');
}
/**
* Return all possible information about the fleet
* Code by Mitchell W
* Enhanced by Stu (stuartpb)
* Fleet Table 2.0
*/
public static function FleetInfo()
{
$sql = 'SELECT a.*, a.name AS aircraft,
COUNT(p.pirepid) AS routesflown,
SUM(p.distance) AS distance,
SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
AVG(p.distance) AS averagedistance,
AVG(p.flighttime) as averagetime
FROM '.TABLE_PREFIX.'aircraft a
LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
GROUP BY a.registration';
return DB::get_results($sql);
DB::debug();
return $ret;
}
Add it below public function index or whatever stuff u have in there.
Rename ‘info’ to whatever u want then go to yourwebsite.com/index.php/fleet/info
Also dont forgot to add fleet_table.tpl to core/templates
Thanks for the help. I have a question. Can you make something similar to the fleet table? Show the destinations(airports) in the same style. It can be a good tool to know what airports are being used or not.
Hi,
since the “Table-View” for my fleet did not look as I expected, I wrote another template.
Maybe someone can get use of it.
If someone asks for aid, sorry guys. I’m also just an average programmer ![]()
I will help as much as I can.
Overwrite existing file in /core/templates
Regards and Happy landings.
[fleet_table.zip](< base_url >/applications/core/interface/file/attachment.php?id=226)
a conclusion in the two tables, first table of Boeing 737 and the second table all Airbus
how can I create this?
First Table is (list of all Boeing aircraft’s)
Boeing B737-300
EI-CHH, total flight time 00:12:50.Â
Located at the airport Cologne Bonn (EDDK).
**Second Table is (**list of **** all Airbus aircraft’s)
Airbus A319-100
VP-BBG, total flight time 01:20:15.Â
Located at the airport Munich (EDDM).
please help!!
I’ve created this code but, this code show all  aircraft’s in list, but i needet 2 tabeles!Â
<?php foreach ($fleet as $aircraft)
{
?>
 <?php $airbus = explode("EI", $aircraft->registration); echo $airbus[0];?>,  total flight time <?php echo $aircraft->totaltime; ?>.<br>  Located at the airport<?php
$params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED));
$pirep = PIREPData::findPIREPS($params);
$current_location = $pirep[0]->arricao;
$current_location2 = $pirep[0]->arrname;
        {
            echo ''.$current_location2.' ('.$current_location.')';
      }
?>.<br><br>
<?php } ?>
Can someone please post the code to show which member was the last one to fly the aircraft so it will show up in the table as well? Thanx