diff --git a/~dev_rating/application/classes/Controller/Student/Index.php b/~dev_rating/application/classes/Controller/Student/Index.php index c17a7d6fea8ca700b658295424071ae260998269..568ed66834956388de2d415039e12d5946c73a3d 100644 --- a/~dev_rating/application/classes/Controller/Student/Index.php +++ b/~dev_rating/application/classes/Controller/Student/Index.php @@ -12,14 +12,12 @@ class Controller_Student_Index extends Controller_UserEnvi { foreach($disciplines as $row) { $i++; + $disciplinesHandled[$i]['ID'] = $row['DisciplineID']; if($row['ExamType'] == 'exam') $disciplinesHandled[$i]['Control'] = 'Ркзамен'; elseif($row['ExamType'] == 'credit') $disciplinesHandled[$i]['Control'] = 'Зачет'; - $disciplinesHandled[$i]['Teacher'] = $row['TeacherLast'].' '.UTF8::substr($row['TeacherFirst'], 0, 1).'. '; - if(!empty($row['TeacherSecond'])) - $disciplinesHandled[$i]['Teacher'] .= UTF8::substr($row['TeacherSecond'], 0, 1).'.'; - $disciplinesHandled[$i]['ID'] = $row['SubjectID']; + $disciplinesHandled[$i]['Teachers'] = $this->getTeachersForDiscipline($row['DisciplineID']); $disciplinesHandled[$i]['Title'] = $row['SubjectName']; $disciplinesHandled[$i]['Rate'] = $row['Rate']; $disciplinesHandled[$i]['MaxRate'] = $row['MaxCurrentRate']; @@ -29,6 +27,22 @@ class Controller_Student_Index extends Controller_UserEnvi { } $this->response->body($twig); } + + protected function getTeachersForDiscipline($id) { + $model = new Model_Student; + $teachers = $model->getTeachersForDiscipline($id); + $teachersHandled = array(); $i = 0; + foreach ($teachers as $teacher) + { + $i++; + $teachersHandled[$i] = $teacher['TeacherLast'].' '.UTF8::substr($teacher['TeacherFirst'], 0, 1).'. '; + if(!empty($teacher['TeacherSecond'])) + { + $teachersHandled[$i] .= UTF8::substr($teacher['TeacherSecond'], 0, 1).'.'; + } + } + return $teachersHandled; + } public function action_settings() { $twig = Twig::factory('settings'); diff --git a/~dev_rating/application/classes/Controller/Student/Profile.php b/~dev_rating/application/classes/Controller/Student/Profile.php deleted file mode 100644 index 4515601266ee4f1d02597e28bcec9d21afc0810c..0000000000000000000000000000000000000000 --- a/~dev_rating/application/classes/Controller/Student/Profile.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php defined('SYSPATH') or die('No direct script access.'); - -class Controller_Student_Profile extends Controller_UserEnvi { - - public function action_show() - { - $twig = Twig::factory('student/profile'); - $twig->User = $this->UserInfo; - $this->response->body($twig); - } -} \ No newline at end of file diff --git a/~dev_rating/application/views/student/index.twig b/~dev_rating/application/views/student/index.twig index f90f83d9858630ec3f294a8fd0387198a2d3a6d5..fa90ea3a97c813f3f145b57cdc8075d2843bb5b4 100644 --- a/~dev_rating/application/views/student/index.twig +++ b/~dev_rating/application/views/student/index.twig @@ -2,22 +2,24 @@ {% macro subject(i, HTML) %} <tr class="course_content"> - <td class = "course_img"></td> - <td class = "course_name"> - {{ HTML.anchor('subject/' ~ i.ID, i.Title)|raw }} + {{ HTML.anchor('subject/' ~ i.ID, i.Title)|raw }} </td> <td class="course_teacher"> - {{ i.Teacher }} + {% for teacher in i.Teachers %} + <div>{{ teacher }}</div> + {% else %} + --- + {% endfor %} </td> <td class="course_form_control"> - {{ i.Control }} + {{ i.Control }} </td> <td class="course_rating_value"> - {{ i.Rate|default('0') }} / {{ i.MaxRate|default('0') }} + {{ i.Rate|default('0') }} / {{ i.MaxRate|default('0') }} </td> <td class="course_rating_percent"> @@ -44,7 +46,6 @@ {% if disciplines|length > 0 %} <table cellspacing="0" border="0" width="100%" class="table"> <tr class="course_table_top"> - <td> </td> <td>Предмет</td> <td>Преподаватель</td> <td>Форма контроля</td> diff --git a/~dev_rating/media/css/results.css b/~dev_rating/media/css/results.css index 5d350ccc24c20a98e787c30b687d0cce98d2e6bb..78765c1766dd7ee47b4ddc81ddc96c4372c76a18 100644 --- a/~dev_rating/media/css/results.css +++ b/~dev_rating/media/css/results.css @@ -29,6 +29,11 @@ tr.course_table_top td { background-color: #f1f1f1; } +.course_content > td +{ + padding: 10px; +} + .course_content { text-align: center; /*border-bottom: 1px solid; @@ -44,7 +49,7 @@ tr.course_table_top td { .course_name { vertical-align: middle; - text-align: center; + text-align: left; } .course_name a:link, a:visited {