コード例 #1
0
ファイル: Uom.php プロジェクト: sangkilsoft/sangkilbiz-3
 public function search($params)
 {
     $query = UomModel::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id_uom' => $this->id_uom, 'create_by' => $this->create_by, 'update_by' => $this->update_by]);
     $query->andFilterWhere(['like', 'cd_uom', $this->cd_uom])->andFilterWhere(['like', 'nm_uom', $this->nm_uom])->andFilterWhere(['like', 'create_date', $this->create_date])->andFilterWhere(['like', 'update_date', $this->update_date]);
     return $dataProvider;
 }
コード例 #2
0
ファイル: _form.php プロジェクト: sangkilsoft/sangkilbiz-3
$form = ActiveForm::begin();
?>
    <div class="panel panel-primary">
        <div class="panel-heading">Product Uoms</div>
        <div class="panel-body">
            <?php 
$id_input = Html::getInputId($model, 'id_product');
$field = $form->field($model, 'id_product', ['template' => "{label}\n{input}\n{text}\n{hint}\n{error}"]);
$field->labelOptions['for'] = $id_input;
$field->input('hidden', ['id' => 'id_product']);
$field->parts['{text}'] = AutoComplete::widget(['model' => $model, 'attribute' => 'idProduct[nm_product]', 'options' => ['class' => 'form-control', 'id' => $id_input], 'clientOptions' => ['source' => Url::toRoute(['product/auto-product']), 'select' => new JsExpression('function(event,ui){$(\'#id_product\').val(ui.item.did)}'), 'open' => new JsExpression('function(event,ui){$(\'#id_product\').val(\'\')}')]]);
echo $field;
?>

            <?php 
echo $form->field($model, 'id_uom')->dropDownList(ArrayHelper::map(Uom::find()->all(), 'id_uom', 'nm_uom'), ['style' => 'width:200px;']);
?>

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



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