Jump to content

Ricky310

Members
  • Posts

    11
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Ricky310

  1. After further investigation , I suspect there is a error in the CodonCache.php file. That will not allow this function to work properly. It is these lines of script that I am refering to:  $counts = CodonCache::read($key);   and    CodonCache::write($key, $counts,  'medium'); . This is way above my skill level to fix and way too expensive to hire someone. I got a quote from a web designer, $500 to $700 USD. This is highway robbery.

     

    I will do without this function and keep my aircraft hours on a spread sheet. 

     

    I have yet to find a Virtual Airline that uses Pilots Aircraft Hours stat, or this function.

     

    Cheers!

  2. NO, When I posted this, I made a typing error. 

     

    This is the script I am refering to:

     

     /**
         * StatsData::PilotAircraftFlownCounts()
         *
         * @param mixed $pilotid
         * @return
         */
        public static function PilotAircraftFlownCounts($pilotid) {

            $key = 'ac_flown_counts_' . $pilotid;
            
            
            $counts = CodonCache::read($key);
            if ($counts === false) {
                //Select aircraft types
                $sql = 'SELECT a.name AS aircraft, COUNT(p.aircraft) AS count, SUM(p.flighttime) AS hours
                        FROM ' . TABLE_PREFIX . 'pireps p, ' . TABLE_PREFIX . 'aircraft a
                        WHERE p.aircraft = a.id AND p.pilotid=' . intval($pilotid) . '
                        GROUP BY a.name';

                $counts = DB::get_results($sql);
                CodonCache::write($key, $counts, 'medium');
            }

            return $counts;
        }

  3. I understand. I add this statement to a column in a table-> StatsData::<?php echo PilotSircraftflownCounts($pilot->pilotid); ?>

     

    The output that I am hoping for is a table with two columns. The Name of the aircraft flown and the hours flown in each aircraft by each pilot. I am adding this to the profile_main.php.

     

    I have also tried -> StatsData::<?php echo PilotSircraftflownCounts($userinfo->pilotid); ?>  and either of them work. The output is the same. The word "array".

     

    I done the default StatsData.class.php file. Same output.

     

    I do have a pie chart working. There is one I found with Google chart and it shows the aircraft flown, but no hours.

     

    I wish I could find a script that I could add to the profile_main.php that would give me the aircraft flown and hours for each pilot in my VA. No luck and would most likely have to pay someone, Paying someone is not a option, I will do without. I do think the script would go viral with all the VA's that use phpvms. IMO.

     

     

  4. DesposableHero I do not know anything about PHP or ARRAY's. I would need to have someone write the script  for me.

     

    ProAvia no error message, just the word "Array". This a default function from the file name core/common/StatsData.class.php. Refer you to line 456, (public static function PilotAircraftFlownCounts($pilotid) )

     

    PHP version is 5.3.29

    Mysql version is 5.7.34-cll-lve

×
×
  • Create New...