Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = PaymentModel::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'systemName', $this->systemName])->andFilterWhere(['like', 'description', $this->description]);
     return $dataProvider;
 }
Exemplo n.º 2
0
?>

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

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

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

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

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

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

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