/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Outputbaseline::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'id_base_line' => $this->id_base_line, 'date_created' => $this->date_created, 'id_user_created' => $this->id_user_created, 'date_updated' => $this->date_updated, 'id_user_updated' => $this->id_user_updated, 'approved' => $this->approved, 'date_approved' => $this->date_approved]);
     $query->andFilterWhere(['like', 'nama_tabel', $this->nama_tabel])->andFilterWhere(['like', 'nama_kolom_array', $this->nama_kolom_array])->andFilterWhere(['like', 'nama_kolom_json', $this->nama_kolom_json])->andFilterWhere(['like', 'nama_class', $this->nama_class]);
     return $dataProvider;
 }
Example #2
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kemdikbud\to\models\Baseline;
use kemdikbud\to\models\Outputbaseline;
use wbraganca\dynamicform\DynamicFormWidget;
/* @var $this yii\web\View */
/* @var $model kemdikbud\to\models\Outputbaseline */
/* @var $form yii\widgets\ActiveForm */
/* Script condition untuk Dropdown
 * Form output hanya 1 untuk tiap target
 * Ketika format form sudah dibuat maka tidak bisa dibuat form lagi
 */
$arraybaseline = Outputbaseline::find()->select('id_base_line')->indexBy('id_base_line')->column();
$arraybaselinesudahselesai = [];
foreach ($arraybaseline as $key => $value) {
    $arraybaselinesudahselesai[':' . $key] = $value;
}
$stringcondition = '';
$urutan_index = 0;
foreach ($arraybaselinesudahselesai as $key => $value) {
    $urutan_index++;
    if ($urutan_index !== count($arraybaselinesudahselesai)) {
        $stringcondition .= 'id != ' . $key . ' and ';
    } else {
        $stringcondition .= 'id != ' . $key;
    }
}
/* Script condition untuk Dropdown