diff --git a/~dev_rating/application/classes/Controller/Handler/FileCreator.php b/~dev_rating/application/classes/Controller/Handler/FileCreator.php index b8967c53722beebfec00af4282c37a1f645de01d..10c703f184906ced4a65e1401015399e0dd819b3 100644 --- a/~dev_rating/application/classes/Controller/Handler/FileCreator.php +++ b/~dev_rating/application/classes/Controller/Handler/FileCreator.php @@ -180,6 +180,7 @@ class Controller_Handler_FileCreator extends Controller_Handler // preparation $db = $this->model; $info = $db->getFinalFormInfo($disciplineID, $groupID); + $type = $info[0]['ExamType']; $templateFile = DOCROOT."docs/template $type.xls"; @@ -192,7 +193,10 @@ class Controller_Handler_FileCreator extends Controller_Handler // $specName = ''; <------- TODO $this->printDisciplineToExcelFile($objPHPExcel, $disciplineID, $groupID, $info[0]); - $this->GetHeaders("FinalForm".$disciplineID."_".$groupID); + $grade = $info[0]["GradeNum"]; + $group = $info[0]["GroupNum"]; + //$this->GetHeaders("FinalForm".$disciplineID."_".$groupID); + $this->GetHeaders("FinalForm_".$grade."_".$group); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); } diff --git a/~dev_rating/media/js/dean_office/dean_office.js b/~dev_rating/media/js/dean_office/dean_office.js index c3b782fa9a11bfc78ccdf10a2e2d68e53b2121ae..501aa5d05d5ba7bfbce49acd7fb64b36220382f5 100644 --- a/~dev_rating/media/js/dean_office/dean_office.js +++ b/~dev_rating/media/js/dean_office/dean_office.js @@ -1,31 +1,33 @@ var $ = jQuery; -function controlVisualization() { - var disciplineType = $("input[name=DisciplineType]:checked").val(); - if (disciplineType === 'exam') { - $("#SelectDisciplineDiv").show(); - $("#DownloadStatement").hide(); - } else if (disciplineType === 'credit') { - $("#SelectDisciplineDiv").hide(); - $("#DownloadStatement").show(); - } -} - $(function() { + + function controlVisualization() { + var disciplineType = $("input[name=DisciplineType]:checked").val(); + if (disciplineType === 'exam') { + $("#SelectDisciplineDiv").show(); + $("#DownloadStatement").hide(); + } else if (disciplineType === 'credit') { + $("#SelectDisciplineDiv").hide(); + $("#DownloadStatement").show(); + } + } // on page loaded controlVisualization(); var jDownloadStatement = $("#DownloadStatement"); var jDownloadExamDocument = $("#DownloadExamDocument"); + var jSelectGroup = $("#SelectGroup"); + var jSelectDiscipline = $("#SelectDiscipline"); $("#ExamChoice").change(controlVisualization); $("#CreditChoice").change(controlVisualization); + //Получить список групп по ID курса $("#SelectGrade").change(function() { var gradeID = parseInt($(this).val()) || 0; - var jSelectGroup = $("#SelectGroup"); if (gradeID > 0) { $.post( g_URLdir + "handler/GetData/GetGroups", @@ -38,6 +40,7 @@ $(function() { console.log(d.data); var i = 0; jSelectGroup.html("<option>-Не выбрана-</option>"); + jSelectDiscipline.html("<option>-Не выбрана-</option>"); for (i in d.data) { group = d.data[i]; @@ -56,6 +59,7 @@ $(function() { jDownloadStatement.attr("disabled", "disabled"); } + jDownloadExamDocument.attr("disabled", 1); }); $("#SelectGroup").change(function() { @@ -64,7 +68,6 @@ $(function() { jDownloadStatement.removeAttr("disabled"); // Заполнить список дисциплин - var jSelectDiscipline = $("#SelectDiscipline"); $.post( g_URLdir + "handler/GetData/GetDisciplinesForGroup", { @@ -89,13 +92,15 @@ $(function() { ); } else jDownloadStatement.attr("disabled", "disabled"); + + jDownloadExamDocument.attr("disabled", 1); }); $("#SelectDiscipline").change(function() { var disciplineID = parseInt($(this).val()) || 0; if (disciplineID > 0) jDownloadExamDocument.removeAttr("disabled"); - else jDownloadExamDocument.attr("disabled", "disabled"); + else jDownloadExamDocument.attr("disabled", 1); }); // Скачать ведомость