예제 #1
0
파일: Pilots.php 프로젝트: Galihom/phpVMS
 /**
  * Pilots::statsmonthsdata()
  * 
  * @param mixed $pilotid
  * @return
  */
 public function statsmonthsdata($pilotid)
 {
     $data = PIREPData::getIntervalDataByMonth(array('p.pilotid' => $pilotid), 3);
     $this->create_line_graph('Monthly Flight Stats', $data);
 }
예제 #2
0
 public function viewreport()
 {
     $type = $this->get->type;
     $params = $this->formfilter();
     /**
      * Check the first letter in the type
      * m#### - month
      * y#### - year
      * 
      * No type indicates to view the 'overall'
      */
     if ($type[0] == 'm') {
         $type = str_replace('m', '', $type);
         $period = date('F Y', $type);
         $check = date('Ym', $type);
         $finance_data = $this->getmonthly($check);
         $finance_data = FinanceData::calculateFinances($finance_data[0]);
         $this->set('title', 'Balance Sheet for ' . $period);
         $this->set('month_data', $finance_data);
         $this->render('finance_balancesheet.tpl');
     } elseif ($type[0] == 'y') {
         $type = str_replace('y', '', $type);
         $year = date('Y', $type);
         $all_finances = $this->getyearly($year);
         $this->set('title', 'Balance Sheet for Year ' . date('Y', $type));
         $this->set('allfinances', $all_finances);
         $this->set('year', date('Y', $type));
         $this->render('finance_summarysheet.tpl');
     } else {
         // This should be the last 3 months overview
         # Get the last 3 months
         $months = 3;
         $params['p.accepted'] = PIREP_ACCEPTED;
         $finance_data = PIREPData::getIntervalDataByMonth($params, $months);
         $this->set('title', 'Balance Sheet for Last 3 Months');
         $this->set('allfinances', $finance_data);
         $this->render('finance_summarysheet.tpl');
     }
 }