crnjola Posted March 13, 2010 Report Share Posted March 13, 2010 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... Quote Link to comment Share on other sites More sharing options...
ThomasH Posted April 8, 2010 Report Share Posted April 8, 2010 Hello, times someone could write an exact installation instruction for the fleet-site. I get it not to run. Thanks and many greetings Thomas Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 8, 2010 Moderators Report Share Posted April 8, 2010 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 Quote Link to comment Share on other sites More sharing options...
ThomasH Posted April 8, 2010 Report Share Posted April 8, 2010 Thank you, who can read - is in the advantage I had not followed point 3, this was my mistake. Thomas Quote Link to comment Share on other sites More sharing options...
piper338 Posted April 12, 2010 Report Share Posted April 12, 2010 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. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 14, 2010 Administrators Report Share Posted April 14, 2010 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. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted April 27, 2010 Report Share Posted April 27, 2010 Does the Fleet folder go into the Modules folder? I already have a default Fleet folder there. Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted April 27, 2010 Author Report Share Posted April 27, 2010 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 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted April 29, 2010 Report Share Posted April 29, 2010 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. Quote Link to comment Share on other sites More sharing options...
dddanny Posted May 2, 2010 Report Share Posted May 2, 2010 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 2 Quote Link to comment Share on other sites More sharing options...
Artjom Posted June 1, 2010 Report Share Posted June 1, 2010 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 } ?> Quote Link to comment Share on other sites More sharing options...
Jeff Posted June 2, 2010 Report Share Posted June 2, 2010 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 Quote Link to comment Share on other sites More sharing options...
AUZ Posted June 5, 2010 Report Share Posted June 5, 2010 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 This was exactly what I was about to ask! Would be a great addition to a great module!! Reasin being ... I duplicated then renamed the original fleet table and edited the out put only to display; Type Rego Location - Location Now all I need is the last pilot who flew it. Then I can promote the Module as "Last Known Whereabouts" giving pilots the incentive to take that aircraft and fly it to where they want to go. Any assistance in coding would be mostly appreciative. Thanks in advance Adam AUZ Quote Link to comment Share on other sites More sharing options...
md82 Posted June 17, 2010 Report Share Posted June 17, 2010 I've noticed the table lists the planes in order by their registration. Example: MD87 MD-87 N214AM 0 0 130 10000 0 MD88 MD-88 N401NV 0 0 150 15000 0 MD88 MD-88 N402NV 0 0 150 15000 0 MD88 MD-88 N403NV 0 0 150 15000 0 MD88 MD-88 N404NV 0 0 150 15000 0 MD83 MD-83 N405NV 0 0 150 15000 0 MD82 MD-82 N406NV 0 0 150 15000 0 MD82 MD-82 N407NV 0 0 150 15000 0 MD82 MD-82 N408NV 0 0 150 15000 0 How do we set it so that it lists in order by aircraft type ? MD82 MD-82 N406NV 0 0 150 15000 0 MD82 MD-82 N407NV 0 0 150 15000 0 MD82 MD-82 N408NV 0 0 150 15000 0 MD83 MD-83 N405NV 0 0 150 15000 0 MD87 MD-87 N214AM 0 0 130 10000 0 MD88 MD-88 N401NV 0 0 150 15000 0 MD88 MD-88 N402NV 0 0 150 15000 0 MD88 MD-88 N403NV 0 0 150 15000 0 MD88 MD-88 N404NV 0 0 150 15000 0 Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted June 17, 2010 Author Report Share Posted June 17, 2010 I've noticed the table lists the planes in order by their registration. Example: MD87 MD-87 N214AM 0 0 130 10000 0 MD88 MD-88 N401NV 0 0 150 15000 0 MD88 MD-88 N402NV 0 0 150 15000 0 MD88 MD-88 N403NV 0 0 150 15000 0 MD88 MD-88 N404NV 0 0 150 15000 0 MD83 MD-83 N405NV 0 0 150 15000 0 MD82 MD-82 N406NV 0 0 150 15000 0 MD82 MD-82 N407NV 0 0 150 15000 0 MD82 MD-82 N408NV 0 0 150 15000 0 How do we set it so that it lists in order by aircraft type ? MD82 MD-82 N406NV 0 0 150 15000 0 MD82 MD-82 N407NV 0 0 150 15000 0 MD82 MD-82 N408NV 0 0 150 15000 0 MD83 MD-83 N405NV 0 0 150 15000 0 MD87 MD-87 N214AM 0 0 130 10000 0 MD88 MD-88 N401NV 0 0 150 15000 0 MD88 MD-88 N402NV 0 0 150 15000 0 MD88 MD-88 N403NV 0 0 150 15000 0 MD88 MD-88 N404NV 0 0 150 15000 0 Open up Fleet.php and instead of the default FleetInfo() change it to this code: /** * Return all possible information about the fleet * Code by Mitchell W * Enhanced by Stu (stuartpb) * Fleet Table 2.0 Order by Aicraft Type Edit */ 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.name'; return DB::get_results($sql); DB::debug(); return $ret; } This was exactly what I was about to ask!Would be a great addition to a great module!! Reasin being ... I duplicated then renamed the original fleet table and edited the out put only to display; Type Rego Location - Location Now all I need is the last pilot who flew it. Then I can promote the Module as "Last Known Whereabouts" giving pilots the incentive to take that aircraft and fly it to where they want to go. Any assistance in coding would be mostly appreciative. Thanks in advance Adam AUZ I have tried to get the last pilot who flew it but I can't seem to get it to work, as soon as I get it working I'll post the code here 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 } ?> Copy the table and move it below the first table and change the airbus stuff to boeing or whatever. Quote Link to comment Share on other sites More sharing options...
AUZ Posted June 17, 2010 Report Share Posted June 17, 2010 Ok Mitchell, thanks very much Waiting patiently Regards Adam AUZ Quote Link to comment Share on other sites More sharing options...
md82 Posted June 17, 2010 Report Share Posted June 17, 2010 that put my planes in order by type.. but I only have a list of 5 planes now. instead of a list of 46. thanks trev Quote Link to comment Share on other sites More sharing options...
BlackYet Posted August 16, 2010 Report Share Posted August 16, 2010 that put my planes in order by type.. but I only have a list of 5 planes now. instead of a list of 46. thanks trev To solve that do this: in Fleet.php in Fleet folder inside modules folder add at line 36: GROUP BY a.registration ORDER BY a.name Quote Link to comment Share on other sites More sharing options...
Nout - Zon Executive Posted September 1, 2010 Report Share Posted September 1, 2010 how can i change the code so that it shows ALL aircraft, even the ones that haven't flown a single flight yet Quote Link to comment Share on other sites More sharing options...
markusr Posted September 1, 2010 Report Share Posted September 1, 2010 is there a possibility to show the current fleet location in google maps? Maybe someone can share a script in here. That would be nice. Quote Link to comment Share on other sites More sharing options...
markusr Posted September 5, 2010 Report Share Posted September 5, 2010 And another question: The script shows all aircraft, also those who are marked as disabled. What do I need to change to see only active aircraft in the list? Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted September 5, 2010 Report Share Posted September 5, 2010 Interesting question would like to know that as well anybody has an idea ? Best Regards Thomas Quote Link to comment Share on other sites More sharing options...
markusr Posted October 6, 2010 Report Share Posted October 6, 2010 And another question: The script shows all aircraft, also those who are marked as disabled. What do I need to change to see only active aircraft in the list? I think only the SQL query need to be adopted 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; } to include only enabled aircraft, but I didn't managed to get it working. Maybe some sql expert could help. thanks, Markus Quote Link to comment Share on other sites More sharing options...
markusr Posted October 10, 2010 Report Share Posted October 10, 2010 Hi, with this one, I get an error on line 4 from the tpl file: $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 WHERE a.enabled = 1 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; Line 4 of the tpl is: foreach ($fleet as $aircraft) any idea? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 10, 2010 Administrators Report Share Posted October 10, 2010 What is the error? I am guessing it may be something like - your variable is undefined - two returns in the model is probably causing some of the headache, also in your controller, how are you defining $fleet? Quote Link to comment Share on other sites More sharing options...
markusr Posted October 10, 2010 Report Share Posted October 10, 2010 Hi, here is the whole fleet.php <?php class Fleet extends CodonModule { public function index() { $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 WHERE a.enabled = 1 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; } } ?> and the tpl: <h1><?php echo SITE_NAME?> Fleet</h1> <table align="center"><tr><td> <?php foreach ($fleet as $aircraft) { ?> <div style="float: left;" align="right"> ICAO :<br> Type :<br> Full Name:<br> Registration :<br> Range :<br> Empty Weight :<br> Cruise Alt :<br> Max Pax :<br> Max Cargo :<br> Total hours :<br> Total Routes flown :<br> current Airport :<br> current Country :<br> <br> Download : </div> <div style="float: left;"> <?php echo $aircraft->icao; ?><br> <?php echo $aircraft->name; ?><br> <?php echo $aircraft->fullname; ?><br> <?php echo $aircraft->registration; ?><br> <?php echo $aircraft->range; ?><br> <?php echo $aircraft->weight; ?><br> <?php echo $aircraft->cruise; ?><br> <?php echo $aircraft->maxpax; ?><br> <?php echo $aircraft->maxcargo; ?><br> <?php echo $aircraft->totaltime; ?><br> <?php echo $aircraft->routesflown; ?><br> <?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_location.'-'.$current_location2; ?> <?php $airport = OperationsData::getAirportInfo($pirep[0]->arricao); ?><br> <?php echo $airport->country; ?><br> <br> <a href="<?php echo $aircraft->downloadlink; ?>">Download!</a> </div> <div style="float: right;"> <img src="<?php echo $aircraft->imagelink; ?>" height="97" width="160"></div> <br style="clear:both;"> <br> <hr> <br> <? } ?> </td></tr></table> the error says: Warning: Invalid argument supplied for foreach() in /var/www/web97/html/phpvms/core/templates/fleet_table.tpl on line 4 Thanks for help! best regards, Markus Quote Link to comment Share on other sites More sharing options...
markusr Posted October 20, 2010 Report Share Posted October 20, 2010 no one able to fix the request? :-( Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 20, 2010 Administrators Report Share Posted October 20, 2010 The error is in the sql command for the database, replace it with: $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) WHERE enabled = 1 GROUP BY a.name'; That will only show enabled aircraft. Also, I am not sure how the current location in the template is relavent unless you only have one unit of each model in your fleet. The module combines all the like aircrtaft in one group, then displays a current location, but that would be just for the last ac in the list. Just pondering... the module runs slow on my local machine, but I have a lot of data in the database. Might benefit in speed to combine some of the data calls from the template into the model. Quote Link to comment Share on other sites More sharing options...
markusr Posted October 20, 2010 Report Share Posted October 20, 2010 Hi, I have just tried replacing the sql script, but I get the same error: Warning: Invalid argument supplied for foreach() in /var/www/web97/html/phpvms/core/templates/fleet_table.tpl on line 4 I have only 5 aircraft for our business VA fleet. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 20, 2010 Administrators Report Share Posted October 20, 2010 Are your aircraft enabled and have schedules attached to them? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.