Пример #1
0
 public function buy_exam()
 {
     $id = $_GET['id'];
     $pid = Auth::$userinfo->pilotid;
     $examcost = ExamsData::buy_exam($id);
     $pilotmoney = Auth::$userinfo->totalpay;
     if ($examcost->cost > $pilotmoney) {
         $this->set('message', '<div id="error"><b>You do not have enough funds in your company account to purchase the ' . $examcost->exam_description . ' exam!</b></div>');
         $this->set('exams', ExamsData::get_exams());
         $this->set('pilotmoney', $pilotmoney);
         $this->show('exams/exam_list');
     } else {
         $this->set('examdescription', $examcost->exam_description);
         $this->set('examid', $examcost->id);
         $this->set('examcost', $examcost->cost);
         $this->set('pilotmoney', $pilotmoney);
         $this->show('exams/exam_purchase_confirm');
     }
 }
Пример #2
0
 public function unassign_exam()
 {
     $pilot_id = $_GET['pilot_id'];
     $exam_id = $_GET['exam_id'];
     ExamsData::unassign_exam($pilot_id, $exam_id);
     $this->set('pilot', PilotData::GetPilotData($pilot_id));
     $this->set('exams', ExamsData::get_exams());
     $this->set('assigned', ExamsData::get_assigned_exams($pilot_id));
     $this->show('exams/exam_assign_list');
 }