/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = FakthaRiskSimple::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]);
     $query->andFilterWhere(['like', 'name', $this->name]);
     return $dataProvider;
 }
Esempio n. 2
0
  
    <?php 
echo $form->field($model, 'risk_program_text')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'login_name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'risk_sum_dep')->textInput();
?>

    <?php 
echo $form->field($model, 'risk_simple')->widget(Select2::classname(), ['data' => ArrayHelper::map(FakthaRiskSimple::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'เลือกรายการตาม simple ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
  

    <?php 
echo $form->field($model, 'date_input')->widget(DatePicker::classname(), ['language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true], 'options' => ['class' => 'form-control']]);
?>

    <?php 
echo $form->field($model, 'last_update')->textInput();
?>

    <?php 
echo $form->field($model, 'last_staff')->textInput(['maxlength' => true]);
?>