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.