/**
  * Lists all Nilai models.
  * @return mixed
  */
 public function actionPenjurusan()
 {
     $searchModel = new NilaiPembobotanKriteriaSearch();
     // $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider = $searchModel->sqlLaporan();
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemplo n.º 2
0
    $searchModel = new NilaiPembobotanKriteriaSearch();
    $hasil = $searchModel->kriteria('psikotes', $model['psikotes']);
    return number_format($hasil[0]['bn'] * $hasil[0]['bp'], 2);
}], ['attribute' => 'total', 'format' => 'html', 'value' => function ($model) {
    $searchModel = new NilaiPembobotanKriteriaSearch();
    $ret = $searchModel->cariNilaiMax($model['nis']);
    $maxarray = max($ret);
    $bobot_nilai = $searchModel->kriteria('nilai', $maxarray['penjurusan']);
    $total_bobot_nilai = number_format($bobot_nilai[0]['bn'] * $bobot_nilai[0]['bp'], 2);
    $bobot_minat = $searchModel->kriteria('minat', $model['minat']);
    $total_bobot_minat = number_format($bobot_minat[0]['bn'] * $bobot_minat[0]['bp'], 2);
    $bobot_psikotes = $searchModel->kriteria('psikotes', $model['psikotes']);
    $total_bobot_psikotes = number_format($bobot_psikotes[0]['bn'] * $bobot_psikotes[0]['bp'], 2);
    return round($total_bobot_nilai + $total_bobot_minat + $total_bobot_psikotes, 2);
}], ['attribute' => 'keputusan', 'format' => 'html', 'value' => function ($model) {
    $searchModel = new NilaiPembobotanKriteriaSearch();
    $patokan = $searchModel->prioritas();
    $ret = $searchModel->cariNilaiMax($model['nis']);
    $maxarray = max($ret);
    $bobot_nilai = $searchModel->kriteria('nilai', $maxarray['penjurusan']);
    $total_bobot_nilai = number_format($bobot_nilai[0]['bn'] * $bobot_nilai[0]['bp'], 2);
    $bobot_minat = $searchModel->kriteria('minat', $model['minat']);
    $total_bobot_minat = number_format($bobot_minat[0]['bn'] * $bobot_minat[0]['bp'], 2);
    $bobot_psikotes = $searchModel->kriteria('psikotes', $model['psikotes']);
    $total_bobot_psikotes = number_format($bobot_psikotes[0]['bn'] * $bobot_psikotes[0]['bp'], 2);
    $total_hitung = round($total_bobot_nilai + $total_bobot_minat + $total_bobot_psikotes, 2);
    $hasil_penjurusan = "";
    if ($total_hitung >= 0.75) {
        $hasil_penjurusan = "IPA";
    }
    if ($total_hitung >= 0.55 && $total_hitung < 0.75) {