Sorry mate not working have I put it in the correct place
if (!PIREPData::updateFlightReport($this->post->pirepid, $data)) {
$this->set('message', 'There was an error editing your PIREP');
$this->render('core_error.tpl');
return false;
}
PIREPData::SaveFields($this->post->pirepid, $_POST);
//Accept or reject?
$this->post->id = $this->post->pirepid;
$submit = strtolower($this->post->submit_pirep);
// Add a comment
if (trim($this->post->comment) != '' && $submit != 'reject pirep') {
PIREPData::AddComment($this->post->pirepid, Auth::$userinfo->pilotid, $this->post->comment);
}
if ($submit == 'accept pirep') {
$this->approve_pirep_post();
$this->set('firstname', $pirep_details->firstname);
$this->set('lastname', $pirep_details->lastname);
$this->set('pirepid', $pirepid);
$message = Template::GetTemplate('email_pirep_accep.tpl', true);
Util::SendEmail($pirep_details->email, 'Comment Added', $message);
} elseif ($submit == 'reject pirep') {
$this->reject_pirep_post();
}
StatsData::UpdateTotalHours();
# Refresh the PIREP
# $pirepInfo = PIREPData::getReportDetails($this->post_action->pirepid);
PilotData::updatePilotStats($pirepInfo->pilotid);
LogData::addLog(Auth::$userinfo->pilotid, 'Edited PIREP #' . $this->post->id);
return true;
}
}