Skip to content
Snippets Groups Projects
Commit 6d1cbe47 authored by RomanSteinberg's avatar RomanSteinberg
Browse files

Refactoring; ADD: dean office exam operations;

parent 4cb104ab
Branches
Tags
No related merge requests found
......@@ -170,7 +170,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
}
// Ведомость
public function action_GenerateExcelStatement()
public function action_GenerateFinalForm()
{
// TODO CHECK!!! // TODO
// parameters
......@@ -354,21 +354,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
if ($totalRateValue > 100)
$totalRateValue = 100;
$totalRate = '';
$rateOfFive = '';
$examRate = '';
if ($rate < 38) {
$totalRate = ' ';
$rateOfFive = 'неуд';
$examRate ='0';
} elseif (($rate >= 38) and ($examRateValue >= 22)) {
$totalRate = $totalRateValue;
$rateOfFive = 'удовл';
if (($totalRateValue >= 75) and ($totalRateValue < 85))
$rateOfFive = 'хор';
elseif ($totalRateValue >= 85)
$rateOfFive = 'отл';
}
list($totalRate, $rateOfFive, $examRate) = $this->formRateOfFive($rate, $examRateValue, $totalRateValue);
$sheet ->setCellValue($indPosition.$row, $index)
->setCellValue($namePosition.$row, $fullName)
......@@ -475,4 +461,30 @@ class Controller_Handler_FileCreator extends Controller_Handler
$this->response->headers("Content-Disposition", "attachment; filename=".$filename.".xls" );
}
/**
* @param $rate
* @param $examRateValue
* @param $totalRateValue
* @return array
*/
protected function formRateOfFive($rate, $examRateValue, $totalRateValue)
{
$totalRate = '';
$rateOfFive = '';
$examRate = '';
if ($rate < 38) {
$totalRate = ' ';
$rateOfFive = 'неуд';
$examRate = '0';
} elseif (($rate >= 38) and ($examRateValue >= 22)) {
$totalRate = $totalRateValue;
$rateOfFive = 'удовл';
if (($totalRateValue >= 75) and ($totalRateValue < 85))
$rateOfFive = 'хор';
elseif ($totalRateValue >= 85)
$rateOfFive = 'отл';
}
return array($totalRate, $rateOfFive, $examRate);
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
{{ HTML.script('media/js/jquery.fileDownload.js')|raw }}
{{ HTML.style('media/css/discipline.css')|raw }}
{{ HTML.script('media/js/getFinalForms.js')|raw }}
{{ HTML.script('media/js/dean_office/dean_office.js')|raw }}
{% endblock %}
{% block main_top_title %}Деканат > Ведомости{% endblock %}
......@@ -18,7 +18,7 @@
<div class="title">Форма контроля:</div>
<div class="field">
<div class="ExamTypeDiv">
<input id="ExamType" name="ExamType" type="radio" value="exam" disabled> Экзамен
<input id="ExamType" name="ExamType" type="radio" value="exam"> Экзамен
</div>
<div class="ExamTypeDiv">
<input id="ExamType" name="ExamType" type="radio" value="credit" checked> Зачет
......@@ -55,6 +55,29 @@
<button class="default_BlueButton" id="DownloadStatement" disabled>Скачать</button>
</div>
<p><b>Шаг 4. Дисциплина</b></p>
<div class="LayerSection">
<div class="itemBlock">
<div class="title">Курс:</div>
<div class="field">
<select class="SelectDiscipline default_select" id="SelectDiscipline">
<option>-Не выбран-</option>
{#
{% for Discipline in DisciplinesList %}
<option value="{{ Discipline.ID }}" >{{ Discipline.SubjectName }}</option>
{% endfor %}
#}
</select>
</div>
</div>
<button class="default_BlueButton" id="DownloadExamDocument" disabled>Скачать</button>
<button class="default_BlueButton" id="BlockExamDiscipline" disabled>Блокировать</button>
<button class="default_BlueButton" id="BlockAndPrintExam" disabled>Блокировать и Скачать</button>
</div>
</div>
{% endblock %}
var $ = jQuery;
$(function() {
var jDownloadStatement = $("#DownloadStatement");
var jDownloadStatement = $("#DownloadStatement");
//Получить список групп по ID курса
//Получить список групп по ID курса
$("#SelectGrade").change(function() {
var gradeID = parseInt($(this).val()) || 0;
var jSelectGroup = $("#SelectGroup");
......@@ -40,15 +40,15 @@ $(function() {
}
});
$("#SelectGroup").change(function() {
var groupID = parseInt($(this).val()) || 0;
$("#SelectGroup").change(function() {
var groupID = parseInt($(this).val()) || 0;
if (groupID > 0)
jDownloadStatement.removeAttr("disabled");
else jDownloadStatement.attr("disabled", "disabled");
});
});
// Скачать ведомость
$('body').on('click', '#DownloadStatement', function(){
$('body').on('click', '#DownloadStatement', function(){
$.fileDownload( g_URLdir + 'handler/FileCreator/GenerateFinalFormsForGroup', {
httpMethod: "POST",
data:
......@@ -65,4 +65,26 @@ $(function() {
});
});
// Печать ведомости
$('body').on('click', '#DownloadExamDocument', function(){
$.fileDownload( g_URLdir + 'handler/FileCreator/GenerateFinalForm', {
httpMethod: "POST",
data:
{
"GroupID": parseInt($("#SelectGroup").val()),
"ExamType": $("#ExamType:checked").val()
},
successCallback: function () {
},
failCallback: function () {
EventInspector_ShowMsg('Не удалось напечатать ведомость!', 'error');
}
});
});
// Блокирование дисциплины
// Печать ведомости и блокирование дисциплины
});
\ No newline at end of file
......@@ -338,7 +338,7 @@ $(function() {
// Ведомость в формате excel
$('body').on('click', '.downloadExcelStatement', function(){
$.fileDownload(URLdir + 'handler/FileCreator/GenerateExcelStatement', {
$.fileDownload(URLdir + 'handler/FileCreator/GenerateFinalForm', {
httpMethod: "POST",
data:
{
......
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