diff --git a/~dev_rating/application/bootstrap.php b/~dev_rating/application/bootstrap.php index 55cb70cd4c0988f94379d98b6933e9e31c5b90fc..c356dc4f0b83334ee95ec162fabd4c7577de072e 100644 --- a/~dev_rating/application/bootstrap.php +++ b/~dev_rating/application/bootstrap.php @@ -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 diff --git a/~dev_rating/application/classes/Controller/DeansOffice/Index.php b/~dev_rating/application/classes/Controller/DeansOffice/Index.php new file mode 100644 index 0000000000000000000000000000000000000000..bc889c9a23ea6845fbb8148650964322e0b9a4cc --- /dev/null +++ b/~dev_rating/application/classes/Controller/DeansOffice/Index.php @@ -0,0 +1,14 @@ +<?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 diff --git a/~dev_rating/application/classes/Controller/Handler/GetData.php b/~dev_rating/application/classes/Controller/Handler/GetData.php new file mode 100644 index 0000000000000000000000000000000000000000..8894c24d045cba86fa8c1f809367b099d34432b7 --- /dev/null +++ b/~dev_rating/application/classes/Controller/Handler/GetData.php @@ -0,0 +1,27 @@ +<?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 diff --git a/~dev_rating/application/classes/Controller/Handler/readme.txt b/~dev_rating/application/classes/Controller/Handler/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..228867ba6313984fe8b09ccb97ec8e7a2d0180fc --- /dev/null +++ b/~dev_rating/application/classes/Controller/Handler/readme.txt @@ -0,0 +1,2 @@ +FileCreator - создание ведомостей +GetData - Получить список групп, курсов, предметов и тд \ No newline at end of file diff --git a/~dev_rating/application/views/DeansOffice/index.twig b/~dev_rating/application/views/DeansOffice/index.twig new file mode 100644 index 0000000000000000000000000000000000000000..c581837a3065a5ac7aa7ebb3e106d0707bfeaf4c --- /dev/null +++ b/~dev_rating/application/views/DeansOffice/index.twig @@ -0,0 +1,60 @@ +{% 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 %} diff --git a/~dev_rating/media/js/GetData.js b/~dev_rating/media/js/GetData.js new file mode 100644 index 0000000000000000000000000000000000000000..b6f2a1dbac66f9b704f395e7115ad953bd6ee765 --- /dev/null +++ b/~dev_rating/media/js/GetData.js @@ -0,0 +1,52 @@ +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