Skip to content
Snippets Groups Projects
Commit daee2b98 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

ADD: selecting grade and degree in all disciplines list #274

parent 8384ec73
Branches
No related merge requests found
$(() => {
let $gradeSelect = $('#gradeSelect');
let showContent = () => {
let gradeID = +$gradeSelect.val();
window.location = `${g_URLdir}office/disciplines?gradeID=${gradeID}`;
};
let gradeSelect = getGradeLoader($gradeSelect, OptionLoader.stubFoo)
.setOnChange(showContent);
gradeSelect.reload();
// используется jquery tablesorter: https://mottie.github.io/tablesorter/docs
// вначале сортировка по возрастанию по первой и второй колонкам
$("#disciplineTable").tablesorter({
......
......@@ -13,17 +13,21 @@ class Controller_Office_Disciplines extends Controller_Environment_Office {
}
public function action_index() {
$this->show_data(null);
$gradeID = $this->request->query('gradeID');
$this->show_data(null, $gradeID);
}
public function action_filter() {
$this->show_data($this->request->param('parameter'));
$this->show_data($this->request->param('parameter'), null);
}
private function show_data($state, $semesterID = null){
private function show_data($state, $gradeID, $semesterID = null){
$semesterID = $semesterID ?: User::instance()->SemesterID;
$facultyID = $this->user->Faculty->ID;
$parameters = ['semesterID' => $semesterID, 'facultyID' => $facultyID];
$grades = Model_Grades::loadAll()->as_array();
$grade = $grades[$gradeID];
$parameters = ['semesterID' => $semesterID, 'facultyID' => $facultyID, 'gradenum' => $grade["Num"], 'degree' => $grade["Degree"]];
$disciplines = $this->disciplines_collection->setParamValues($parameters)
->getByState($state);
$teachers = [];
......
......@@ -7,6 +7,7 @@
{{ HTML.script('static/js/libs/jquery.tablesorter.min.js')|raw }}
{{ HTML.script('static/js/libs/jquery.tablesorter.widgets.min.js')|raw }}
{{ HTML.script('static/js/optionLoader.js')|raw }}
{{ HTML.script('static/js/office/disciplines.js')|raw }}
......@@ -14,6 +15,12 @@
{% block office_content %}
<div class="selectBill Margin10 Top Bottom">
<select class="defaultForm" id="gradeSelect">
<option value="0">— Выберите курс —</option>
</select>
</div>
<p>Всего: {{ Disciplines | length }}</p>
<div class="officeList">
......
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