예제 #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');
     }
 }