Hello here is my file
// Add the comment if its not blank
if ($comment != '') {
self::addComment($pirepid, $pirepdata['pilotid'], $comment);
}
# Update the financial information for the PIREP, true to refresh fuel
self::PopulatePIREPFinance($pirepid, true);
# Do other assorted tasks that are along with a PIREP filing
# Update the flown count for that route
self::UpdatePIREPFeed();
# Update any pilot's information
$pilotinfo = PilotData::getPilotData($pirepdata['pilotid']);
$pilotcode = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);
PilotData::UpdateLastPIREPDate($pilotinfo->pilotid);
PirepAcData::search($pirepid);
if (Config::Get('EMAIL_SEND_PIREP') === true) {
# Send an email to the admin that a PIREP was submitted
$sub = "A PIREP has been submitted by {$pilotcode} ({$pirepdata['depicao']} - {$pirepdata['arricao']})";
$message = "A PIREP has been submitted by {$pilotcode} "
."({$pilotinfo->firstname} {$pilotinfo->lastname})\n\n"
."{$pirepdata['code']}{$pirepdata['flightnum']}: {$pirepdata['depicao']} to {$pirepdata['arricao']}\n"
."Aircraft: {$pirepdata['aircraft']}\n" . "Flight Time: {$pirepdata['flighttime']}\n"
."Landing Rate: {$pirepdata['landingrate']}\n"."Filed using: {$pirepdata['source']}\n\n"
."Comment: {$comment}\n\n"
."Click to approve this pirep (admin must be signed in):\n"
.adminurl('/pirepadmin/approvepirep/'.$pirepid);
$email = Config::Get('EMAIL_NEW_PIREP');
if (empty($email)) {
$email = ADMIN_EMAIL;
}
Util::SendEmail($email, $sub, $message);
}
/* Add this into the activity feed */
$message = Lang::get('activity.new.pirep');
foreach($pirepdata as $key=>$value) {
$message = str_replace('$'.$key, $value, $message);
}
# Add it to the activity feed
ActivityData::addActivity(array(
'pilotid' => $pirepdata['pilotid'],
'type' => ACTIVITY_NEW_PIREP,
'refid' => $pirepid,
'message' => htmlentities($message),
));
/* Now send data to vaCentral */
CentralData::send_pirep($pirepid);
// Reset this ID back
DB::$insert_id = $pirepid;
self::$pirepid = $pirepid;
return $pirepid;
}