-
Posts
1381 -
Joined
-
Last visited
-
Days Won
6
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by Parkho
-
Okay. Let's see here. The checking log should go to the gateway of receiving PIREPS which is in here :Admin/modules/PIREPadmin/PIREPAdmin.php and that should resolve the issues with this. The thing is that if you want this to be a module then you're gonna have to redirect the receiving PIREPS gateway to your module for it to process the flight and after that redirect it back to the admin center for manual approval if any conditions were not met.
-
Here is a small code that you can use in pilot center or public profile. It shows total flights in a particular airline that pilot has flown. Note: If your database table prefix is not phpvms, change this part "phpvms_pireps" to yours in the code. Enjoy <table class="balancesheet" width="50%"> <tr class="balancesheet_header"> <td colspan="2">Airline Flight Count For a Pilot</td> </tr> <tr> <td align="center"><strong>Airline Name</strong></td> <td align="center"><strong>Flight Count</strong></td> </tr> <?php $airlines = OperationsData::getAllAirlines(); foreach($airlines as $airline) { ?> <tr> <td align="center"><?php echo $airline->name ;?></td> <td align="center"> <?php $pilotid = Auth::$userinfo->pilotid; $code = $airline->code; $qry =" SELECT count(pilotid) AS total FROM phpvms_pireps WHERE pilotid='$pilotid' AND code='$code'"); $row = DB::get_row($qry); echo $row->total; ?> </td> </tr> <?php } ?> </table> Screenshot:
-
Change it to this: $gross = $pirep->load * $pirep->price; $fuel = $pirep->fuelused * $pirep-fuelunitcost; $netincome = $gross - $fuel; echo FinanceData::FormatMony($netincome);
-
Okay. One thing is to check your phpvms table prefix in your DB. If your DB prefix for tables is not phpvms then that's where the problem is.
-
Good point. Thanks
-
Look to see if you inserted the code correctly. Your error is mostly from missing a closing argument like "?>" or <?php .
-
I edited the .tpl as well, have you replaced that too?
-
I think it's fixed
-
See if this one helps. http://forum.phpvms.net/topic/7977-pilot-financia-report-v10/
-
Strange! did you copy the .tpl in templates or your skin folder?
-
Are you using any shared server for your site? Cause I think that's where the problem lies not sure though. It's working just fine on this side.
-
Here is another small add-on for those who want to show pilot's financial reports. It's based on pilot id, so the results are for each of you pilots.Cheers Install 1. Download the zip from repo. 2. Unzip and upload in the order of folders. 3. Access financial report for a pilot by <?php echo url('/pfinance') ;?> -----------------OR---------------------- Access financial report for all pilots by <?php echo url('/pfinance/pilots') ;?> 4. Enjoy. Download:PilotFinancialReport_V1.0 Screenshot for a pilot report: Screenshot for all pilots report: Change Log: 1. PilotFinance.class.php & pilots_finance.tpl have been added. Those of you who have downloaded this before should re-download.
-
Hi there, I'm trying to get sum of revenue for a pilot's all PIREPS, so here is the function: public static function totalrev($pilotid) { $sql = 'SELECT pilotid, SUM(revenue) FROM '.TABLE_PREFIX.'pireps WHERE pilotid='.intval($pilotid).' GROUP by '.$pilotid ; return DB::get_results($sql); } And I have the following in my .tpl file: $pilotid = Auth::$userinfo->pilotid ; $row = PIREPData::totalrev($pilotid); echo FinanceData::formatMoney($row); And I get nothing. please help me find out where I'm wrong. Thanks
-
Yes that's possible. Do you know how to create a module or have a knowledge of php?
-
So is that working?
-
You can use the PIREPS revenue to show that up meaning a table for each pilot in admin center showing you the revenue of each flight and at the end of the day a sum of all flights with earnings whether it's negative or positive. Then you can manage the pilot as to if he/she is actually profitable for your airline or not. Now, if you wanna show that in the front page, that's also possible, so what do you wanna do exactly?
-
Maybe you can include the NAV data such as ILS frequencies and VOR/DME and even some approach information, Approach/tower/ground frequencies and information like those.
-
Okay. I can make that change. Thanks
-
I have tested it and it works fine, maybe mseiwald is right and you're gonna have to change the <50 to >-50.
-
(SOLVED) Adding KLGB - Long Beach, CA airport error and schedule issue
Parkho replied to Ghiby's topic in Support Forum
Piece of cake ha! hehe -
I have created a PDF to setup the kACARS-Free. Just follow the instructions on the PDF and you should be fine. Cheers kACARS-Free.pdf
-
(SOLVED) Adding KLGB - Long Beach, CA airport error and schedule issue
Parkho replied to Ghiby's topic in Support Forum
Problem 1: You're gonna have to add those airports manually using the same form for adding airports in admin area but instead of letting the function do it for you, you need, like I mentioned, a third party software such as Google Earth or some similar software on the web or just google the airport for the information. Then you need the following info: 1. Airport ICAO code : Insert KLGB manually. 2. Airport name: Insert the name of the airport. 3. Country name: Insert the country of your airport. 4. Latitude: this is very important and you need to get that info either from google search or the google earth software. 5. Longitude: The same as #4. 6. Finally the price: You could insert any price for the fuel usage you want, leave it blank will be 0 and results in 0 fuel cost calculation for your flights. And make it a HUB if you'd like by checking the appropriate check box and hit the "Add Airport" button. Problem 2: I'm glad I could help and please make your post as solved if it's solved. Personal Conversation: I will answer you in a short while of my decision. Cheers -
Great man. Well done.
-
First off add a column into your phpvms_pilots in your DB as "bonus" the type must be "float" and set default az "0". Then open the following: Admin/modules/PIREPadmin/PIREPAdmin.php go down to line 298 and find the function called : approve_pirep_post(). Now go to the end of it and add the following: After this: # Call the event CodonEvent::Dispatch('pirep_accepted', 'PIREPAdmin', $pirep_details); Add this: # Give Bonus to good pilots $pilotbonus = "500"; $userinfo = PilotData::getPilotData($pirep_details->pilotid); if($pirep_details->landingrate > -50 OR $pirep_details->flighttime > 8) { $totalpay = $pilotbonus + $userinfo->totalpay ; $bonus = $pilotbonus +$userinfo->bonus; $fields = array ( 'totalpay' => $totalpay, 'bonus' => $bonus, ); PilotData::updateProfile($userinfo->pilotid, $fields); } then go to your profile_main.tpl and after this: <li><strong>Total Money: </strong><?php echo FinanceData::FormatMoney($userinfo->totalpay) ?></li> Add this: <li><strong>Total Bonus: </strong><?php echo FinanceData::FormatMoney($userinfo->bonus) ?></li> Now when you recieve pireps and hit the accept button, your pilots get bonus on low landing rate or long haul. Off course you can adjust the variables to your desire as follows: $pilot bonus = "500" // This is set to 500 and can be changed. landing rate is set to -50 ft/m. flight time is set to 8 hours. Enjoy.