Jump to content
LakerVirtual

Advanced Fleet Manager [SOLVED]

Recommended Posts

Install this module (php verion for PHPVMS 5.5.2) and get this error when selecting an aircraft, and the following screen http://....../fleet/view/(any aircraft)

gives this error:

Deprecated: Non-static method FleetData::getAircraftTotals() should not be called statically, assuming $this from incompatible context in /home/www/lakervirtual.com/core/modules/Fleet/Fleet.php on line 36

Deprecated: Non-static method FleetData::get5MostRecentFlights() should not be called statically, assuming $this from incompatible context in /home/www/lakervirtual.com/core/modules/Fleet/Fleet.php on line 37

Deprecated: Non-static method FleetData::getAllScheduledFlights() should not be called statically, assuming $this from incompatible context in /home/www/lakervirtual.com/core/modules/Fleet/Fleet.php on line 38

after those messages rest of page displays OK.

Any ideas anyone??

Thanks

Edited by LakerVirtual
SOLVED

Share this post


Link to post
Share on other sites

I've done that and still got same error messages. Here is fleet.php

<?php
/**
 * phpVMS - Virtual Airline Administration Software
 * Copyright (c) 2008 Nabeel Shahzad
 * For more information, visit www.phpvms.net
 *    Forums: http://www.phpvms.net/forum
 *    Documentation: http://www.phpvms.net/docs
 *
 * phpVMS is licenced under the following license:
 *   Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
 *   View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/
 *
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2008, Nabeel Shahzad
 * @link http://www.phpvms.net
 * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
 */
 
class Fleet extends CodonModule
{

    public function index()
    {
        $this->set('aircrafts', FleetData::GetAllAircrafts());
        $this->show('fleet/fleet_list');
        
    }
    
        public function view($aircraftid)
    {
        
        $this->set('basicinfo', FleetData::getBasicInfo($aircraftid));
        $this->set('purchasedate', FleetData::getDateOfPurchase($aircraftid));
        $this->set('firstflight', FleetData::getFirstFlight($aircraftid));
        $this->set('lastflight', FleetData::getLastFlight($aircraftid));
        $this->set('detailedinfo', FleetData::getAircraftTotals($aircraftid));
        $this->set('recentflights', FleetData::get5MostRecentFlights($aircraftid));
        $this->set('scheduledflights', FleetData::getAllScheduledFlights($aircraftid));
        $this->show('fleet/fleet_view');
        
    }
}

 

Share this post


Link to post
Share on other sites
1 hour ago, shakamonkey88 said:

What PHP version are you using? Who is your hoster?

PHP 5.6 tried with PHP 5.5 also, & freehostia.com

Edited by LakerVirtual

Share this post


Link to post
Share on other sites

Open your core/common/FleetData.class.php file and replace where:

public function

with:

public static function

 

Share this post


Link to post
Share on other sites
22 minutes ago, servetas said:

Open your core/common/FleetData.class.php file and replace where:


public function

with:


public static function

 

there is only 'public static' not 'public function'

Part of FleetData.class.php:

<?php

    // -- Class Name : FleetData
    // -- Purpose : Gathers Detailed Information on VA Aircrafts
    // -- Created On : 10/27/2013
    // -- Last Revised On : 10/27/2013
    // -- Version : 1.0
    class FleetData extends CodonData
    {
        public static

        // -- Function Name : GetAllAircrafts
        // -- Params : 
        // -- Purpose : 
        function GetAllAircrafts()
        {
            $sql = 'SELECT * FROM '.TABLE_PREFIX.'aircraft WHERE `enabled` = 1';
            return DB::get_results($sql);
        }

        public static

        // -- Function Name : getBasicInfo
        // -- Params : $id
        // -- Purpose : 
        function getBasicInfo($id)

Share this post


Link to post
Share on other sites

I feel that the file is messed up. Can you attach the file so we can preview it using a code editor?

Share this post


Link to post
Share on other sites

I have deleted & re-installed all the files for this module and now it seems to work!!

Not sure of why, but there you go.

Thanks for all your help guys.

 

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

×