Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Companys::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', 'company_name', $this->company_name])->andFilterWhere(['like', 'address', $this->address]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
    <div class="row">    
        <div class="col-xs-6 col-sm-6 col-md-6">            
            <?php 
echo $form->field($model, 'budget')->radioList(app\models\Tools::itemAlias('budget'));
?>
        </div>
        <div class="col-xs-6 col-sm-6 col-md-6">            
            <?php 
echo $form->field($model, 'howbuy')->radioList(app\models\Tools::itemAlias('howbuy'));
?>
        </div>
    </div>
    <div class="row">        
        <div class="col-xs-6 col-sm-6 col-md-6">           
            <?php 
echo $form->field($model, 'company_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Companys::find()->all(), 'id', 'company_name'), 'language' => 'th', 'options' => ['placeholder' => 'เลือกบริษัท ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3">
<?php 
echo $form->field($model, 'price')->textInput(['maxlength' => true]);
?>
        </div>
    </div>    
    <div class="row">

        <div class="col-xs-3 col-sm-3 col-md-3">
            <?php 
echo $form->field($model, 'serial')->textInput(['maxlength' => true]);
?>
        </div>