Esempio n. 1
0
 protected function AddAward()
 {
     if ($this->post->awardid == '' || $this->post->pilotid == '') {
         return;
     }
     # Check if they already have this award
     $award = AwardsData::GetPilotAward($this->post->pilotid, $this->post->awardid);
     if ($award) {
         $this->set('message', Lang::gs('award.exists'));
         $this->render('core_error.tpl');
         return;
     }
     AwardsData::AddAwardToPilot($this->post->pilotid, $this->post->awardid);
     $pilot = PilotData::getPilotData($this->post->pilotid);
     LogData::addLog(Auth::$userinfo->pilotid, 'Added and award to ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' - ' . $pilot->firstname . ' ' . $pilot->lastname);
 }