diff --git a/~dev_rating/application/classes/Controller/Teacher/Discipline.php b/~dev_rating/application/classes/Controller/Teacher/Discipline.php index dab0092f97c2465daf0af86c4751e4eae0346d1e..5c9985abb49a387d4cad1b589e2b7b00219aef54 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Discipline.php +++ b/~dev_rating/application/classes/Controller/Teacher/Discipline.php @@ -70,6 +70,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi { $twig->User = $this->UserInfo; $twig->Discipline = $this->GetDisciplineInfo($db, $id); + $twig->GroupsForDiscipline = $this->GetGroupsForDiscipline($db, $id); $twig->StudyGroups = $this->GetStudyGroupsOrdByGroups($db, $twig->Discipline['GradeID'], $twig->Discipline['FacultyID']); @@ -184,7 +185,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi { $subject['LectureHours'] = $info['LectionCount']; $subject['PracticeHours'] = $info['PracticeCount']; - $subject['GradeID'] = $info['DisciplineGrade']; + $subject['GradeID'] = $info['GradeID']; $teachersHandled = array(); $i = 0; @@ -267,8 +268,8 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi { return $studentsHandled; } - private function GetStudyGroupsOrdByGroups($db, $Grade, $FacultyID) { - $Groups = $db->GetStudyGroupsOrdByGroups($Grade, $FacultyID); + private function GetStudyGroupsOrdByGroups($db, $GradeID, $FacultyID) { + $Groups = $db->GetStudyGroupsOrdByGroups($GradeID, $FacultyID); $GroupsHandled = array(); $i = 0; diff --git a/~dev_rating/application/classes/Controller/Teacher/Index.php b/~dev_rating/application/classes/Controller/Teacher/Index.php index 552f784dd3add0ff615817acc3f95a4f8f858226..f4eb811ab15036cff095792859c730d04ebf68b8 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Index.php +++ b/~dev_rating/application/classes/Controller/Teacher/Index.php @@ -12,12 +12,12 @@ class Controller_Teacher_Index extends Controller_UserEnvi { $groupsInDiscipline = array(); $degrees = array('bachelor' => 'Бакалавриат', 'specialist' => 'Специалитет', 'master' => 'Магистратура'); foreach ($disciplines as $row) { - if($subjID != $row['SubjectID'] || $gradeNum != $row['StudyGroupGrade']) + if($subjID != $row['SubjectID'] || $gradeNum != $row['GradeID']) { $i++; $j = $k = 0; $groupsInDiscipline = array(); $subjID = $row['SubjectID']; - $gradeNum = $row['StudyGroupGrade']; + $gradeNum = $row['GradeID']; $disciplinesHandled[$i]['Title'] = $row['SubjectName']; $disciplinesHandled[$i]['GradeNum'] = $row['DisciplineGrade']; $disciplinesHandled[$i]['Degree'] = $degrees[$row['DisciplineDegree']]; @@ -40,6 +40,9 @@ class Controller_Teacher_Index extends Controller_UserEnvi { } $twig->Subjects = $disciplinesHandled; $twig->User = $this->UserInfo; + + echo Debug::vars( $disciplinesHandled); + $this->response->body($twig); }