public function actionIndex() { $grades = Grade::find()->all(); $schools = School::find()->all(); $users = User::find()->all(); $scholars = Scholar::find()->all(); $tuitions = Tuition::find()->all(); return $this->render('index', array('users' => $users, 'scholars' => $scholars, 'schools' => $schools, 'grades' => $grades, 'tuition' => $tuitions)); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Tuition::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $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->joinWith('scholarScholar'); $query->joinWith('schoolSchool'); $query->andFilterWhere(['tuition_id' => $this->tuition_id, 'scholar_scholar_id' => $this->scholar_scholar_id, 'scholar_school_school_id' => $this->scholar_school_school_id, 'tuition_term' => $this->tuition_term, 'tuition_school_year_start' => $this->tuition_school_year_start, 'tuition_school_year_end' => $this->tuition_school_year_end, 'tuition_enrollment_date' => $this->tuition_enrollment_date, 'tuition_amount' => $this->tuition_amount, 'tuition_payment_date' => $this->tuition_payment_date]); $query->andFilterWhere(['like', 'tuition_paid_status', $this->tuition_paid_status])->andFilterWhere(['like', 'scholar.scholar_first_name', $this->firstName])->andFilterWhere(['like', 'scholar.scholar_middle_name', $this->middleName])->andFilterWhere(['like', 'scholar.scholar_last_name', $this->lastName])->andFilterWhere(['like', 'school.school_name', $this->schoolName]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getTuitions0() { return $this->hasMany(Tuition::className(), ['scholar_school_school_id' => 'school_school_id']); }
/** * Finds the Tuition model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $tuition_id * @param integer $scholar_scholar_id * @param integer $scholar_school_school_id * @return Tuition the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Tuition::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }