diff --git a/db/StoredProcedures.sql b/db/StoredProcedures.sql
index d2f0dc8a5048eb21a7cc2d43282883bdbd47c079..d31ac441caf5f2449cb7b408fdd92a6e95f1132e 100644
--- a/db/StoredProcedures.sql
+++ b/db/StoredProcedures.sql
@@ -833,7 +833,7 @@ BEGIN
     
     # type 1: student
     #      2: teacher
-    IF vAccountType = 'student' THEN
+    IF vAccountType = 1 THEN
         SELECT  view_students.LastName,
                 view_students.FirstName,
                 view_students.SecondName,
@@ -1404,11 +1404,11 @@ NO SQL
                 view_students.LastName,
                 view_students.FirstName,
                 view_students.SecondName,
-            view_students.GradeID,
-            view_students.GradeNum,
-            view_students.Degree,
-            view_students.GroupID,
-            view_students.GroupNum
+                view_students.GradeID,
+                view_students.GradeNum,
+                view_students.Degree,
+                view_students.GroupID,
+                view_students.GroupNum
         FROM `view_students`
             LEFT JOIN `disciplines_students` ON disciplines_students.StudentID = view_students.StudentID AND
                                                 disciplines_students.DisciplineID = pDisciplineID
@@ -2180,7 +2180,7 @@ BEGIN
         INTO vChecker
         FROM `disciplines_groups`
         WHERE   disciplines_groups.GroupID = pGroupID AND
-                disciplines_groups.DisciplineID = pGroupID
+                disciplines_groups.DisciplineID = pDisciplineID
         LIMIT 1;
     IF vChecker > 0 THEN
         RETURN 1;
@@ -2664,7 +2664,7 @@ BEGIN
 
     INSERT INTO `modules`   
         (Name, OrderNum, DisciplineID )
-        VALUES (Name , vChecker , DisciplineID );
+        VALUES (Name , vChecker , pDisciplineID );
     
 
     RETURN  (SELECT  modules.ID
@@ -2701,7 +2701,7 @@ BEGIN
 
     INSERT INTO `modules`   
             (   Name, OrderNum, DisciplineID, Type )
-    VALUES  (   'Экзамен' , 3141692 , DisciplineID, 2 );
+    VALUES  (   'Экзамен' , 3141692 , pDisciplineID, 2 );
 
     SELECT  modules.ID
         INTO vModule
diff --git a/db/Views.sql b/db/Views.sql
index f99c041fc1825aabcfba8cf6eba901cfe8438b99..037093a55dcf88229ec8c675c86035c27517a180 100644
--- a/db/Views.sql
+++ b/db/Views.sql
@@ -140,8 +140,10 @@ CREATE OR REPLACE VIEW `view_rating` AS
             rating_table.Date,
             rating_table.TeacherID
         FROM `view_roadmap`
-        LEFT JOIN `rating_table` ON rating_table.SubmoduleID = view_roadmap.SubmoduleID 
-        INNER JOIN `view_students` ON rating_table.StudentID = view_students.StudentID; 
+        LEFT JOIN `view_disciplines_students` ON view_disciplines_students.DisciplineID = view_roadmap.DisciplineID
+        LEFT JOIN `rating_table` ON rating_table.SubmoduleID = view_roadmap.SubmoduleID AND
+                                    rating_table.StudentID = view_disciplines_students.StudentID
+        LEFT JOIN `view_students` ON rating_table.StudentID = view_students.StudentID;
 
 
 
diff --git a/~dev_rating/application/classes/Controller/Handler/Map.php b/~dev_rating/application/classes/Controller/Handler/Map.php
index 96ba7e6744e47dd520eed06f69f5721f2b272093..89ba4589278d6ee47dde07c3e5ab286a2c49a553 100644
--- a/~dev_rating/application/classes/Controller/Handler/Map.php
+++ b/~dev_rating/application/classes/Controller/Handler/Map.php
@@ -538,9 +538,9 @@ class Controller_Handler_Map extends Controller_Handler {
 				foreach($SeResult as $row){
 					$i++;
 					$SearchResult[$i]['TeacherID'] = $row['ID'];
-					$SearchResult[$i]['TeacherLast'] = $row['Last'];
-					$SearchResult[$i]['TeacherFirst'] = $row['First'];
-					$SearchResult[$i]['TeacherSecond'] = $row['Second'];
+					$SearchResult[$i]['TeacherLast'] = $row['LastName'];
+					$SearchResult[$i]['TeacherFirst'] = $row['FirstName'];
+					$SearchResult[$i]['TeacherSecond'] = $row['SecondName'];
 					$SearchResult[$i]['JobPositionName'] = $row['JobPositionName'];
 					$SearchResult[$i]['DepID'] = $row['DepID'];
 				}
diff --git a/~dev_rating/application/classes/Controller/Teacher/Discipline.php b/~dev_rating/application/classes/Controller/Teacher/Discipline.php
index a7d2929c12e78845967b077c8ef71367f2d930b9..29dc6b8218744427e63829c9b87547ec6e9134ac 100644
--- a/~dev_rating/application/classes/Controller/Teacher/Discipline.php
+++ b/~dev_rating/application/classes/Controller/Teacher/Discipline.php
@@ -76,7 +76,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi {
         $i = 0; 
         $k = 0;
         foreach($students as $row) {
-            if ($row['Type'] == 'attach'){
+            if ($row['AttachType'] == 'attach'){
                 if ($row['GroupID'] != $groupID) {
                     $groupID = $row['GroupID'];
                     $k++;
@@ -92,7 +92,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi {
                 $attachStdHandled[$k]['students'][$n]['LastName'] = $row['LastName'];
                 $attachStdHandled[$k]['students'][$n]['FirstName'] = $row['FirstName'];
                 $attachStdHandled[$k]['students'][$n]['SecondName'] = $row['SecondName'];
-                $attachStdHandled[$k]['students'][$n]['Type'] = $row['Type'];
+                $attachStdHandled[$k]['students'][$n]['AttachType'] = $row['AttachType'];
 
                 // $k++;
                 // $attachStdHandled['StdCount'] += 1;
@@ -124,7 +124,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi {
                 $stdHandled[$i]['students'][$j]['LastName'] = $row['LastName'];
                 $stdHandled[$i]['students'][$j]['FirstName'] = $row['FirstName'];
                 $stdHandled[$i]['students'][$j]['SecondName'] = $row['SecondName'];
-                $stdHandled[$i]['students'][$j]['Type'] = $row['Type'];
+                $stdHandled[$i]['students'][$j]['AttachType'] = $row['AttachType'];
             }
 
         }
diff --git a/~dev_rating/application/classes/DataArr/Students.php b/~dev_rating/application/classes/DataArr/Students.php
index 4b507cb9b5ede4ea5d7c94e598e1d5a84e12f344..8156ae7b65193845fe8c1c1517f0729ce8e63abd 100644
--- a/~dev_rating/application/classes/DataArr/Students.php
+++ b/~dev_rating/application/classes/DataArr/Students.php
@@ -58,16 +58,14 @@ class DataArr_Students {
         {
             $i++;
             $studentsHandled[$i]['ID'] = $row['ID'];
-            $studentsHandled[$i]['AccountID'] = $row['AccountID'];
             $studentsHandled[$i]['LastName'] = $row['LastName'];
             $studentsHandled[$i]['FirstName'] = $row['FirstName'];
-            $studentsHandled[$i]['SecondName'] = $row['Second'];
+            $studentsHandled[$i]['SecondName'] = $row['SecondName'];
             $studentsHandled[$i]['GroupID'] = $row['GroupID'];
             $studentsHandled[$i]['GroupNum'] = $row['GroupNum'];
             $studentsHandled[$i]['GradeID'] = $row['GradeID']; // ID РєСѓСЂСЃР°
             $studentsHandled[$i]['GradeNum'] = $row['GradeNum']; // НОМЕР курса, а не ID... ID почти всегда <> НОМЕРУ курса
             $studentsHandled[$i]['Degree'] = $this->getDegreeTitle($row['Degree']);
-            $studentsHandled[$i]['Type'] = $row['Type'];
         }
         return $studentsHandled;
     }
@@ -75,6 +73,7 @@ class DataArr_Students {
     public function NotAttendingDiscipline($GradeID, $GroupID, $FacultyID, $Name, $DisciplineID)
     {
         $students = $this->model->SearchStudents($GradeID, $GroupID, $FacultyID, $Name, $DisciplineID);
+        //echo Debug::vars($students);
         return new DataArray_Result($this->generateArray($students));
     }
 }
diff --git a/~dev_rating/application/views/teacher/discipline/EditStudents.twig b/~dev_rating/application/views/teacher/discipline/EditStudents.twig
index 89083d9a817d7388c88bb0ec12b24d731279272c..2a026fac7d0bb8c211274e28787ceacfc4136f85 100644
--- a/~dev_rating/application/views/teacher/discipline/EditStudents.twig
+++ b/~dev_rating/application/views/teacher/discipline/EditStudents.twig
@@ -10,7 +10,7 @@
 {% macro outputStudent(Student) %}
     <div id="{{ Student.ID }}" class="Student {% if Student.Type == 'detach' %}StatusUnbind{% else %}StatusBind{% endif %}">
         <span class="Name">{{ Student.LastName }} {{ Student.FirstName }} {{ Student.SecondName  }}</span>
-        {% if Student.Type == 'detach' %}
+        {% if Student.AttachType == 'detach' %}
             <button class="action Action_BindStudent">Прикрепить студента</button>
         {% else %}
             <button class="action Action_UnbindStudent">Отсоединить студента</button>
diff --git a/~dev_rating/modules/account/classes/Kohana/User.php b/~dev_rating/modules/account/classes/Kohana/User.php
index 4bbb05f51eca38a43705a6e4a1978e059961df6c..5336e6bb2b0329a80c680cdaeab68ad6167e6818 100644
--- a/~dev_rating/modules/account/classes/Kohana/User.php
+++ b/~dev_rating/modules/account/classes/Kohana/User.php
@@ -253,6 +253,8 @@ class Kohana_User implements ArrayAccess {
     {
         if($this->isSignedIn())
             return $this->_userInfo + $this->_session->as_array();
+        else
+            return array();
     }
     
     protected function _getInfoFromDB($id)
diff --git a/~dev_rating/modules/account/classes/Model/Kohana/Account.php b/~dev_rating/modules/account/classes/Model/Kohana/Account.php
index 1ac848c066f4fa94ec252af4f2658e63493b53e8..76326a0dfda885b34d31c626f3c2eebc9ccf7c01 100644
--- a/~dev_rating/modules/account/classes/Model/Kohana/Account.php
+++ b/~dev_rating/modules/account/classes/Model/Kohana/Account.php
@@ -22,23 +22,23 @@ class Model_Kohana_Account extends Model
         return $res->get('ID');
     }
     
-    public function ChangeTeacherInfo($id, $lastName, $firstName, $secondName, $degreeID, $departamentID)
+    public function ChangeTeacherInfo($id, $lastName, $firstName, $secondName, $degreeID, $departmentID)
     {
-        $sql = "SELECT `ChangeTeacherInfo`('$id', '$lastName', '$firstName', '$secondName', '$degreeID', '$departamentID') AS `UserID`;";
+        $sql = "SELECT `ChangeTeacherInfo`('$id', '$lastName', '$firstName', '$secondName', '$degreeID', '$departmentID') AS `UserID`;";
         $key = DB::query(Database::SELECT, $sql)->execute();
         return $key->get('UserID');
     }
     
-    public function createTeacher($lastName, $firstName, $secondName, $degreeID, $departamentID, $activationCode)
+    public function createTeacher($lastName, $firstName, $secondName, $degreeID, $departmentID, $activationCode)
     {
-        $sql = "SELECT `CreateTeacher`('$lastName', '$firstName', '$secondName', '$degreeID', '$departamentID', '$activationCode') AS `UserID`;";
+        $sql = "SELECT `CreateTeacher`('$lastName', '$firstName', '$secondName', '$degreeID', '$departmentID', '$activationCode') AS `UserID`;";
         $key = DB::query(Database::SELECT, $sql)->execute();
         return $key->get('UserID');
     }
     
-    public function createTeacherByDepName($lastName, $firstName, $secondName, $departamentName, $activationCode)
+    public function createTeacherByDepName($lastName, $firstName, $secondName, $departmentName, $activationCode)
     {
-        $sql = "SELECT `CreateTeacherByDepName`('$lastName', '$firstName', '$secondName', '$departamentName', '$activationCode') AS `UserID`;";
+        $sql = "SELECT `CreateTeacherByDepName`('$lastName', '$firstName', '$secondName', '$departmentName', '$activationCode') AS `UserID`;";
         $key = DB::query(Database::SELECT, $sql)->execute();
         return $key->get('UserID');
     }