Example #1
0
<?php

use yii\helpers\Html;
/* Script condition untuk status target
 * Merah = Belum ada form | abu-abu = dalam proses | Biru proses complite
 */
$datawiki = \kemdikbud\to\models\Outputbaseline::findOne(['id_base_line' => $model->id]);
if (empty($datawiki)) {
    $class_sintax = 'danger';
} elseif (!empty($datawiki)) {
    $class_sintax = 'default';
}
/* Script condition untuk status target
 * Merah = Belum ada form | abu-abu = dalam proses | Biru proses complite
 */
/* Script untuk count output target */
$arraybaselinesudahselesai = \kemdikbud\to\models\Outputbaseline::findone(['id_base_line' => $model->id]);
if ($arraybaselinesudahselesai['nama_class']) {
    $class_name = '\\kemdikbud\\to\\models\\' . ucfirst($arraybaselinesudahselesai['nama_class']);
    $count = $class_name::find()->count();
} else {
    $count = '-';
}
/* Script untuk count output target */
?>

<div class="col-sm-12 col-md-12">
	<div class="panel panel-<?php 
echo $class_sintax;
?>
">
 /**
  * Finds the Outputbaseline model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Outputbaseline the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Outputbaseline::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }