Jump to content

Parkho

Moderators
  • Posts

    1375
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Parkho

  1. I edited the .tpl as well, have you replaced that too?
  2. See if this one helps. http://forum.phpvms.net/topic/7977-pilot-financia-report-v10/
  3. Strange! did you copy the .tpl in templates or your skin folder?
  4. 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.
  5. 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.
  6. 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
  7. Yes that's possible. Do you know how to create a module or have a knowledge of php?
  8. 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?
  9. 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.
  10. Parkho

    kACARS-Free Guide

    Okay. I can make that change. Thanks
  11. I have tested it and it works fine, maybe mseiwald is right and you're gonna have to change the <50 to >-50.
  12. 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
  13. 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
  14. 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.
  15. No worries man. I'm glad I could help. Also, how's the tour system working out for you? I'm actually working on a tour system pretty much from scratch, so just wanted to get some opinions. I really would appreciate it if you liked my last post. Thanks
  16. Ok I got it working. First off forget the last post, so 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> Then you should be home safe . Cheers
  17. Sounds like a plan. First add a column to your phpvms_pilots in your DB as "bonus" the type must be "float" and set default to "0" then add this to your profile_main.tpl. It's not tested, so give it a try and let me know: <?php $pilot = PilotData::getPilotData(Auth::$userinfo->pilotdid); $pirep = PIREPData::getLastReports($pilot,1); $pilotbonus = "500"; if($pirep->landingrate < 50) { $bonus = $pilotbonus + $pilot->totalpay ; $fields = array ( 'bonus' => $bonus, ); PilotData::updateProfile($pilot, $fields); } ?> <li><strong>Total Bonus: </strong><?php echo FinanceData::FormatMoney($userinfo->bonus) ?></li> Use the same code for the total hours like this: if($pirep->flighttime > 8) { $bonus = $pilotbonus +$pilot->totalpay; $fields = array( 'bonus' =>$bonus, ) PilotData::updateProfile($pilot, $fields); }
  18. It could be done automatically, so you need to specify on which condition the bonus should be paid to the pilot and simply update their profile using some codings .
  19. Problem 1: Some airports are not recognized by the add airport form in admin area, so I'm afraid you're gonna have to add them manually using google earth or some similar tools to get the lat and lon. Problem 2: There might be several reasons. The most common one is the days of the week that the schedule might not be set on all week days at the beginning, so check to make sure of that. The other one is an option in local.config.php in the core folder that hides the schedules which have been bid on and that bid is still on, so check to make sure of that as well. The other reason that I could think of is the schedule_results.tpl in templates subfolder in core folder that there might be some filtering out codes which of course someone had done it. Other than those, there shouldn't be any problems.
×
×
  • Create New...