-
Posts
2773 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by simpilot
-
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 } ?>
-
Is there an actual email address created on the server for the new email address you are using in the phpvms install?
-
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
-
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.
-
Did you update phpVMS or PHP version on your server prior to this starting?
-
What didn't work? Any of my suggestions or what your IT Administrator was doing?
-
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_
-
If he is the only one having issues with it I would lean toward it being client side.
-
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.
-
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.
-
That is the problem, if you are updating an existing install you should be using http://www.yoursite.com/install/update.php
-
Are you using install.php or update.php?
-
Yes, the tables are there, but are the new columns existing? Probably not, that is why it is not showing correctly I would guess.
-
Sorry about that Mark, it was off the cuff, and you know what you get with that.
-
When you ran the update.php file did you get any errors, all those fields get updated within the database when the update runs.
-
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
-
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.
-
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.
-
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.
-
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.
-
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'); ?>
-
Looks like you have got it Jeff
-
You can adjust how the username is registered in the SMFRegisterData.class.php file on line 18
-
Is any of the information showing in the database itself? When you are connected with acars does your flight show on the live map?
-
Pay is negotiable and will be a fixed rate per aircraft. Please email me with some samples of your work and requirements for payment. Thanks