Jump to content

simpilot

Administrators
  • Posts

    2773
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by simpilot

  1. The functions are all already in phpVMS to do this, you just need to add a little direction. In the PIREPData class in the filePIREP function add a directive that IF the LANDINGRATE is less than -300 (or whatever number you want) then direct the class to use the PilotData class function updateProfile to deduct whatever pay you want to from the pilot. In between you will have to use the getPilotPay function in PilotData to get the current pay to start your equation.
  2. http://forum.phpvms.net/topic/2826-gallery/page__view__findpost__p__22093 - Probably Soon -
  3. As NEvA has been closed down and will probably disappear after September of this year, I will start releasing some of the scripts used to build it, this one included. Ill see what I can do to build a generic package this week for the screenshot script.
  4. Add something like this to your statsdata class -> public static function TotalCargoCarried($airline_code = '') { $key = 'total_cargo_carried'; if($airline_code != '') { $key .= '_'.$airline_code; } $total = CodonCache::read($key); if($total === false) { $params = array( 'table' => TABLE_PREFIX.'pireps', 'fields' => 'SUM(`load`) as `total`', 'where' => array( 'accepted' => PIREP_ACCEPTED, 'flighttype' => 'C' ), ); if(!empty($airline_code)) { $params['where']['code'] = $airline_code; $params['group'] = 'code'; } $sql = DB::build_select($params); $results = DB::get_results($sql); if(!$results) { $total = 0; } else { $total = $results[0]->total; } CodonCache::write($key, $total, '15minute'); } return $total; } And use -> <?php echo StatsData::TotalCargoCarried(); ?> to display it
  5. simpilot

    Airport Tables

    No, doesnt look like he has been on the site since late June.
  6. Look back through the posts, I posted what you have to change to make it work for your custom table but you keep bringing the native code that Jeff posts back which will not work in your situation.
  7. Then it is the template, there are a few in the skinning threads for the new version phpVMS, but your best bet is to probably take some time and create your own.
  8. When I go to your site it looks like you have never installed the application, if you have maybe the local.config.php file has gotten deleted, overwritten, renamed, or corrupted. If your data is still in the database you can get it back, you just need to create a new config file.
  9. Did you try changing the template back to the stock supplied crystal template to see if the maps worked within it as I had posted a couple of posts back? It would verify if it is a template or application issue.
  10. Most developers setup a test instance on their local pc to do their editing work and testing, then load the edited files up to their site, that way you avoid things like this.
  11. What you are probably refering to is that the database auto increments the pilot id's, even if you delete one it does not set the database back prior to the line number you deleted, you can go in the database and edit the auto increment value, which I would highly suggest against doing, as almost everything in the system is tied back to a pilot id (ie PIREPS, Groupmembers, etc...)
  12. Need to give us a little more info than "the pilot numbers is off". There are ways to set offsets and starting numbers for pilot id's, they are posted throughout the forums if this is what you are refering to.
  13. Change your template back to the crystal template included with the application and see if the maps work, I really think this is a template issue. Are you on a free host?
  14. I just looked and your avatar file at http://virtualamerican.org/lib/avatars/AAL001.png does not exist, you get a 404 error. Do you have write permissions set correctly on the folders for the avatars? Look in the avatars folder and see if there are actually any avatars in it. Also, it really looks to me like you are using a 1.0 based template on the 2.x phpVMS system, it may be part of the issue.
  15. The pilot groups (ie admins, pilots, managers, etc...) are configured in the groups table and then the pilot assignments use the groupmembers table. This allows a pilot/member to be a member of more than one group. Permission sets are based off of a bitwise value system that is embeded in the app.config.php file in the core folder and then the value for each group is stored within the groups table. Hope this helps. Then as Jeff says, the control panel for these values in in the admin center.
  16. What version are you guys running? Maybe something has changed in the latest that is cracking this script, it has worked up till now. It is designed to fall back and place the pilot at their hub if they have never filed a PIREP.
  17. @Jacob Are you using clowdy with 2.x? I do not think it is fully compatable with 2.x, it was designed for 1.0. Try replacing the acars map template with the newest version out of the 2.x download. I think this may solve your problems, and replace the route map template as well.
  18. Check your pilots table to see if there is actually a pilot with pilotid 1 - Do you have an offset set or something? - This code works on my development site, my va, and all the other va's that have installed it. Try using pilot id 2.
  19. Try putting <?php FinanceData::updateAllExpenses(); ?> in one of your pages and refresh the page one time, it should populate all the finance data. Remove it once it has run, as it will run everytime that page is called. I will look to try and find the change that disrupted the automated part.
  20. @MrAmsterdam Without a link it is hard to tell, but my guess is that you are not passing a pilot id to the function so it does not know what to look for in the database and is returning an empty variable. Read my post here -> http://forum.phpvms.net/topic/2989-touchdownstats-10/page__view__findpost__p__21572 for this additional code and make sure you are calling the data as specified, I imagine the label 'pilot#' has not been replaced with a variable.
  21. The data is not there, the tpl only calls the field name for the departure field once for each departure field. You can use the coding on line 49 of timetable_index.tpl as guide to get the field name you are looking for.
  22. <?php echo 'Pilot average landing rate '.round(TouchdownStatsData::pilot_average('pilot#'), 2); ?>
  23. Add this to TouchdownstatsData -> public function pilot_stats($pilotid) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' AND pilotid = '$pilotid' ORDER BY landingrate DESC"; return DB::get_results($query); } public function pilot_average($pilotid) { $stats = self::pilot_stats($pilotid); $total = 0; $count = 0; foreach ($stats as $stat) { $total = $total + $stat->landingrate; $count++; } $average = $total / $count; return $average; } public function airline_average() { $stats = self::get_all_stats(); $total = 0; $count = 0; foreach ($stats as $stat) { $total = $total + $stat->landingrate; $count++; } $average = $total / $count; return $average; } Then where you want to show a pilots average do -> <?php echo 'Pilot average landing rate '.TouchdownStatsData::pilot_average('pilot#'); ?> and replace pilot# with the database id for the pilot you want to show the stat for - ie in pilot_public_profile it would be $userinfo->pilotid or for the VA's average -> <?php echo 'VA average landing rate '.TouchdownStatsData::airline_average(); ?>
  24. @maiochine To use the limit with your database table you will need to change the function within TouchdownStats.php -> This -> public function get_stats($howmany) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' ORDER BY landingrate DESC LIMIT $howmany"; return DB::get_results($query); } Needs to change to -> public function get_stats($howmany) { $query = "SELECT * FROM flights WHERE TouchDownVertSpeedFt < '0' ORDER BY TouchDownVertSpeedFt DESC LIMIT $howmany"; return DB::get_results($query); }
  25. Have you assigned the pilots to a hub? - I built in a qualifier in the index template to put the pilot at their hub if they have never filed a PIREP. $location = RealScheduleLiteData::get_pilot_location(Auth::$userinfo->pilotid); if(!$location) { $icao = Auth::$userinfo->hub; } else { $icao = $location->arricao; } Make sure that has not been modified out of your template and also check to see if the pilot has a hub assigned in the pilots table of the database.
×
×
  • Create New...