예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Datasources::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'change_data' => $this->change_data]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'type', $this->type])->andFilterWhere(['like', 'string', $this->string]);
     return $dataProvider;
 }
예제 #2
0
}
?>
                <?php 
echo $form->field($model, 'search_name')->textInput();
?>

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

                <?php 
echo $form->field($model, 'visible')->checkbox();
?>

                <?php 
echo $form->field($model, 'datasource_id')->dropDownList(ArrayHelper::map(Datasources::find()->all(), 'id', 'name'));
?>

                <?php 
echo $form->field($model, 'sql_search')->textarea(['rows' => 3]);
?>
            </div>
            <div id="yw0_tab_2" class="tab-pane">
                <?php 
echo Html::button('Novo', ['class' => 'btn btn-success', 'onclick' => 'AddParameters();']);
?>
                <div class="modal fade" id="parameters_model" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>

                <script>
                    function AddParameters() {
                        $.ajax({
예제 #3
0
?>

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

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

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

                <?php 
$items_format = ArrayHelper::map(Datasources::find()->all(), 'id', 'name');
?>
                <?php 
echo $form->field($model, 'datasource_id')->dropDownList($items_format);
?>

                <?php 
echo $form->field($model, 'sql_select')->textarea(['rows' => 3]);
?>

            </div>

            <div id="yw0_tab_2" class="tab-pane">
                <?php 
echo Html::button('Novo', ['class' => 'btn btn-success', 'onclick' => 'AddParameters();']);
?>