diff --git a/~dev_rating/application/classes/Controller/Handler/Map.php b/~dev_rating/application/classes/Controller/Handler/Map.php index c91471871ad8d1d54835128086b1e8f16d6b9cdb..d7b7387a5776e64eebc94bb6d63d3732013c1ca4 100644 --- a/~dev_rating/application/classes/Controller/Handler/Map.php +++ b/~dev_rating/application/classes/Controller/Handler/Map.php @@ -364,7 +364,7 @@ class Controller_Handler_Map extends Controller_Handler { $this->response->body(json_encode($data)); } - /* + public function action_SearchStudents() { $data['result'] = false; $this->post -> rule('Grade', 'digit') @@ -372,19 +372,19 @@ class Controller_Handler_Map extends Controller_Handler { -> rule('FacultyID', 'digit'); if($this->post->check()) { $SeResult = $this->model->SearchStudents( - $this->post->offsetGet('Grade', 'null'), - $this->post->offsetGet('GroupN', 'null'), - $this->post->offsetGet('FacultyID', 'null'), - $this->post->offsetGet('Last', 'null'), - $this->post->offsetGet('First', 'null'), - $this->post->offsetGet('Second', 'null') + $this->post->offsetGet('Grade'), + $this->post->offsetGet('GroupN'), + $this->post->offsetGet('FacultyID'), + $this->post->offsetGet('Last'), + $this->post->offsetGet('First'), + $this->post->offsetGet('Second') ); var_dump($this->post->offsetGet($SeResult)); } $this->response->body(json_encode($data)); } - */ + // Прикрепить преподавателя public function action_BindTeacher() { diff --git a/~dev_rating/application/classes/Controller/Teacher/Map.php b/~dev_rating/application/classes/Controller/Teacher/Map.php index c4970febe61dee41e71cfe021b5c9041f82ddf6e..71e839f40ea830bcc51538126f7fa75007117c29 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Map.php +++ b/~dev_rating/application/classes/Controller/Teacher/Map.php @@ -97,7 +97,7 @@ class Controller_Teacher_Map extends Controller_UserEnvi { $twig->User = $this->UserInfo; $twig->Discipline = $this->getDisciplineInfo($db, $id); $twig->GroupsForDiscipline = $this->GetGroupsForDiscipline($db, $id); - $twig->StudyGroups = $this->GetStudyGroups($db, $this->GradeID, $this->UserInfo['FacultyID']); + $twig->StudyGroups = $this->GetStudyGroupsOrdByGroups($db, $this->GradeID, $twig->Discipline['FacultyID']); $this->response->body($twig); } @@ -272,8 +272,8 @@ class Controller_Teacher_Map extends Controller_UserEnvi { return $studentsHandled; } - private function GetStudyGroups($db, $Grade, $FacultyID) { - $Groups = $db->GetStudyGroups($Grade, $FacultyID); + private function GetStudyGroupsOrdByGroups($db, $Grade, $FacultyID) { + $Groups = $db->GetStudyGroupsOrdByGroups($Grade, $FacultyID); $GroupsHandled = array(); $i = 0; diff --git a/~dev_rating/application/classes/Model/Teacher/Map.php b/~dev_rating/application/classes/Model/Teacher/Map.php index db47747a607af2ab8a4e54a70c7610b09f4fc29c..5d06e178b3074dd93058afc1b9ff5e24439cd49f 100644 --- a/~dev_rating/application/classes/Model/Teacher/Map.php +++ b/~dev_rating/application/classes/Model/Teacher/Map.php @@ -134,6 +134,12 @@ class Model_Teacher_Map extends Model return DB::query(Database::SELECT, $sql)->execute(); } + public function GetStudyGroupsOrdByGroups($Grade, $FacultyID) + { + $sql = "CALL `GetStudyGroupsOrdByGroups`('$Grade', '$FacultyID'); "; + return DB::query(Database::SELECT, $sql)->execute(); + } + public function ChangeModuleOrder($teacherID, $moduleID, $OrderNum) { $sql = "SELECT `ChangeModuleOrder`('$teacherID', '$moduleID', '$OrderNum') AS `Num`;";