diff --git a/~dev_rating/application/classes/Controller/Teacher/Rating.php b/~dev_rating/application/classes/Controller/Teacher/Rating.php index ea228858b113618c3ba8f3f313f6085bb8fc2020..8e481273b2d57500984fcfb56a6b4c84588d71b8 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Rating.php +++ b/~dev_rating/application/classes/Controller/Teacher/Rating.php @@ -5,7 +5,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { private function GetSGID($id) { # $id = disciplineID - $SG_json = json_decode(Cookie::get('SGID', null)); + $SG_json = json_decode(Cookie::get('SGID', null), true); if ($SG_json !== null) { var_dump($SG_json, $id); diff --git a/~dev_rating/application/views/teacher/rating.twig b/~dev_rating/application/views/teacher/rating.twig index c3eb7b6fd3fb906ad626b9aab80105a1cad656c8..d4bf47f55ccb0767a9adf5b710f231bcd153d410 100644 --- a/~dev_rating/application/views/teacher/rating.twig +++ b/~dev_rating/application/views/teacher/rating.twig @@ -84,7 +84,7 @@ <span id="maxRate">Максимальный балл: <b></b></span> </div> </div> - <div class="hidden_div"> - {{ studyGroupID }} + <div id="hidden_div"> + { "studyGroupID": "{{ studyGroupID }}" } </div> {% endblock %} \ No newline at end of file diff --git a/~dev_rating/media/js/rating.js b/~dev_rating/media/js/rating.js index 613305b7ff5fbc738fe60c4f5f9cb1560e0aa73d..ce18396a31e0e89f01f55721fd926b92da37fd3c 100644 --- a/~dev_rating/media/js/rating.js +++ b/~dev_rating/media/js/rating.js @@ -15,6 +15,13 @@ $(function() { var g_URL = (window.location.href).split("/"); var g_disciplineID = g_URL[g_URL.length - 1]; + // studyGroupID для фильтра + var json_settings = $.parseJSON($("#hidden_div").html()); + $("#hidden_div").remove(); + filterGroups(json_settings.studyGroupID); + $(".groupSelector [value='"+ json_settings.studyGroupID +"']").attr("selected", "selected"); + //console.log(json); + // Скрываем все остальные группы // 0 - показать все function filterGroups(groupID) {