/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Lessons::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(['lesson_id' => $this->lesson_id, 'id_group' => $this->id_group, 'id_faculty' => $this->id_faculty, 'id_speciality' => $this->id_speciality, 'course' => $this->course, 'semester' => $this->semester, 'id_okr' => $this->id_okr, 'is_numerator' => $this->is_numerator, 'id_discipline' => $this->id_discipline, 'id_teacher' => $this->id_teacher, 'id_classroom' => $this->id_classroom, 'day' => $this->day, 'is_holiday' => $this->is_holiday, 'all_group' => $this->all_group, 'all_speciality' => $this->all_speciality, 'lesson_number' => $this->lesson_number, 'comment' => $this->comment]); return $dataProvider; }
<?php echo $this->render('_beginForm', ['model' => $model]); ?> </div> <div class="col-md-5"> <h2>Вже існуючі розклади</h2> <div class="panel-group" role="tablist"> <?php $all_faculty = Faculty::find()->orderBy('faculty_name ASC')->all(); $count = 0; foreach ($all_faculty as $af) { unset($groups_array); $all_gr = Lessons::find()->where(['id_faculty' => $af['faculty_id']])->select('id_group')->distinct()->all(); foreach ($all_gr as $ag) { $gr = Groups::find()->where(['group_id' => $ag['id_group']])->all(); if ($gr[0]['parent_group'] == 0) { $groups_array[] = $gr[0]['group_id']; } else { $groups_array[] = $gr[0]['parent_group']; } } $groups_list = array_unique($groups_array); ?> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="collapseListGroupHeading<?php echo $count; ?> ">