public function searchPayment($params)
 {
     $pageSize = Yii::$app->params['pageSize'];
     $query = PaymentForm::find();
     $dataProvider->sort->attributes['id'] = ['asc' => ['id' => SORT_ASC], 'desc' => ['id' => SORT_DESC]];
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['id' => SORT_DESC]], 'pagination' => ['pageSize' => $pageSize]]);
     $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, 'student_id' => $this->student_id, 'payment_description' => $this->payment_description, 'transaction' => $this->transaction, 'paid_amount' => $this->paid_amount]);
     return $dataProvider;
 }
Exemple #2
0
<?php

use app\models\Options;
use yii\helpers\Html;
use app\models\AssessmentForm;
use app\models\PaymentForm;
$this->title = implode(' ', [$model->student->first_name, $model->student->middle_name, $model->student->last_name]);
$payments = PaymentForm::find()->where(['assessment_id' => $assessment[0]->id])->orderBy(['id' => SORT_DESC])->all();
?>
<div class="ui two column stackable grid">
    <div class="four wide column">
        <div class="column">
            <?php 
echo $this->render('_card', ['model' => $model]);
?>
        </div>
    </div>
    <div class="nine wide column">
        <div class="column">
            <?php 
echo $this->render('_detail', ['model' => $model, 'assessment' => $assessment[0], 'payments' => $payments]);
?>
        </div>
    </div>
    <div class="three wide column">
        <div class="column">
            <?php 
echo Options::render(['scenario' => Yii::$app->controller->action->id, 'id' => $model->id]);
?>
        </div>
    </div>
 protected function findPayments($id)
 {
     if (($payments = PaymentForm::find()->where(['assessment_id' => $id])->orderBy(['id' => SORT_DESC])->all()) !== null) {
         return $payments;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }