web541
Members-
Posts
700 -
Joined
-
Last visited
-
Days Won
17
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by web541
-
Yes, those links are the conversion points in phpvms 2.x.x (the original) But I think you might be getting a little sidetracked here. The lines you mentioned actually refer to the revenue that is being returned, and then inserts that into the revenue field in the DB which shouldn't have anything to do with the pilot pay (though it is being used to calculate it) and the values with . and : shouldn't make a difference as it is being treated the same way. Please confirm the following The issue is with the pilot pay being calculated more than expected Does this occur with just the one rank or several (with different payrates, not just $60) With your discrepancy of $6.40, the algorithm is Supposedly doing this payrate * flighttime = dollars $60 * 2.17 = $130.20 When it should be doing this payrate * total_flight_minutes = dollars $60 / 60 * 137 = $137 $1 per minute in this case. In your Ledger Table, are your amount values correct? Once you confirm all of those, can I get you to try putting the attached file into a module (e.g. core/module/PayChecker/place this file here) and then open it up and edit the top pilotid and pirepid values Once you confirm all of those, can I get you to do the following Put the attached file into a module (e.g. core/module/PayChecker/place this file here) File a PIREP (any will do) and take note of the PIREP ID in the database or just use one which you've already filed Open up the PayChecker.php file and edit the top two values pilotid and pirepid respectively. In your url, go to http://yourvaurl.com/index.php/PayChecker and hit go Check the outcomes and report back That should allow us to have a look and confirm the values you are seeing.
-
Just confirming that you don't want to allow your pilots to book atc if they are rated, but rather get the VATSIM information on who's currently online and then display that on a page? If this is the case, then you could maybe utilize this module. A few of your posts are bit confusing.
-
Yeah, the revenue may not be calculated correctly, but this shouldn't have anything to do with the pay as only the revenue data is returned in that function. And yes, also correct as before phpVMS 5.5.x, there was no Ledger table, so all pilot pay was calculated internally. The calculation points are also a bit simpler in the earlier version as most of it is done in the PilotData.class.php file and what's interesting is the algorithm is slightly different as in phpVMS 5.5.x, the flighttime_stamp is used, rather in the earlier, the flighttime value (with the decimal) is used. In addition, the pay is being calculated the same, just using the pilotpay (payrate) and flighttime of the PIREPS table instead of reading it from a Ledger Table. https://github.com/nabeelio/phpVMS/blob/master/core/common/PilotData.class.php#L680 https://github.com/nabeelio/phpVMS/blob/master/core/common/PilotData.class.php#L717 https://github.com/nabeelio/phpVMS/blob/master/core/common/PilotData.class.php#L749 And that large negative number is yes, probably accounting for the pay prior to the conversion, you could fix this or ignore it for later, but if you want to dump some data in a few places, we can get an idea of which data is correct and where it is being incorrectly parsed. I'll go and get these places for you.
-
Ah ok, so I think by the txt file your pay is being calculated by the decimal (flighttime field) value instead of the flighttime_stamp value? Then instead of taking the tenths value / 60 it takes it / 100? If so, there's a missing link somewhere during the conversion (but it seems to be calculating for me) And your right, I hope v3 changes the calculation points, right now it goes from PIREP Filing => Controller => PIREPData File => another function to calculate it => ledger => calculate it again => PilotData file to reset it just about. I believe this is being worked on though. In regards to your "lines", line 5: affirm, by getting rid (exploding) the : in the flighttime string line 6: also correct, and it does this because when the PIREP is filed from the ACARS Client, I believe it only reports the rounded value of it's calculated flighttime thus discarding the 00:00:sec value. line 8: Mostly correct, though it's actually minutes (from line 6) * (pilotpay / 60) where pilotpay is the payrate per hour based on the pilot (who filed the PIREP)'s rank. line 10: Correct, 2hr 17min flight with $18 per hour which from the above algorith [137 * (18 / 60) = $41.1] Just confirm the above is what you are getting so we can track down your issue. Calculation Steps From ACARS... PIREPData.class.php FileReport PIREPData.class.php PopulatePIREPFinance PIREPData.class.php GetPIREPRevenue This could be your problem as a quick glance shows it calculating the pilotpay based on the decimal value (flighttime field in DB), not sure if it gets parsed though so have to look a bit more later. EDIT: nevermind, only used to calculate Revenue. Sets the pilotpay field in the DB to the pilot's payrate (without my potential fix in a previous post) to potentially recalculate it later This is called when a flight report is updated or it has changed status (accepted, rejected, etc.) PIREPData.class.php CalculatePIREPPayment This calculates it using the algorithm above which seems to be correct and it is only now when the Ledger DB Values are added which you said were correct, so theoretically the pay should be fine up until now. (we can dump the values later if we have to) This function is then called PilotData.class.php resetPilotpay which also should be fine as it just adds up the values from the ledger table and resets the total pilot pay for every pirep the pilot has filed. Seems like a round circle, might have to start dumping data (var_dump or print_r) in various places to see what values are being processed.
-
Just to confirm that your Pilot Pay / Hour is $60 for the rank that you are on and that the schedule doesn't have anything in the the "payforflight" field of the database. Also, in the above example, the algorithm is correct. Pilot Pay / hour X num hours = payforflight $60 X 2.17 = $130.20 If the issue was that the pilot was given the pay for their payrate (e.g. $30 for pay / hour on rank then $30 every pirep), then I posted a fix in the spoiler here but it seems it is not your issue. (just putting it out there in case you come across this later, feel free to take a look anyway). If you are looking for the pay conversion point (there are many), the main one is here But on a closer look at the algorithm, it is mostly correct -> Just as an example // This would usually be dynamic $pirep->flighttime_stamp = "02:00:00"; $pirep->pilotpay = "18"; // Sets it to the payrate as phpvms does, will have to override later $peices = explode(':', $pirep->flighttime_stamp); // Take the flighttime_stamp and make it like this 020000 $minutes = ($peices[0] * 60) + $peices[1]; // should equal 120mins $amount = $minutes * ($pirep->pilotpay / 60); // Do the conversion echo $amount; // should equal $36 You can try that on your machine as a test and it should equal $36. This is a whole number though, so when you go into decimal values, it gets a bit trickier. // This would usually be dynamic $pirep->flighttime_stamp = "02:00:00"; $pirep->pilotpay = "18"; // Sets it to the payrate as phpvms does, will have to override later // Do the conversion $peices = explode(':', $pirep->flighttime_stamp); // 021700 $minutes = ($peices[0] * 60) + $peices[1]; // 137mins /* Pretty sure this is the cause */ $amount = $minutes * ($pirep->pilotpay / 60); // 0.3 /* The above is basically 137 X (18 / 60) = 0.3 */ echo $amount; // $41.1 Not sure if this is exactly what your after or if it was any help at all, but it does shed some light on what's going on. I believe this is going to be easier in v3 (calculating pay in one place, not four perhaps). And after reading your above post, yes the conversion it's doing takes the flighttime_stamp value not the flighttime (decimal) value.
-
Check to see if this is in your core/local.config.php file (if not, then try app.config.php) /* These are pilot statuses which can be selected in the admin panel. I would be weary of changing these! Though you can safely change the name or messages or tweak the additional settings provided */ Config::Set('PILOT_STATUS_TYPES', array( /* DO NOT CHANGE THIS ACTIVE NUMBER OR STATUS OR THINGS WILL BREAK!!! */ 0 => array( 'name' => 'Active', # The title to show in the dropdown 'message' => '', # Message to show if they can't login (below is false) 'default' => true, # Should this be their default status? 'canlogin' => true, # Are they allowed to log in 'active' => true, # Are they an active pilot? 'autoretire' => false, # Use this status for the auto-retire functionality 'group_add' => array( # ID or name of the group this user is added to with this status 'Active Pilots', ), 'group_remove' => array( # ID or name of the groups this user is removed from with this status 'Inactive Pilots', ), ), /* DO NOT CHANGE THIS INACTIVE NUMBER OR STATUS OR THINGS WILL BREAK!!! */ 1 => array( 'name' => 'Inactive', 'message' => 'Your account was marked inactive', 'default' => false, 'canlogin' => false, 'active' => false, 'autoretire' => false, 'group_add' => array( 'Inactive Pilots', ), 'group_remove' => array( 'Active Pilots', ), ), 2 => array( 'name' => 'Banned', 'message' => 'Your account is banned, please contact an admin!', 'default' => false, 'canlogin' => false, 'active' => false, 'autoretire' => false, 'group_add' => array( 'Inactive Pilots', ), 'group_remove' => array( 'Active Pilots', ), ), 3 => array( 'name' => 'On Leave', 'message' => 'You have been marked as on leave', 'default' => false, 'canlogin' => true, 'active' => false, 'autoretire' => true, 'group_add' => array( 'Inactive Pilots', ), 'group_remove' => array( 'Active Pilots', ), ), )); And replace your block with that one and it shouldn't allow active and banned pilots to log in.
-
Make sure you have this version of phpvms (it's not required, but it will help for it being the most stable version). Then check that your local.config.php file has this in it (as I see you do), the lookup line isn't required by phpvms 5.5.x because it no longer uses geonames to pull data officially. Try removing the lookup server line as well and see if that makes a difference. Config::Set('PHPVMS_API_SERVER', 'http://api.vacentral.net'); Then test to see if the airport isn't making any trouble by going to here http://api.vacentral.net/index.php/airport/get/ and after the get/ put the icao and see if it returns data at the end of the page. Like this http://api.vacentral.net/index.php/airport/get/KLAX returns this ({"totalResultsCount":1,"airports":[{"icao":"KLAX","name":"Los Angeles International Airport","countryName":"United States","lat":"33.9425","lng":"-118.408","lowlead":"0","jeta":"0"}]}) After that, reload the add airport page and open up the browser console and see if any errors appear after you click the fetch airport data button (then it will be a javascript error). See if any of this works.
-
I believe that line is another security implementation If you would like, but it's not necessary to run Yes Yes Basically anything you've changed Basically yeah, the blank white page Not really Bottom line is that it is not required to operate, but it'd be good to have just in case. Still not sure if it's fully functional as of yet.
-
What servetas said is probably the best option, however you are more than welcome to try this version of phpVMS https://github.com/DavidJClark/phpvms_5.5.x Which is more up-to-date on everything, no guarantees it will work (so the best option is to get in touch with your hosting) but if you're desperate, it's worth a shot.
-
Could not open socket when users register for my airline
web541 replied to randomderecho's topic in Support Forum
I've had this issue way back, but I believe it is to do with free hosting and somehow the recaptcha, when I removed the recaptcha it seemed to pass, but free hosting is not recommended as it brings way too many issues to deal with. -
Haven't tested this core/common/VStatsData.class.php Add This public function monthly_awards_vawards($month, $year) { $query = "SELECT l.*, UNIX_TIMESTAMP(l.grt_dategrant) as dateissued, p.*, e.* FROM `vawards_grants` l LEFT JOIN `vawards_awards` p ON p.awd_id = l.grt_awdid LEFT JOIN " . TABLE_PREFIX . "pilots e ON e.pilotid = l.grt_pilotid WHERE e.retired = 0 AND MONTH(l.grt_dategrant) = ".DB::escape($month)." AND YEAR(l.grt_dategrant) = ".DB::escape($year)." ORDER BY l.grt_dategrant ASC"; $results = DB::get_results($query); return $results; } In core/modules/vStatsCenter/vStatsCenter.php Find this $this->set('awards', VAStatsData::monthly_awards($month, $year)); Replace it with this $this->set('awards', VAStatsData::monthly_awards_vawards($month, $year)); In core/templates/vStatsCenter/index.php Find this <tr> <td align="center"><a href="<?php echo url('/profile/view/'.$awd->pilotid);?>"><?php echo PilotData::GetPilotCode($awd->code, $awd->pilotid);?></a></td> <td align="center"><?php echo $awd->firstname . ' ' . $awd->lastname; ?></td> <td align="center"><?php echo $awd->name;?></td> <td align="center"><?php echo date("F j, Y", $awd->dateissued); ?></td> </tr> Replace it with this <tr> <td align="center"><a href="<?php echo url('/profile/view/'.$awd->pilotid);?>"><?php echo PilotData::GetPilotCode($awd->code, $awd->pilotid);?></a></td> <td align="center"><?php echo $awd->firstname . ' ' . $awd->lastname; ?></td> <td align="center"><?php echo $awd->awd_name; ?></td> <td align="center"><?php echo date("F j, Y", $awd->dateissued); ?></td> </tr> If it doesn't work, then play around with the sql query at the top here.
-
Try going into core/local.config.php and finding this Config::Set('ACARS_LIVE_TIME', 600); And change the 600 to however many minutes you want it to refresh
-
Just to clarify, you should have this in your local.config.php file Config::set('VACENTRAL_DATA_FORMAT', 'xml'); Config::Set('VACENTRAL_ENABLED', true); Config::Set('VACENTRAL_API_SERVER', 'http://api.vacentral.net'); Config::Set('VACENTRAL_API_KEY', '----------Your Key--------------'); Config::Set('PHPVMS_API_SERVER', 'http://api.vacentral.net'); If you have this and it's still not working, post an issue in the vaCentral support forum because simpilot may have to help you on this one.
-
hmmm, if I do remember correctly, it would be better to set up a new installation, new database then import as there are a few differences with the database between the two versions and therefore phpVMS may not be picking it up correctly.
-
never said you did and not directing it at you specifically, but to anyone who may come across this thread in the future. But besides that, did the code work?
-
Ok, I'll re-instate that you must have permission from them to do this first, but then proceed. I've just tested this and it works Replace this $flights = ACARSData::GetACARSData(); with this (in core/ACARS/ACARS.php) ///////////////////////////////////////////////////////////// // UPDATED ACARS DATA ///////////////////////////////////////////////////////////// $myflights = ACARSData::GetACARSData(); if(!$myflights) $myflights = array(); $other_airlines = array( json_decode(file_get_contents('http://yourvaurl.com/action.php/acars/data', true)), ); // This will get all the other airlines data $flights = array(); foreach($other_airlines as $airline) { foreach($airline as $a) { $flights[] = $a; } } $flights = array_merge($flights, $myflights); ///////////////////////////////////////////////////////////// // END UPDATED ACARS DATA ///////////////////////////////////////////////////////////// And replace http://yourvaurl.com/ with the va url which you are trying to retrieve, and for more airlines, just copy that line (json_decode(...) and again change the url and it should work (although I've only tested it with one airline, but it should work as expected).
-
Are there any schedules in your database? (and do they show up in the admin) Did you just export the .sql from your v2 and import it into v5.5.x?
-
You can, but you'd need to change a few things which might end up in a headache, but it is do-able.
-
Yep, check your browser console and see if there are any errors showing up. Also, if you're game, you could redo the charts (or so-called 'modernize it'), then check these out
-
Ah yes, that was just a rough sketch, you'd need to adapt it a bit. Good news is, once the data is in one array, it should be able to just join up and display it in the template (hopefully, unless phpVMS is routing the ACARS through another place as well). And how many virtual airlines do you need to have on the ACARS map? (1 or more)
-
I made a pull-request for this earlier and Kyle has been nice enough to merge it into the master branch, so anyone wanting to use the old "Airport Charts" module with phpVMS 5.5.x can now do it. https://github.com/Vansers/phpVMS_Airport_Charts
-
Yeah, the charts data class here is mainly for the charts built in to phpVMS by default (used in the /index.php/profile/stats link and I think the admin panel) to replace the OFC charts in an earlier version. Now, you could just merge the two files but I have split them and updated them for you (haven't tested them) here so take a look and it should work out of the box. If you are looking for charts from an API source (that can be read on say a hub page or something), then check this module out.
-
Ah, aircraft location is not simulated in this module, however there are modules around which simulate that.
-
Can you explain more about this issue please.