Skip to content
Snippets Groups Projects
Commit 365957a1 authored by Антон Шалимов's avatar Антон Шалимов
Browse files

Добавил страницу для деканата (.../~dev_rating/statement)... Перейти на...

Добавил страницу для деканата (.../~dev_rating/statement)... Перейти на страницу может любой преподаватель (далее исправим)!!!
parent 1ee62757
Branches
Tags
No related merge requests found
......@@ -332,4 +332,12 @@ Route::set('admin:common', 'admin(/<controller>(/<action>(/<param1>(:<param2>)))
'directory' => 'admin',
'controller' => 'index',
'action' => 'index'
));
/* --------------- Деканат (Ведомости) ---------------- */
Route::set('deans_office:statement', 'statement')
->defaults(array(
'directory' => 'DeansOffice',
'controller' => 'index',
'action' => 'index'
));
\ No newline at end of file
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_DeansOffice_Index extends Controller_UserEnvi {
public function action_index()
{
$twig = Twig::factory('DeansOffice/index');
$model = new Model_Teacher_Map;
$twig->GradesList = DataArray::factory('Grades')->common()->asArray();
$this->response->body($twig);
}
}
\ No newline at end of file
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Handler_GetData extends Controller_Handler
{
public function before() {
//$this->model = new Model_Teacher_Rating;
$this->setAccessLevel(self::ACCESS_USER);
parent::before();
}
// Получить список групп по ID курса
public function action_GetGroups()
{
$data['success'] = false;
$this->post -> rule('GradeID', 'not_empty')
-> rule('GradeID', 'digit');
if($this->post->check()) {
$data['data'] = DataArray::factory('StudyGroups')->ordByGroups(
$this->post->offsetGet('GradeID'), $this->user['FacultyID'] )->asArray();
$data['success'] = true;
}
$this->response->body(json_encode($data));
}
}
\ No newline at end of file
FileCreator -
GetData - , ,
\ No newline at end of file
{% extends 'base' %}
{% block title %}Деканат > Ведомости{% endblock %}
{% block media %} {# head -> css, js #}
{{ HTML.script('media/js/jquery.fileDownload.js')|raw }}
{{ HTML.style('media/css/discipline.css')|raw }}
{{ HTML.script('media/js/GetData.js')|raw }}
{% endblock %}
{% block main_top_title %}Деканат > Ведомости{% endblock %}
{% block main_content %}
<div style="text-align: center">
<p><b>Шаг 1. Выберите форму аттестации</b></p>
<div class="LayerSection">
<div class="itemBlock">
<div class="title">Форма контроля:</div>
<div class="field">
<div class="ExamTypeDiv">
<input id="ExamType" name="ExamType" type="radio" value="exam"> Экзамен
</div>
<div class="ExamTypeDiv">
<input id="ExamType" name="ExamType" type="radio" value="credit"> Зачет
</div>
</div>
</div>
</div>
<p><b>Шаг 2. Выберите курс</b></p>
<div class="LayerSection">
<div class="itemBlock">
<div class="title">Курс:</div>
<div class="field">
<select class="SelectGrade default_select" id="SelectGrade">
<option>-Не выбран-</option>
{% for Grade in GradesList %}
<option value="{{ Grade.ID }}" >{{ Grade.Title }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<p><b>Шаг 3. Выберите группу</b></p>
<div class="LayerSection">
<div class="itemBlock">
<div class="title">Группа:</div>
<div class="field">
<select class="SelectGroup default_select" id="SelectGroup" disabled>
<option>-Не выбрана-</option>
</select>
</div>
</div>
<button class="default_BlueButton" id="DownloadStatement" disabled>Скачать</button>
</div>
</div>
{% endblock %}
var $ = jQuery;
$(function() {
//Получить список групп по ID курса
$("#SelectGrade").change(function() {
var gradeID = $(this).val();
if (gradeID >= 0)
{
$.post(
g_URLdir + "handler/GetData/GetGroups",
{
"GradeID": gradeID
},
function(d){
d = $.parseJSON(d);
if(d.success === true) {
console.log(d.data);
var selectGroup = $("#SelectGroup");
var i = 0;
selectGroup.html("<option>-Не выбрана-</option>");
for (i in d.data)
{
group = d.data[i];
selectGroup.append("<option value='"+ group.ID +"'>Группа "+ group.GroupNum +" ("+ group.SpecAbbr +")</option>");
selectGroup.removeAttr("disabled");
}
$("#DownloadStatement").removeAttr("disabled");
}
}
);
}
});
// Скачать ведомость
$('body').on('click', '#DownloadStatement', function(){
$.fileDownload( g_URLdir + 'handler/FileCreator/GenerateFullStatement', {
httpMethod: "POST",
data:
{
"GroupID": parseInt($("#SelectGroup").val()),
"ExamType": $("#ExamType").val()
},
successCallback: function () {
},
failCallback: function () {
}
});
});
});
\ No newline at end of file
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