public function searchtermgeneral($params, $id)
 {
     $query = Termgeneral::find()->where(['ID_TERM' => $id]);
     $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, 'STATUS' => $this->STATUS, 'CREATE_AT' => $this->CREATE_AT, 'UPDATE_AT' => $this->UPDATE_AT]);
     $query->andFilterWhere(['like', 'SUBJECT', $this->SUBJECT])->andFilterWhere(['like', 'ISI_TERM', $this->ISI_TERM])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);
     return $dataProvider;
 }
Beispiel #2
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use lukisongroup\master\models\Termgeneral;
use kartik\widgets\Select2;
/* @var $this yii\web\View */
/* @var $model lukisongroup\master\models\Termgeneral */
/* @var $form yii\widgets\ActiveForm */
$data = Termgeneral::find()->all();
$to = "ID";
$from = "SUBJECT";
?>

<div class="termgeneral-form">

    <?php 
$form = ActiveForm::begin(['id' => $model->formName()]);
?>


    <?php 
echo $form->field($model, 'GENERAL_TERM')->widget(Select2::classname(), ['options' => ['placeholder' => 'Select  ...'], 'data' => $model->data($data, $to, $from)]);
?>


    <!-- $form->field($model, 'ISI_TERM')->textarea(['rows' => 6]) ?> -->

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);