Exemplo n.º 1
0
 public function actionViewkpi($id)
 {
     $kpi = KPI::findOne($id);
     $metrics = Metrics::find()->where(['kpi_id' => $id])->all();
     $goal = Goal::findOne($kpi->Goal_ID);
     $kpa = KPA::findOne($goal->KPA_ID);
     return $this->render('viewkpi', ['kpi' => $kpi, 'metrics' => $metrics, 'goal' => $goal, 'kpa' => $kpa]);
 }
Exemplo n.º 2
0
 public function overallScore()
 {
     $total = 0;
     $metrics = Metrics::find()->where(['KPI_ID' => $this->ID])->all();
     foreach ($metrics as $metric) {
         $total += $metric->Weight * ($metric->Current / $metric->Target);
     }
     return $total;
 }