Skip to content
Snippets Groups Projects
Commit 576a96d7 authored by PavelBegunkov's avatar PavelBegunkov
Browse files
parents d0a1a078 19022d32
Branches
Tags
No related merge requests found
...@@ -12,14 +12,12 @@ class Controller_Student_Index extends Controller_UserEnvi { ...@@ -12,14 +12,12 @@ class Controller_Student_Index extends Controller_UserEnvi {
foreach($disciplines as $row) foreach($disciplines as $row)
{ {
$i++; $i++;
$disciplinesHandled[$i]['ID'] = $row['DisciplineID'];
if($row['ExamType'] == 'exam') if($row['ExamType'] == 'exam')
$disciplinesHandled[$i]['Control'] = 'Экзамен'; $disciplinesHandled[$i]['Control'] = 'Экзамен';
elseif($row['ExamType'] == 'credit') elseif($row['ExamType'] == 'credit')
$disciplinesHandled[$i]['Control'] = 'Зачет'; $disciplinesHandled[$i]['Control'] = 'Зачет';
$disciplinesHandled[$i]['Teacher'] = $row['TeacherLast'].' '.UTF8::substr($row['TeacherFirst'], 0, 1).'. '; $disciplinesHandled[$i]['Teachers'] = $this->getTeachersForDiscipline($row['DisciplineID']);
if(!empty($row['TeacherSecond']))
$disciplinesHandled[$i]['Teacher'] .= UTF8::substr($row['TeacherSecond'], 0, 1).'.';
$disciplinesHandled[$i]['ID'] = $row['SubjectID'];
$disciplinesHandled[$i]['Title'] = $row['SubjectName']; $disciplinesHandled[$i]['Title'] = $row['SubjectName'];
$disciplinesHandled[$i]['Rate'] = $row['Rate']; $disciplinesHandled[$i]['Rate'] = $row['Rate'];
$disciplinesHandled[$i]['MaxRate'] = $row['MaxCurrentRate']; $disciplinesHandled[$i]['MaxRate'] = $row['MaxCurrentRate'];
...@@ -29,6 +27,22 @@ class Controller_Student_Index extends Controller_UserEnvi { ...@@ -29,6 +27,22 @@ class Controller_Student_Index extends Controller_UserEnvi {
} }
$this->response->body($twig); $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() { public function action_settings() {
$twig = Twig::factory('settings'); $twig = Twig::factory('settings');
......
<?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
...@@ -2,22 +2,24 @@ ...@@ -2,22 +2,24 @@
{% macro subject(i, HTML) %} {% macro subject(i, HTML) %}
<tr class="course_content"> <tr class="course_content">
<td class = "course_img"></td>
<td class = "course_name"> <td class = "course_name">
{{ HTML.anchor('subject/' ~ i.ID, i.Title)|raw }} {{ HTML.anchor('subject/' ~ i.ID, i.Title)|raw }}
</td> </td>
<td class="course_teacher"> <td class="course_teacher">
{{ i.Teacher }} {% for teacher in i.Teachers %}
<div>{{ teacher }}</div>
{% else %}
---
{% endfor %}
</td> </td>
<td class="course_form_control"> <td class="course_form_control">
{{ i.Control }} {{ i.Control }}
</td> </td>
<td class="course_rating_value"> <td class="course_rating_value">
{{ i.Rate|default('0') }} / {{ i.MaxRate|default('0') }} {{ i.Rate|default('0') }} / {{ i.MaxRate|default('0') }}
</td> </td>
<td class="course_rating_percent"> <td class="course_rating_percent">
...@@ -44,7 +46,6 @@ ...@@ -44,7 +46,6 @@
{% if disciplines|length > 0 %} {% if disciplines|length > 0 %}
<table cellspacing="0" border="0" width="100%" class="table"> <table cellspacing="0" border="0" width="100%" class="table">
<tr class="course_table_top"> <tr class="course_table_top">
<td>&nbsp;</td>
<td>Предмет</td> <td>Предмет</td>
<td>Преподаватель</td> <td>Преподаватель</td>
<td>Форма контроля</td> <td>Форма контроля</td>
......
...@@ -29,6 +29,11 @@ tr.course_table_top td { ...@@ -29,6 +29,11 @@ tr.course_table_top td {
background-color: #f1f1f1; background-color: #f1f1f1;
} }
.course_content > td
{
padding: 10px;
}
.course_content { .course_content {
text-align: center; text-align: center;
/*border-bottom: 1px solid; /*border-bottom: 1px solid;
...@@ -44,7 +49,7 @@ tr.course_table_top td { ...@@ -44,7 +49,7 @@ tr.course_table_top td {
.course_name { .course_name {
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: left;
} }
.course_name a:link, a:visited { .course_name a:link, a:visited {
......
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