public function actionUpdate($id)
{
$model = $this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Delivery'])) {
$model->attributes = $_POST['Delivery'];
if ($model->save()) {
Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('DeliveryModule.delivery', 'Record updated!'));
if (!isset($_POST['submit-type'])) {
$this->redirect(['update', 'id' => $model->id]);
} else {
$this->redirect([$_POST['submit-type']]);
}
}
}
$payments = Payment::model()->published()->findAll(['order' => 'position']);
$this->render('update', ['model' => $model, 'payments' => $payments]);
}