Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 public function actionDeletemetric($metric_id, $kpi_id)
 {
     $metric = Metrics::findOne($metric_id);
     //@todo: make sure to check for a valid object/model
     if (isset($metric)) {
         $metric->delete($metric_id);
     }
     Yii::$app->response->redirect(array('/site/viewkpi', 'id' => $kpi_id));
 }