Jump to content

simpilot

Administrators
  • Posts

    2773
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by simpilot

  1. You could add some options to the flight type matrix, right now i think there is P - pax / C - cargo / H - charter
  2. No Problem - Glad I could be of help.
  3. @cor - Will look at that, looks like I did not add a link when i removed the body in that display to clean it up. @mattia - Did you update your AirMail tables in the database when you put in AirMail 3.x ?
  4. You could tie it to ranks easier I think; <?php if(loggedin()) { //they are logged in, check their rank if(Auth::$userinfo->rankid >= 'x') {do stuff} else {don't do stuff} } else { //they are not logged in - do other stuff } ?>
  5. Is there an actual email address created on the server for the new email address you are using in the phpvms install?
  6. Am I missing something? If you delete a pilot they are gone so there is no group. If you are just making them inactive you could add; if($pilotid->retired == TRUE)[continue;} right after the opening of any foreach loop using pilot data and it will skip all the retired pilots. This is what I do so I do not lose the hours and miles that the pilot has flown for the VA. To treat them as a guest or "inactive" pilot on the site you could do as I outlined here -> http://forum.phpvms.net/topic/5909-inactive-pilot-problem/page__view__findpost__p__39792
  7. There is actually a piece of code that is in the core/common/Auth.class.php file that will prevent an inactive member from logging in. It is located around line 269; /*if($userinfo->retired == 1) { self::$error_message = 'Your account was deactivated, please contact an admin'; return false; }*/ Un-comment it and it will lock out inactive users and also all but kACARS from connecting and allowing a PIREP submittal to reactivate the account. To stop inactive pilots from using kACARS I have added in to kACARS.php; if($pilotinfo->retired == 1){exit;} between $pilotinfo = PilotData::getPilotData($pilotid); and switch($xml->switch->data) That will not allow an inactive pilot to login with kACARS and submit a PIREP which in turn would reactivate their account.
  8. Did you update phpVMS or PHP version on your server prior to this starting?
  9. What didn't work? Any of my suggestions or what your IT Administrator was doing?
  10. There are 5 email templates for various things in the core/templates folder that you can move to your skin folder and customize. They all start with email_
  11. If he is the only one having issues with it I would lean toward it being client side.
  12. All you should get when you refresh the stats is a blank page, all it is doing is populating the database. When you go back to the top pilot index the data should be showing as long as their are ACARS submitted PIREPs in the database.
  13. The landingrate column in the PIREP table defaults to 0. My guess is that whatever ACARS he is using does not report a landingrate or is not submitting a properly formated report.
  14. That is the problem, if you are updating an existing install you should be using http://www.yoursite.com/install/update.php
  15. Are you using install.php or update.php?
  16. Yes, the tables are there, but are the new columns existing? Probably not, that is why it is not showing correctly I would guess.
  17. Sorry about that Mark, it was off the cuff, and you know what you get with that.
  18. When you ran the update.php file did you get any errors, all those fields get updated within the database when the update runs.
  19. Try changing the query to; $query = "SELECT AVG(landingrate) as average, SUM(*) as flights, pilotid FROM ".TABLE_PREFIX."pireps WHERE landingrate < '0' AND pilotid='$pilot->pilotid'"; And you should get the number of flights back with the array; $stat->flights
  20. Have you set the admin email to "nobody@yoursite.com" in your admin panel or the local.config file? That is what it looks like, or there is just noithing set. Try setting the address to something else, maybe "noreply@yoursite.com" You may even have to set up an actual email account in cpanel and use that address depending on the settings of the server.
  21. After you uploaded all the new files to the site did you run the update script? Seems to me that the database did not get updated if you are not seeing chunks of information from it.
  22. I dont think it would be too big of a job to create this. Best way to me would be to create a new table just to hold pilot hours (always a good idea to leave native tables alone for future updates) and then update it and collect pilot hours out of the PIREPS table and group them by the flight type field that is in that table already. Could even do it without a new table and call the data every time you want it but that could hurt performance some if there is a large number of pilots in a list and you were trying to do this for each pilot on the list. Not using a new table, maybe something like this; /core/common/HoursData.class.php <?php class HoursData extends CodonModule { function hours_bytype($pilotid, $type) { $query = "SELECT SUM(flighttime) as total FROM ".TABLE_PREFIX."pireps WHERE flighttype = '$type' AND pilotid = '$pilotid'"; $hours = DB::get_row($query); return $hours->total; } } and then in your template use <?php echo HoursData::hours_bytype('pilotid', 'P'); ?> replacing pilotid with the variable holding the id and the second parameter could be any of the types out of the config file; Config::Set( 'FLIGHT_TYPES', array( 'P'=>'Passenger', 'C'=>'Cargo', 'H'=>'Charter' ) ); If you are using it on a pilot listing page where it would be called numerous times I would add the cache feature to it so it is not scanning the database everytime the page is called, it would speed it up some.
  23. Sorry to hear of your external challenges, I hope the future gets brighter as it looks as though you have a well run virtual airline.
  24. How about something like this Mark; Add to TouchdownstataData.class.php function get_averages($howmany) { $avg = array(); $pilots = PilotData::findPilots(array('retired' => '0')); foreach($pilots as $pilot) { $query = "SELECT AVG(landingrate) as average, pilotid FROM ".TABLE_PREFIX."pireps WHERE landingrate < '0' AND pilotid='$pilot->pilotid'"; $result = DB::get_row($query); if($result->pilotid != '') {$avg[] = $result;} } rsort($avg); return array_slice($avg, '0', $howmany); } Add to TouchdownStats.php function averages($howmany) { $this->set('stats', TouchdownStatsData::get_averages($howmany)); $this->show('touchdownstats/touchdownstats_averages.tpl'); } Add a new template in core/templates/touchdownstats called touchdownstats_averages.tpl <h3>Best Average Landing Rate</h3> <?php if($stats) { echo '<table>'; echo '<tr>'; echo '<th>Landing Rate</th>'; echo '<th>Pilot</th>'; echo '</tr>'; foreach($stats as $stat) { $pilot = PilotData::getPilotData($stat->pilotid); echo '<tr>'; echo '<td>'.round($stat->average, 1).'</td>'; echo '<td>'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</td>'; echo '</tr>'; } echo '</table>'; } else { echo 'No Stats Available'; } ?> Then call it by url and pass how many records you want as the last element http://www.yoursite.com/index.php/touchdownstats/averages/10 or within another template <?php MainController::run('touchdownstats', 'averages', '10'); ?>
  25. Looks like you have got it Jeff
×
×
  • Create New...