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
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdPayment0()
 {
     return $this->hasOne(PaymentModel::className(), ['id' => 'idPayment']);
 }
Exemplo n.º 3
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>
Exemplo n.º 4
0
 /**
  * Finds the PaymentModel model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PaymentModel the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PaymentModel::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }