diff --git a/~dev_rating/application/classes/Controller/Handler/Rating.php b/~dev_rating/application/classes/Controller/Handler/Rating.php index b5cbb6bfb466988527be4f4203980e4dfcaa4316..03e0d71354c48ea2df51224b4f6a1088107ec1c0 100644 --- a/~dev_rating/application/classes/Controller/Handler/Rating.php +++ b/~dev_rating/application/classes/Controller/Handler/Rating.php @@ -35,10 +35,11 @@ class Controller_Handler_Rating extends Controller_Handler { -> rule('groupSelected', 'not_empty'); if($this->post->check()) { //$SGID = Cookie::get('SGID', null); + $SG_json = json_decode(Cookie::get('SGID', null), true); + + $SG_json[$this->post->offsetGet('disciplineID')] = $this->post->offsetGet('groupSelected'); - $SG_ar[$this->post->offsetGet('disciplineID')] = $this->post->offsetGet('groupSelected'); - - Cookie::set('SGID', json_encode($SG_ar), '3600'); // Пока час + Cookie::set('SGID', json_encode($SG_json), '3600'); $data['success'] = true; } $this->response->body(json_encode($data)); diff --git a/~dev_rating/application/classes/Controller/Teacher/Rating.php b/~dev_rating/application/classes/Controller/Teacher/Rating.php index 8e481273b2d57500984fcfb56a6b4c84588d71b8..82ab188ce8fd964c963a867c3d79fb32aef25855 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Rating.php +++ b/~dev_rating/application/classes/Controller/Teacher/Rating.php @@ -8,13 +8,12 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { $SG_json = json_decode(Cookie::get('SGID', null), true); if ($SG_json !== null) { - var_dump($SG_json, $id); + //var_dump($SG_json); - if (array_key_exists($id, $SG_json)) return $SG_json[$id]; else return 0; - } + } else return 0; } public function action_edit() diff --git a/~dev_rating/media/js/rating.js b/~dev_rating/media/js/rating.js index ce18396a31e0e89f01f55721fd926b92da37fd3c..59394a8d398f0c114ce3f42b3c3c048003d7dc2a 100644 --- a/~dev_rating/media/js/rating.js +++ b/~dev_rating/media/js/rating.js @@ -20,7 +20,6 @@ $(function() { $("#hidden_div").remove(); filterGroups(json_settings.studyGroupID); $(".groupSelector [value='"+ json_settings.studyGroupID +"']").attr("selected", "selected"); - //console.log(json); // Скрываем все остальные группы // 0 - показать все