Skip to content
Snippets Groups Projects
Commit 11415bd1 authored by Антон Шалимов's avatar Антон Шалимов
Browse files

эффект памяти для нескольких дисциплин

parent 01f05c68
Branches
Tags
No related merge requests found
...@@ -35,10 +35,11 @@ class Controller_Handler_Rating extends Controller_Handler { ...@@ -35,10 +35,11 @@ class Controller_Handler_Rating extends Controller_Handler {
-> rule('groupSelected', 'not_empty'); -> rule('groupSelected', 'not_empty');
if($this->post->check()) { if($this->post->check()) {
//$SGID = Cookie::get('SGID', null); //$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_json), '3600');
Cookie::set('SGID', json_encode($SG_ar), '3600'); // Пока час
$data['success'] = true; $data['success'] = true;
} }
$this->response->body(json_encode($data)); $this->response->body(json_encode($data));
......
...@@ -8,13 +8,12 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { ...@@ -8,13 +8,12 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
$SG_json = json_decode(Cookie::get('SGID', null), true); $SG_json = json_decode(Cookie::get('SGID', null), true);
if ($SG_json !== null) if ($SG_json !== null)
{ {
var_dump($SG_json, $id); //var_dump($SG_json);
if (array_key_exists($id, $SG_json)) if (array_key_exists($id, $SG_json))
return $SG_json[$id]; return $SG_json[$id];
else return 0; else return 0;
} } else return 0;
} }
public function action_edit() public function action_edit()
......
...@@ -20,7 +20,6 @@ $(function() { ...@@ -20,7 +20,6 @@ $(function() {
$("#hidden_div").remove(); $("#hidden_div").remove();
filterGroups(json_settings.studyGroupID); filterGroups(json_settings.studyGroupID);
$(".groupSelector [value='"+ json_settings.studyGroupID +"']").attr("selected", "selected"); $(".groupSelector [value='"+ json_settings.studyGroupID +"']").attr("selected", "selected");
//console.log(json);
// Скрываем все остальные группы // Скрываем все остальные группы
// 0 - показать все // 0 - показать все
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment