Skip to content
Snippets Groups Projects
Commit 785cbd54 authored by xamgore's avatar xamgore
Browse files

refs #106. Improves behaviour of the faculty select menu

parent f40da25e
Branches
Tags
No related merge requests found
......@@ -146,7 +146,8 @@ class Controller_Teacher_Discipline extends Controller_UserEnvironment {
$twig->BindTeachersList = Model_Teachers::getNamesForDiscipline($id);
$twig->FacultiesList = Model_Faculties::toArray();
$twig->Departments = Model_Departments::byFaculty($this->user['FacultyID']);
$twig->Author = Model_Account::getPersonalInfo($twig->Discipline['AuthorID']);
$this->response->body($twig);
}
......
......@@ -29,7 +29,7 @@
<input type="hidden" class="HiddenInputFacultyID" value="{{ Discipline.FacultyID }}">
<select class="SelectFaculty defaultForm">
{% for Faculty in FacultiesList %}
<option value="{{ Faculty.ID }}" {% if User.FacultyID == Faculty.ID %}selected{% endif %}>{{ Faculty.Name }}</option>
<option value="{{ Faculty.ID }}" {% if Author.FacultyID == Faculty.ID %}selected{% endif %}>{{ Faculty.Name }}</option>
{% endfor %}
</select>
<select class="SelectDepartment defaultForm">
......
......@@ -113,14 +113,14 @@ class Model_Kohana_Account extends Model
return $response->get('Num');
}
public function getPersonalInfo($id)
public static function getPersonalInfo($id)
{
$sql = "CALL `GetPersonalInfo`('$id');";
$query = DB::query(Database::SELECT, $sql)->execute();
return $query[0];
}
public function GetAccountInfo($id)
public static function GetAccountInfo($id)
{
$sql = "CALL GetAccountInfo('$id');";
$query = DB::query(Database::SELECT, $sql)->execute();
......
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