/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = FeesPaymentTransaction::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['fees_pay_tran_id' => $this->fees_pay_tran_id, 'fees_pay_tran_collect_id' => $this->fees_pay_tran_collect_id, 'fees_pay_tran_stu_id' => $this->fees_pay_tran_stu_id, 'fees_pay_tran_batch_id' => $this->fees_pay_tran_batch_id, 'fees_pay_tran_course_id' => $this->fees_pay_tran_course_id, 'fees_pay_tran_section_id' => $this->fees_pay_tran_section_id, 'fees_pay_tran_mode' => $this->fees_pay_tran_mode, 'fees_pay_tran_cheque_no' => $this->fees_pay_tran_cheque_no, 'fees_pay_tran_bank_id' => $this->fees_pay_tran_bank_id, 'fees_pay_tran_amount' => $this->fees_pay_tran_amount, 'fees_pay_tran_date' => $this->fees_pay_tran_date, 'created_at' => $this->created_at, 'created_by' => $this->created_by, 'updated_at' => $this->updated_at, 'updated_by' => $this->updated_by, 'is_status' => $this->is_status]); return $dataProvider; }
use yii\helpers\Html; ?> <html> <head> <title><?php echo Yii::t('fees', 'Fees Collection Category Wise PDF Report'); ?> </title> </head> <body> <?php $totalAmount = $gTotalAmount = $gpayFees = $gActualCollect = $payFees = $actualCollect = 0; $stuDataTmp = Yii::$app->db->createCommand("SELECT stu_master_id FROM stu_master WHERE stu_master_batch_id=" . $FccModel->fees_collect_batch_id . " AND is_status=0")->queryColumn(); $payFeesTmp = Yii::$app->db->createCommand("SELECT fees_pay_tran_stu_id FROM fees_payment_transaction WHERE fees_pay_tran_batch_id=" . $FccModel->fees_collect_batch_id . " AND is_status=0 AND fees_pay_tran_collect_id=" . $FccModel->fees_collect_category_id)->queryColumn(); $stuData = array_unique(array_merge($stuDataTmp, $payFeesTmp)); $feesData = \app\modules\fees\models\FeesPaymentTransaction::find()->where(['fees_pay_tran_batch_id' => $FccModel->fees_collect_batch_id, 'is_status' => 0])->asArray()->all(); $totalAmountTmp = \app\modules\fees\models\FeesCategoryDetails::getFeeCategoryTotal($FccModel->fees_collect_category_id); $totalAmount = !$totalAmountTmp ? 0 : $totalAmountTmp; ?> <div class="grid-view"> <?php if (!empty($stuData)) { echo '<table class="table table-striped">'; echo '<tr>'; echo '<th class="text-center">' . Yii::t('fees', 'SI No.') . '</th>'; echo '<th>' . Yii::t('fees', 'Student No') . '</th>'; echo '<th>' . Yii::t('fees', 'Student Name') . '</th>'; echo '<th>' . Yii::t('fees', 'Total Collection') . '</th>'; echo '<th>' . Yii::t('fees', 'Paid Amount') . '</th>'; echo '<th>' . Yii::t('fees', 'Unpaid Amount') . '</th>'; echo '</tr>';